Skip to content

Commit

Permalink
mqtt: subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
fooker committed Mar 16, 2024
1 parent 5d9a40a commit d681fa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions interface-mqtt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ impl Interface for MQTT<'_> {
for input in introspection.inputs.values() {
let topic = realm.topic(format!("input/{}/set", input.name));
topics.insert(topic, input);

client.subscribe(topic.to_owned(), QoS::AtLeastOnce).await?;
eprintln!("⇄ Subscribed to '{}' for input '{}' with type {}", topic, input.name, input.value_type);
}

while let Ok(event) = event_loop.poll().await {
Expand Down

0 comments on commit d681fa3

Please sign in to comment.