]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 10 Jul 2023 22:24:49 +0000 (00:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 10 Jul 2023 22:24:49 +0000 (00:24 +0200)
.idea/workspace.xml
scripts/automodes.php
scripts/lib/automodes.php

index bc801c6b14ea54ed52c75c8f6d8720791d21e992..4f597da5129e886956a0597d46faf6ec181e0674 100644 (file)
@@ -5,11 +5,9 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change afterPath="$PROJECT_DIR$/scripts/automodes.php" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/scripts/lib/automodes.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/automodes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/automodes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/automodes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/automodes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1688849303515" duration="1558000" />
       <workItem from="1688897001591" duration="22890000" />
       <workItem from="1689010387612" duration="1878000" />
-      <workItem from="1689026578748" duration="401000" />
+      <workItem from="1689026578748" duration="609000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="570" />
+    <option name="localTasksCounter" value="571" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 11592513b870f32b063bfb47ecd914d455f6e512..3f0d5de100ad61746069030e069edbc2d33d79c3 100644 (file)
@@ -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
index ab20b773a2a3e88bb2c06b400aea1cfe018d18ea..381313270070cec6653534a117fc4bd243aadefe 100644 (file)
@@ -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;