Fix winkekatze-sub.lua example module

This commit is contained in:
kpcyrd
2022-11-12 21:47:15 +01:00
parent dc26c14da4
commit 56f7b1c646

View File

@@ -10,8 +10,13 @@ function run()
mqtt_subscribe(sock, '#', 0)
while true do
local pkt = mqtt_recv_text(sock)
local pkt = mqtt_recv(sock)
if last_err() then return end
info(pkt)
local log = {pkt=pkt}
if pkt then
log['text'] = utf8_decode(pkt['body'])
if last_err() then clear_err() end
end
info(log)
end
end