From f166d44a3ec11cff8216d27111c0b08204e56ebf Mon Sep 17 00:00:00 2001 From: AliasAlreadyTaken Date: Mon, 8 May 2023 09:41:10 +0200 Subject: [PATCH] Distinguish data_in and data_out --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 38da945..c8b371b 100644 --- a/init.lua +++ b/init.lua @@ -111,9 +111,9 @@ local function receive() core.log("error", "[MOD] yl_matterbridge: receive/http.fetch failed. Result (req) = " .. dump(result)) return false else - local data = core.parse_json(result.data) - if not data then - if not next(data) then + local data_out = core.parse_json(result.data) + if not data_out then + if not next(data_out) then if settings.debug then core.log( "error", @@ -123,7 +123,7 @@ local function receive() end return false end - for _, dataset in ipairs(data) do + for _, dataset in ipairs(data_out) do if dataset then if settings.debug then core.log("action", "[MOD] yl_matterbridge : dataset = " .. dump(dataset)) @@ -133,7 +133,7 @@ local function receive() core.log( "error", "[MOD] yl_matterbridge: receive/http.fetch failed. No dataset in returned data = " .. - dump(data) + dump(data_out) ) end end