From dcc660d8d65cf98b4fa64789c3143190a42ca189 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 14 Mar 2021 13:44:54 +0100 Subject: [PATCH] Set connection status, if MQTT get disconnected --- mqtt.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mqtt.lua b/mqtt.lua index d71de9b..987cdff 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -117,7 +117,11 @@ function registerMqtt() end end end) - + m:on("offline", function(client) + print("MQTT Disconnected") + mqttConnected = false + end + ) m:connect(mqttServer, 1883, false, function(client) print("MQTT is connected") mqttConnected = true