From c1c635bdcde1daacbed122426b8a0f8f1fe7f806 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 9 Feb 2024 12:58:00 -0500 Subject: [PATCH] Fix upstairs hallway motion lighting --- second-floor-lighting/stairwell/on-off.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/second-floor-lighting/stairwell/on-off.js b/second-floor-lighting/stairwell/on-off.js index c3f570f..e400fe2 100644 --- a/second-floor-lighting/stairwell/on-off.js +++ b/second-floor-lighting/stairwell/on-off.js @@ -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])