I'm a moron who should not be allowed near mathematical operations
This commit is contained in:
@ -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" })
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user