add data topic

This commit is contained in:
Laila van Reenen 2025-04-15 11:30:58 +02:00
parent f29ced6b61
commit 6780c41582
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D

View File

@ -41,6 +41,12 @@ impl PulseTx {
retain: false,
qos: mqtt_client::QoS::AtMostOnce,
}});
self.tx({ mqtt_client::MqttMessage {
topic: String::from("/kees/energy/metalbox/data"),
payload: format!("{\"pulses\":{pulses},\"watt\":{}", pulses * 60),
retain: false,
qos: mqtt_client::QoS::AtMostOnce,
}});
}
}