Fix command on/off bug
This commit is contained in:
parent
6d9c9bb51f
commit
354dcf2684
@ -347,10 +347,10 @@ techage.register_node({"techage:heatexchanger2"}, {
|
|||||||
elseif topic == "load" then
|
elseif topic == "load" then
|
||||||
return techage.power.percent(nvm.capa_max, nvm.capa)
|
return techage.power.percent(nvm.capa_max, nvm.capa)
|
||||||
elseif topic == "on" then
|
elseif topic == "on" then
|
||||||
start_node(pos, techage.get_nvm(pos))
|
State:start(pos, nvm)
|
||||||
return true
|
return true
|
||||||
elseif topic == "off" then
|
elseif topic == "off" then
|
||||||
stop_node(pos, techage.get_nvm(pos))
|
State:stop(pos, nvm)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return "unsupported"
|
return "unsupported"
|
||||||
@ -359,10 +359,10 @@ techage.register_node({"techage:heatexchanger2"}, {
|
|||||||
on_beduino_receive_cmnd = function(pos, src, topic, payload)
|
on_beduino_receive_cmnd = function(pos, src, topic, payload)
|
||||||
local nvm = techage.get_nvm(pos)
|
local nvm = techage.get_nvm(pos)
|
||||||
if topic == 1 and payload[1] == 1 then
|
if topic == 1 and payload[1] == 1 then
|
||||||
start_node(pos, techage.get_nvm(pos))
|
State:start(pos, nvm)
|
||||||
return 0
|
return 0
|
||||||
elseif topic == 1 and payload[1] == 0 then
|
elseif topic == 1 and payload[1] == 0 then
|
||||||
stop_node(pos, techage.get_nvm(pos))
|
State:stop(pos, nvm)
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 2, ""
|
return 2, ""
|
||||||
|
Loading…
Reference in New Issue
Block a user