add data topic
This commit is contained in:
parent
f29ced6b61
commit
6780c41582
@ -41,6 +41,12 @@ impl PulseTx {
|
|||||||
retain: false,
|
retain: false,
|
||||||
qos: mqtt_client::QoS::AtMostOnce,
|
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,
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user