feat: add MQTT support and configuration documentation

This commit is contained in:
2025-04-25 21:59:51 +02:00
parent 47f5507f4f
commit 25da1ac04b
3 changed files with 56 additions and 0 deletions

View File

@@ -21,4 +21,5 @@ serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
# end of web stuff
paho-mqtt = "0.13.2"
ping = "0.4.1"

View File

@@ -414,6 +414,10 @@ fn main() -> ExitCode {
if device_online == true {
// Render new image
send_package(ip.to_string(), &last_data, &straba_res);
// Publish data to MQTT
if let Some(ref client) = mqtt_client {
publish_to_mqtt(client, &last_data, &straba_res);
}
}
}
}