Distinguish data_in and data_out
This commit is contained in:
parent
1dff0cf26f
commit
f166d44a3e
10
init.lua
10
init.lua
@ -111,9 +111,9 @@ local function receive()
|
|||||||
core.log("error", "[MOD] yl_matterbridge: receive/http.fetch failed. Result (req) = " .. dump(result))
|
core.log("error", "[MOD] yl_matterbridge: receive/http.fetch failed. Result (req) = " .. dump(result))
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
local data = core.parse_json(result.data)
|
local data_out = core.parse_json(result.data)
|
||||||
if not data then
|
if not data_out then
|
||||||
if not next(data) then
|
if not next(data_out) then
|
||||||
if settings.debug then
|
if settings.debug then
|
||||||
core.log(
|
core.log(
|
||||||
"error",
|
"error",
|
||||||
@ -123,7 +123,7 @@ local function receive()
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
for _, dataset in ipairs(data) do
|
for _, dataset in ipairs(data_out) do
|
||||||
if dataset then
|
if dataset then
|
||||||
if settings.debug then
|
if settings.debug then
|
||||||
core.log("action", "[MOD] yl_matterbridge : dataset = " .. dump(dataset))
|
core.log("action", "[MOD] yl_matterbridge : dataset = " .. dump(dataset))
|
||||||
@ -133,7 +133,7 @@ local function receive()
|
|||||||
core.log(
|
core.log(
|
||||||
"error",
|
"error",
|
||||||
"[MOD] yl_matterbridge: receive/http.fetch failed. No dataset in returned data = " ..
|
"[MOD] yl_matterbridge: receive/http.fetch failed. No dataset in returned data = " ..
|
||||||
dump(data)
|
dump(data_out)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user