From 0980c3b1eca74bb984b6590273d24669eb05dec7 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 16 May 2025 04:09:24 -0400 Subject: [PATCH] I'm a moron who should not be allowed near mathematical operations --- front-porch/check-parameters.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front-porch/check-parameters.js b/front-porch/check-parameters.js index 18ba2f8..91b35ee 100644 --- a/front-porch/check-parameters.js +++ b/front-porch/check-parameters.js @@ -1,6 +1,6 @@ const states = global.get('homeassistant.homeAssistant.states') -const outdoorLux = states['sensor.home_tempest_illuminance'].state -const threshold = states['input_number.front_porch_lux_threshold'].state +const outdoorLux = parseInt(states['sensor.home_tempest_illuminance'].state) +const threshold = parseInt(states['input_number.front_porch_lux_threshold'].state) const frontPorchToggle = states['input_boolean.front_porch_light_on'].state const holidaymode = states['input_boolean.holiday_mode'].state const currentholiday = states['input_select.holiday_animation'].state @@ -10,7 +10,7 @@ let holidayMsg = { "holiday": holiday } -if ((outdoorLux >= threshold) && frontPorchToggle === 'on') { +if ((outdoorLux <= threshold) && frontPorchToggle === 'on') { if (holidaymode === 'on') { node.status({fill:"blue",shape:"dot",text:"Holiday On"}) node.send([holidayMsg,msg]) @@ -21,7 +21,7 @@ if ((outdoorLux >= threshold) && frontPorchToggle === 'on') { } else { if (frontPorchToggle === 'off') { node.status({ fill: "red", shape: "ring", text: "Disabled" }) - } else if (outdoorLux < threshold) { + } else if (outdoorLux > threshold) { node.status({ fill: "red", shape: "ring", text: "Daytime" }) } } \ No newline at end of file