This commit is contained in:
Robin Appelman 2020-11-15 19:21:29 +01:00
commit a4ff434120

View file

@ -115,6 +115,11 @@ async fn mqtt_client(host: &str, port: u16, device_states: DeviceStates) {
while let Ok(notification) = event_loop.poll().await { while let Ok(notification) = event_loop.poll().await {
if let Event::Incoming(Packet::Publish(message)) = notification { if let Event::Incoming(Packet::Publish(message)) = notification {
println!(
"{} {}",
message.topic,
std::str::from_utf8(message.payload.as_ref()).unwrap_or_default()
);
let topic = Topic::from(message.topic.as_str()); let topic = Topic::from(message.topic.as_str());
match topic { match topic {