From 79d70e1b830306a04aa1ca3e7666f7783ddae0b7 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 4 Apr 2024 12:07:20 -0400 Subject: [PATCH] Don't run motion lighting in living room or dining room in guest mode --- first-floor-lighting/dining-room/processing.js | 3 ++- first-floor-lighting/living-room/processing.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/first-floor-lighting/dining-room/processing.js b/first-floor-lighting/dining-room/processing.js index be87dfd..ef49ed9 100644 --- a/first-floor-lighting/dining-room/processing.js +++ b/first-floor-lighting/dining-room/processing.js @@ -5,13 +5,14 @@ const nightMode = states['input_boolean.night_mode'].state const kallenSleeping = states['input_boolean.kallen_sleeping'].state const kallenOvernight = states['input_boolean.kallen_overnight'].state const duration = states['input_number.dining_room_lights_off_delay'].state +const guestMode = states['input_boolean.guest_mode'].state const newDuration = duration * 60 const topic = msg.topic const payload = msg.payload let block = {} -if ((peoplePresent === 'on' && vacationMode === 'off' && nightMode === 'on') && (kallenSleeping === 'on' || kallenOvernight === 'on')) { +if ((peoplePresent === 'on' && vacationMode === 'off' && nightMode === 'on' && guestMode === 'off') && (kallenSleeping === 'on' || kallenOvernight === 'on')) { block = false } else { block = true diff --git a/first-floor-lighting/living-room/processing.js b/first-floor-lighting/living-room/processing.js index 972c78e..6666d7a 100644 --- a/first-floor-lighting/living-room/processing.js +++ b/first-floor-lighting/living-room/processing.js @@ -5,13 +5,14 @@ const nightMode = states['input_boolean.night_mode'].state const kallenSleeping = states['input_boolean.kallen_sleeping'].state const kallenOvernight = states['input_boolean.kallen_overnight'].state const duration = states['input_number.living_room_lights_off_delay'].state +const guestMode = states['input_boolean.guest_mode'].state const newDuration = duration * 60 const topic = msg.topic const payload = msg.payload let block = {} -if ((peoplePresent === 'on' && vacationMode === 'off' && nightMode === 'on') && (kallenSleeping === 'on' || kallenOvernight === 'on')) { +if ((peoplePresent === 'on' && vacationMode === 'off' && nightMode === 'on' && guestMode === 'off') && (kallenSleeping === 'on' || kallenOvernight === 'on')) { block = false } else { block = true