From 2645da910ee51a75e428bc7f142356e4c2c6c49a Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 13 Apr 2022 21:29:03 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 48 +++++++++++++++++++----------------------- scripts/lib/scenes.php | 35 +++++++++++++++++++----------- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dae97d8..8f8e392 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,12 +2,7 @@ - - - - - - { + "keyToString": { + "WebServerToolWindowFactoryState": "true", + "WebServerToolWindowPanel.toolwindow.highlight.mappings": "true", + "WebServerToolWindowPanel.toolwindow.highlight.symlinks": "true", + "WebServerToolWindowPanel.toolwindow.show.date": "false", + "WebServerToolWindowPanel.toolwindow.show.permissions": "false", + "WebServerToolWindowPanel.toolwindow.show.size": "false", + "nodejs_package_manager_path": "npm", + "ruby.rails.projectView.checked": "true", + "vue.rearranger.settings.migration": "true" } -}]]> +} @@ -1066,14 +1061,8 @@ - - - - 1619248801662 - 1619348281960 @@ -1411,7 +1400,14 @@ - diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index d749602..1559974 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -910,15 +910,8 @@ function execScene($name, $fromUserAction = false, $transitionTime = null) $e = explode('/', $name); if ($fromUserAction && $e[1] !== 'auto' && count($e) == 2) { - if ($e[0] == 'chambre') { - chambreAuto(false); - } else if ($e[0] == 'bureau') { - bureauAuto(false); - } else if ($e[0] == 'cour') { - courAuto(false); - } else if ($e[0] == 'salon') { - salonAuto(false); - } + call_user_func($e[0] . 'Auto', false); + setState($e[0] . 'Off', $e[1] === 'off' ? '1' : '0'); } $killurl = WEB_ROOT . 'scripts/light.php?[r]=2'; @@ -945,9 +938,7 @@ function execScene($name, $fromUserAction = false, $transitionTime = null) if ($action['type'] == 'hue') { hueCommand($action, $transitionTime); - } else if ($action['type'] == 'insteon') { - insteonCommand($action['command']); - } else if ($action['type'] == 'delay' || $action['type'] == 'scene') { + } else if ($action['type'] == 'delay' || $action['type'] == 'scene') { if (!isset($action['delay'])) { $action['delay'] = 0; } @@ -1175,6 +1166,10 @@ function salonAuto($on = true) function chambreAuto($on = true, $transitionTime = null) { + if (getState('chambreOff') == '1') { + execScene('chambre/off'); + return; + } if ($on) { ecoMode(0); setState('chambreAutoMode', '1'); @@ -1206,6 +1201,10 @@ function courAuto($on = true) function updateSalonAuto() { + if (getState('salonOff') == '1') { + execScene('salon/off'); + return; + } $hours = intval(date('H')); if ($hours <= 9) { $scene = 'tamise'; @@ -1219,6 +1218,10 @@ function updateSalonAuto() function updateChambreAuto($transitionTime = null) { + if (getState('chambreOff') == '1') { + execScene('chambre/off'); + return; + } $hours = intval(date('H')); if ($hours <= 4) { $scene = 'party'; @@ -1240,6 +1243,10 @@ function updateChambreAuto($transitionTime = null) function updateBureauAuto() { + if (getState('bureauOff') == '1') { + execScene('bureau/off'); + return; + } $hours = intval(date('H')); if ($hours <= 4) { $scene = 'outrun'; @@ -1271,6 +1278,10 @@ function updateCuisine() function updateCourAuto() { + if (getState('courOff') == '1') { + execScene('cour/off'); + return; + } if (isDay()) { $scene = 'daylight'; } else { -- 2.39.5