From 8f96484822dcaf4044157462c2c8586a403f67e3 Mon Sep 17 00:00:00 2001 From: h2zero Date: Fri, 26 Aug 2022 08:25:28 -0600 Subject: [PATCH] Fix crash when rest response state or code is invalid. --- src/lfs/rest_endpoint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lfs/rest_endpoint.lua b/src/lfs/rest_endpoint.lua index 65ae955..cb5b346 100644 --- a/src/lfs/rest_endpoint.lua +++ b/src/lfs/rest_endpoint.lua @@ -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