Skip to content

Commit

Permalink
Merge pull request #173 from konnected-io/invalid-rest-resp-fix
Browse files Browse the repository at this point in the history
Fix crash when rest response state or code is invalid.
  • Loading branch information
heythisisnate authored Aug 26, 2022
2 parents d0344d0 + 8f96484 commit d51955c
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 d51955c

Please sign in to comment.