mirror of
https://github.com/janishutz/mqtt-remote-gpio.git
synced 2026-10-09 05:06:21 +02:00
feat: off timeout setting respected, topics
This commit is contained in:
1 parent
55d9aec4f2
commit
0b0efb1a0d
3 files changed
+27
-5
No files matched your search
+2
-1
@@ -35,7 +35,7 @@ pub fn handler(config: Config) {
|
||||
// TODO: handle fails
|
||||
client
|
||||
.publish(
|
||||
&topic.topic,
|
||||
String::from(&topic.topic) + &format!("/{}", topic.id),
|
||||
QoS::AtLeastOnce,
|
||||
false,
|
||||
vec![read_pin(&mut topic.gpio)],
|
||||
@@ -49,6 +49,7 @@ pub fn handler(config: Config) {
|
||||
// Main thread listens to topic updates
|
||||
let mut controller = GPIOController::new(output_pins);
|
||||
for (_, notification) in connection.iter().enumerate() {
|
||||
controller.iter_handler();
|
||||
let msg = notification.unwrap();
|
||||
if let Event::Incoming(val) = msg {
|
||||
if let Publish(content) = val {
|
||||
|
||||
Reference in new issue
Block a user