]> _ Git - tortuga-home.git/commitdiff
.
authorvincent <vincent@enhydra.fr>
Sat, 22 Jan 2022 18:44:01 +0000 (19:44 +0100)
committervincent <vincent@enhydra.fr>
Sat, 22 Jan 2022 18:44:01 +0000 (19:44 +0100)
.idea/workspace.xml
config/global.php
scripts/lib/off.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php
scripts/lib/switchbot.php

index c9df4bb9e1ee848627e3068dc18b9ad9dd1acb67..2920586e76780824c66ec0fe6aeb733e50b97e4e 100644 (file)
@@ -2,8 +2,12 @@
 <project version="4">
   <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$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/off.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/off.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/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" 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="1642240002240" duration="1108000" />
       <workItem from="1642761590471" duration="1992000" />
       <workItem from="1642848701157" duration="3435000" />
-      <workItem from="1642856038290" duration="5973000" />
-    </task>
-    <task id="LOCAL-00461" summary=".">
-      <created>1617266964333</created>
-      <option name="number" value="00461" />
-      <option name="presentableId" value="LOCAL-00461" />
-      <option name="project" value="LOCAL" />
-      <updated>1617266964333</updated>
+      <workItem from="1642856038290" duration="8758000" />
     </task>
     <task id="LOCAL-00462" summary=".">
       <created>1617871680635</created>
       <option name="project" value="LOCAL" />
       <updated>1642864397546</updated>
     </task>
-    <option name="localTasksCounter" value="510" />
+    <task id="LOCAL-00510" summary=".">
+      <created>1642864772532</created>
+      <option name="number" value="00510" />
+      <option name="presentableId" value="LOCAL-00510" />
+      <option name="project" value="LOCAL" />
+      <updated>1642864772532</updated>
+    </task>
+    <option name="localTasksCounter" value="511" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index fa7de0da8f9250c0488ba20df27f938a9a65d5cc..0d52246e91ff02aa619eddf5b44f1fa3d2e79956 100644 (file)
@@ -92,7 +92,7 @@ $devices = [
     'cuisine' => ['id' => 'cuisine', 'host' => '192.168.13.68', 'shield' => '192.168.13.31', 'user' => 'pi', 'password' => 'atacama'],
     'bureausun' => ['id' => 'bureausun', 'host' => '192.168.13.70', 'shield' => '192.168.13.41', 'user' => 'pi', 'password' => 'atacama'],
     'lit' => ['id' => 'lit', 'host' => '192.168.13.69', 'user' => 'pi', 'password' => 'atacama'],
-    'sdb' => ['id' => 'sdb', 'shield' => '192.168.13.32'],
+    'sdb' => ['id' => 'sdb', 'shield' => '192.168.13.32', 'host' => '192.168.13.63', 'user' => 'pi', 'password' => 'atacama'],
     'avion' => ['id' => 'avion', 'host' => '192.168.13.5', 'user' => 'Tortuga', 'password' => '8nc4PuwzCScw&^Vi$Fh#&n', 'mac' => 'E0:D5:5E:68:67:B9'],
 ];
 
index 6a446153f93b669263c94ae35172f2b1d4d4b7f0..4d0bd26224f003f79ac7b92208e8a1e9c126d089 100644 (file)
@@ -49,6 +49,7 @@ function offSdb()
 {
     execScene('sdb/ampli/off');
     offOMX('sdb');
+    hotwaterAutoMode('1');
 }
 
 function offChambre()
index a22f7881b08ddb48554aced4fc27b70ea991bdd6..ad8439c2c71ed33b36ac9392491888be9e118242 100644 (file)
@@ -746,7 +746,6 @@ $scenes = [
         ['type' => 'state', 'key' => 'sdb', 'value' => 0],
         ['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true],
         ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['Salle de bains'], false]],
-        ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['1']],
     ],
     'sdb/on' => [
         ['type' => 'state', 'key' => 'sdb', 'value' => 1],
index 252cbaf4bcf7af5be711a90adccf8593c2880ba3..39ac73d6a5567c290a0b5baadddf191592dd2382 100644 (file)
@@ -141,6 +141,10 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
         echo $player . ':' . $command . '<br />';
         squeezeRequest($command, $player);
     }
+
+    if ($player === 'Salle de bains') {
+        hotwaterCheckMode();
+    }
 }
 
 function squeezePlayerOn($player)
index 61ee59b44c78d027580743324578ec0a0d318fe7..dfe0001d1c5e2b39aff8567e9657e1f65bc6b22e 100644 (file)
@@ -1,8 +1,8 @@
 <?php
-function switchbot($device, $command = 'press')
+function switchbot($device, $command = 'press', $rpi = 'bureausun')
 {
     for ($i = 0; $i <= 2; $i++) {
-        $res = sshCommand('/usr/bin/python3 /usr/local/python-host/switchbot_py3.py -d ' . $device . ' -c ' . $command, 'bureausun', true, true);
+        $res = sshCommand('/usr/bin/python3 /usr/local/python-host/switchbot_py3.py -d ' . $device . ' -c ' . $command, $rpi, true, true);
         if (stristr($res['output'], 'Command execution successful')) {
             break;
         }
@@ -66,7 +66,7 @@ function hotwater($newState)
     $res = '';
     for ($i = 0; $i < $clicks; $i++) {
         $res .= ' one click - ';
-        $res .= print_r(switchbot($device));
+        $res .= print_r(switchbot($device, 'press', 'sdb'));
         if ($i < $clicks - 1) {
             sleep(2);
         }