Fix upstairs hallway motion lighting

This commit is contained in:
2024-02-09 12:58:00 -05:00
parent fc12a017dd
commit c1c635bdcd

View File

@ -19,7 +19,7 @@ let hallwayAction = {}
if (payload === 'on') {
if (goodnight === 'on') {
hallwayAction = 'off'
} else if (nightMode === 'on' || peopleSleeping === true) {
} else if (nightMode === 'on' || (peopleSleeping === true && earlyNightMode === 'on')) {
hallwayAction = 'on'
hallwayScene = 'Nightlight'
} else if (earlyNightMode === 'on') {
@ -46,7 +46,7 @@ if (payload === 'on') {
node.status({fill:'red',shape:'ring',text:'Too bright'})
}
} else if (payload === 'off') {
if (stairwellLights === 'on') {
if (stairwellLights === 'on' || hallwayLights === 'on') {
msg.duration = newDuration
node.status({fill:"green",shape:"dot",text:parseInt(duration) + ' minutes'})
node.send([null,msg,null,null])