]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sun, 22 Nov 2020 12:52:11 +0000 (13:52 +0100)
committerVincent <vincent@enhydra.fr>
Sun, 22 Nov 2020 12:52:11 +0000 (13:52 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/scenes.php

index 3d1bd80a760a2307f4aa91d761becbd80ba0c3e0..80753c52b507ed70d7e9fa51a6623a3e2a759414 100644 (file)
@@ -3,6 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1605542056704" duration="1640000" />
       <workItem from="1605597648537" duration="7658000" />
       <workItem from="1605690676577" duration="7108000" />
-      <workItem from="1605973078856" duration="2167000" />
-    </task>
-    <task id="LOCAL-00358" summary=".">
-      <created>1604224463669</created>
-      <option name="number" value="00358" />
-      <option name="presentableId" value="LOCAL-00358" />
-      <option name="project" value="LOCAL" />
-      <updated>1604224463669</updated>
+      <workItem from="1605973078856" duration="4587000" />
     </task>
     <task id="LOCAL-00359" summary=".">
       <created>1604228663244</created>
       <option name="project" value="LOCAL" />
       <updated>1605973216962</updated>
     </task>
-    <option name="localTasksCounter" value="407" />
+    <task id="LOCAL-00407" summary=".">
+      <created>1605976064822</created>
+      <option name="number" value="00407" />
+      <option name="presentableId" value="LOCAL-00407" />
+      <option name="project" value="LOCAL" />
+      <updated>1605976064822</updated>
+    </task>
+    <option name="localTasksCounter" value="408" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     </state>
     <state x="740" y="229" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.1707.920@0.0.1707.920" timestamp="1604146905948" />
     <state x="1110" y="259" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.2560.1040@0.0.2560.1040" timestamp="1605437484620" />
-    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605973204132">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1605976060711">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="132" y="0" width="737" height="502" key="CommitChangelistDialog2/0.0.1707.920@0.0.1707.920" timestamp="1605086955514" />
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1605188136787" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605973204132" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1605976060711" />
     <state x="952" y="244" key="FileChooserDialogImpl" timestamp="1605726960903">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index a4c0d6238d16ff25f9390140c80b40d5cba792ec..d05bc0ef663689c78ff76f64e6e1c047bf6f9a5b 100644 (file)
@@ -116,6 +116,7 @@ function cronRooms($cronmin)
         updateCourAuto();
     }
     checkPlanetarium();
+    checkWCVMC();
 }
 
 function cronFlowerPower($cronmin)
index ca147f3f4490177bad5e21e2bb472b53003f3ef0..598eea88b5d61be9fac6f962498478dc0175d6d5 100644 (file)
@@ -796,12 +796,17 @@ function chambreToggle()
 function wcToggle()
 {
     if (getState('wc') == 1) {
-        execScene('wc/off');
+        wcOff();
     } else {
         wcOn();
     }
 }
 
+function wcOff()
+{
+    execScene('wc/off');
+}
+
 function sdbToggle()
 {
     if (getState('sdb') == 1) {
@@ -1039,29 +1044,26 @@ function updateCourAuto()
 
 function wcVMCOn()
 {
-    // This cancel a previous call to vmc off
-    $rand = rand(100000, 1000000);
-    setState('wcTimeout', $rand);
     // Start VMC
     insteonCommand('0?1134=I=0=0');
 }
 
 function wcVMCOff($timeout = 600)
 {
-    if ($timeout > 0) {
-        runAtEnd('_wcVMCOff(' . $timeout . ');');
-    } else {
-        _wcVMCOff(0);
+    setState('wcVMCOff', max(getState('wcVMCOff', -1), time() + $timeout));
+    if ($timeout === 0) {
+        execScene('wc/vmc/off');
     }
 }
 
-function _wcVMCOff($timeout)
+function checkWCVMC()
 {
-    if ($timeout === 0) {
-        execScene('wc/vmc/off');
+    $offtime = getState('wcVMCOff', -1);
+    $time = time();
+    if ($offtime == -1 || $offtime > $time) {
         return;
     }
-    delayHttpCall(WEB_ROOT . 'script/vmcoff.php?delay=' . $timeout, $timeout + 30);
+    execScene('wc/vmc/off');
 }
 
 function delayHttpCall($url, $delay)