From 0a5254fa7cae916075833b3bddb5b1da78b26fa3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 11 Jul 2023 00:24:49 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 10 ++++------ scripts/automodes.php | 4 +++- scripts/lib/automodes.php | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bc801c6..4f597da 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,11 +5,9 @@ - - - - + + diff --git a/scripts/automodes.php b/scripts/automodes.php index 1159251..3f0d5de 100644 --- a/scripts/automodes.php +++ b/scripts/automodes.php @@ -5,4 +5,6 @@ if (isset($_GET['disable'])) { } if (isset($_GET['enable'])) { enableAutoModes(); -} \ No newline at end of file +} + +echo 'automodes are ' . (isAutoModeEnabled() ? 'enabled' : 'disabled'); \ No newline at end of file diff --git a/scripts/lib/automodes.php b/scripts/lib/automodes.php index ab20b77..3813132 100644 --- a/scripts/lib/automodes.php +++ b/scripts/lib/automodes.php @@ -34,6 +34,9 @@ function autoRooms() { } function updateBureauAuto() { + if(!isAutoModeEnabled()){ + return; + } if (getState('bureauOff') == '1') { execScene('bureau/off'); return; @@ -61,6 +64,9 @@ function updateBureauAuto() { } function updateCuisine() { + if(!isAutoModeEnabled()){ + return; + } $salon = getState('salon', 'off'); if ($salon === 'day' || $salon === 'on' || $salon === 'off' || $salon === 'tamise') { execScene('cuisine/base/on'); @@ -70,6 +76,9 @@ function updateCuisine() { } function updateCourAuto() { + if(!isAutoModeEnabled()){ + return; + } $h = date('H'); if ($h >= 7) { execScene('cour/projecteurs/off'); @@ -130,6 +139,9 @@ function courAuto($on = true) { } function updateSalonAuto() { + if(!isAutoModeEnabled()){ + return; + } if (getState('salonOff') == '1') { execScene('salon/off'); return; @@ -158,6 +170,9 @@ function updateSalonAuto() { } function updateChambreAuto($transitionTime = null) { + if(!isAutoModeEnabled()){ + return; + } if (getState('chambreOff') == '1') { execScene('chambre/off'); return; -- 2.39.5