From 0bc446fc2af363f67e34ac2371824492c2f550fd Mon Sep 17 00:00:00 2001 From: Ollo Date: Mon, 1 Nov 2021 19:49:56 +0100 Subject: [PATCH] More debug messages when receiving a temperature --- mqtt.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mqtt.lua b/mqtt.lua index 665c579..d86dc79 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -117,10 +117,11 @@ function registerMqtt() print(data) if (topic == (mqttPrefix .. "/cmd/single")) then handleSingleCommand(client, topic, data) - elseif (topic == (mqttPrefix .. "/cmd/temp")) then - if ( data == "" ) then - tw=nil - tcol=nil + elseif (topic == (mqttPrefix .. "/cmd/temp")) then + if (( data == "" ) or (data == nil)) then + tw=nil + tcol=nil + print("MQTT | wordclock failed") else -- generate the temperatur to display, once as it will not change local dispTemp = tonumber(data) @@ -129,10 +130,10 @@ function registerMqtt() if (wc ~= nil) then tw, tcol = wc.temp(dw, rgbBuffer, invertRows) wc = nil + print("MQTT | generated words for: " + tostring(dispTemp)) else print("MQTT | wordclock failed") end - end else -- Handle here the /cmd/# sublevel