Skip to content

Commit

Permalink
Fix crash when rest response state or code is invalid.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Aug 26, 2022
1 parent d0344d0 commit 8f96484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lfs/rest_endpoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ local function startLoop(settings)
end

gpio.mode(pin, gpio.OUTPUT)
if pin == tonumber(actuator.pin) or zone == actuator.zone and code >= 200 and code < 300 and state then
if (pin == tonumber(actuator.pin) or zone == actuator.zone) and code >= 200 and code < 300 and state then
gpio.write(pin, state)
else
state = actuator.trigger == gpio.LOW and gpio.HIGH or gpio.LOW
Expand Down

0 comments on commit 8f96484

Please sign in to comment.