Distinguish data_in and data_out

This commit is contained in:
AliasAlreadyTaken 2023-05-08 09:41:10 +02:00
parent 1dff0cf26f
commit f166d44a3e
1 changed files with 5 additions and 5 deletions

View File

@ -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