Fix findings of luacheck
This commit is contained in:
parent
a2079ec16a
commit
1dff0cf26f
10
init.lua
10
init.lua
|
@ -53,7 +53,7 @@ end
|
|||
local url_send = "http://" .. settings.address .. ":" .. settings.port .. "/api/message"
|
||||
local url_receive = "http://" .. settings.address .. ":" .. settings.port .. "/api/messages"
|
||||
|
||||
function send(user_name, message_text)
|
||||
local function send(user_name, message_text)
|
||||
if yl_matterbridge.enabled == false then return false end
|
||||
if settings.debug then
|
||||
core.log(
|
||||
|
@ -62,7 +62,7 @@ function send(user_name, message_text)
|
|||
)
|
||||
end
|
||||
local timeout = 10
|
||||
local data = {
|
||||
local data_in = {
|
||||
text = message_text,
|
||||
username = user_name,
|
||||
gateway = settings.gateway
|
||||
|
@ -73,7 +73,7 @@ function send(user_name, message_text)
|
|||
url = url_send,
|
||||
extra_headers = post_headers,
|
||||
timeout = timeout,
|
||||
post_data = core.write_json(data)
|
||||
post_data = core.write_json(data_in)
|
||||
},
|
||||
function(result)
|
||||
if not result.completed or not result.succeeded or not result.code == 200 then
|
||||
|
@ -81,10 +81,10 @@ function send(user_name, message_text)
|
|||
return false
|
||||
else
|
||||
if settings.debug then
|
||||
local data = core.parse_json(result.data)
|
||||
local data_out = core.parse_json(result.data)
|
||||
core.log(
|
||||
"action",
|
||||
"[MOD] yl_matterbridge : send result = " .. dump(result) .. ", data = " .. dump(data)
|
||||
"[MOD] yl_matterbridge : send result = " .. dump(result) .. ", data = " .. dump(data_out)
|
||||
)
|
||||
end
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue