]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sun, 16 Oct 2022 20:50:04 +0000 (22:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sun, 16 Oct 2022 20:50:04 +0000 (22:50 +0200)
.idea/workspace.xml
scripts/lib/switchbot.php

index f696974f38c3c3a1faf7ef2f4f67361537441dd7..45fbe6e7e9eb1b0b13f5f2ddd5691ff934c402f8 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/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1665644017956" duration="240000" />
       <workItem from="1665644787744" duration="12000" />
       <workItem from="1665644816191" duration="1000" />
-    </task>
-    <task id="LOCAL-00483" summary=".">
-      <created>1621060853769</created>
-      <option name="number" value="00483" />
-      <option name="presentableId" value="LOCAL-00483" />
-      <option name="project" value="LOCAL" />
-      <updated>1621060853769</updated>
+      <workItem from="1665644884295" duration="20000" />
+      <workItem from="1665655356996" duration="39000" />
+      <workItem from="1665922708761" duration="713000" />
     </task>
     <task id="LOCAL-00484" summary=".">
       <created>1621061259708</created>
       <option name="project" value="LOCAL" />
       <updated>1665641053090</updated>
     </task>
-    <option name="localTasksCounter" value="532" />
+    <task id="LOCAL-00532" summary=".">
+      <created>1665644900754</created>
+      <option name="number" value="00532" />
+      <option name="presentableId" value="LOCAL-00532" />
+      <option name="project" value="LOCAL" />
+      <updated>1665644900754</updated>
+    </task>
+    <option name="localTasksCounter" value="533" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index b00a6b4d91aee5b1240baddf8f66659a482e60aa..dd688d863244da4d32d6260232149e9cf0365ea1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 function switchbot($device, $command = 'press', $rpi = 'sdb')
 {
-    for ($i = 0; $i <= 5; $i++) {
+    for ($i = 0; $i <= 60; $i++) {
         $res = sshCommand('/docker/switchbot/run ' . $device . ' ' . $command, $rpi, true, true);
         if (stristr($res['output'], 'Command execution successful')) {
             break;
@@ -29,14 +29,16 @@ function hotwaterCheckMode()
     $h = date('G');
     $d = date('N');
     $isWeek = $d < 6;
+    $maxLevel = isJerome() ? "2" : '1';
+
 
     $ecomode = (int)getState('ecomode', '0');
 
     if (!isVincent()) {
-        $hot = 1;
+        $hot = '1';
     } else {
         if (getSqueezePlayerStatus('Salle de bains')) {
-            $hot = '2';
+            $hot = $maxLevel;
         } else {
             if (isJerome()) {
                 $weekColdHours = [0, 1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23];
@@ -63,6 +65,7 @@ function hotwater($newState)
     // 1 : ECO
     // 2 : MAX
 
+
     echo getState('hotwater_auto_mode', '1') . '::' . getState('hotwater_change', '0') . '::' . getState('hotwater', '1');
     $changing = getState('hotwater_change', '0');
     $limit = time() - 300;