]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Wed, 13 Jan 2021 09:07:13 +0000 (10:07 +0100)
committerVincent <vincent@enhydra.fr>
Wed, 13 Jan 2021 09:07:13 +0000 (10:07 +0100)
.idea/workspace.xml
config/chambre.php
config/global.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php

index 60f6c5ac3d4686152ef6f4864113d233c36d80b3..b8c33b8613c1b8f51c2ef4baef36440eccf8ac6d 100644 (file)
@@ -3,7 +3,10 @@
   <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/chambre.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/chambre.php" 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/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" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1610050680817" duration="1480000" />
       <workItem from="1610202160108" duration="2175000" />
       <workItem from="1610280280433" duration="7383000" />
-      <workItem from="1610462926782" duration="995000" />
-    </task>
-    <task id="LOCAL-00383" summary=".">
-      <created>1605111184884</created>
-      <option name="number" value="00383" />
-      <option name="presentableId" value="LOCAL-00383" />
-      <option name="project" value="LOCAL" />
-      <updated>1605111184884</updated>
+      <workItem from="1610462926782" duration="1001000" />
+      <workItem from="1610483375018" duration="2127000" />
     </task>
     <task id="LOCAL-00384" summary=".">
       <created>1605121533132</created>
       <option name="project" value="LOCAL" />
       <updated>1610463457269</updated>
     </task>
-    <option name="localTasksCounter" value="432" />
+    <task id="LOCAL-00432" summary=".">
+      <created>1610463936245</created>
+      <option name="number" value="00432" />
+      <option name="presentableId" value="LOCAL-00432" />
+      <option name="project" value="LOCAL" />
+      <updated>1610463936245</updated>
+    </task>
+    <option name="localTasksCounter" value="433" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 6efb0e0a16bc1d177f94c95d6fc20b9b7a42ad86..5204e6e14c6b8381f88be0f0d41faf20fd8728cc 100644 (file)
@@ -17,7 +17,7 @@ if (DISPLAYINTERFACE) {
 
     $c = chambre();
     $shortcuts['lights'] = $c['all'];
-    $favoriteslights = $c['favorites'];
+    $favoriteslights = array_merge([['type' => 'light', 'scene' => 'chambre/reading/fireplace', 'label' => 'Au coin du feu'],], $c['favorites']);
 
     include "default.php";
     $nav = ['home', 'lights', 'music', 'remote', 'coffee', 'switch', 'settings', 'alert', 'off'];
index 2bc3162a0d54a4f4699c60c92fdedb8348d7cebc..2944470323a050cd4020c09222bf9ca1a536a93c 100644 (file)
@@ -28,6 +28,7 @@ $squeezeboxPlayers = array(
     'Bureau' => '7e:23:f6:33:1d:3b',
 );
 
+
 $phones = array('vincent' => array(
     'ip' => '192.168.13.31',
     'key' => 'APA91bHeWfPc86eVpVzYDfQHdolELsdHdlNou2a2YoMWhBuAG9odAlfZLBjve9zDBq4U04e_zd2tA864El8Z2NfUh7XJktOHbU4F1mdmAVczklg5ZFRClvhX4f8fqfZ9YLG94NdBQbGn',
index a30a2b0ef5a522c1c19e1c5af2b8027596d9a311..492b53c541f2fd701503049a85c313d966abfe6e 100644 (file)
@@ -143,6 +143,10 @@ $scenes = [
         ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
         ['type' => 'scene', 'scene' => 'chambre/cheminee'],
     ],
+    'chambre/reading/fireplace' => [
+        ['type' => 'scene', 'scene' => 'chambre/chillout'],
+        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['CheminĂ©e', $squeezeboxPlayers['Chambre']]],
+    ],
     'chambre/reading' => [
         ['type' => 'nightmode', 'mode' => '0'],
         ['type' => 'state', 'key' => 'chambre', 'value' => 1],
@@ -1077,7 +1081,7 @@ function wcVMCOn()
 {
     setState('lastVMCOn', time());
     // Start VMC
-    domoticzSwitch(2205,true,'light', true);
+    domoticzSwitch(2205, true, 'light', true);
 }
 
 function wcVMCOff($timeout = 'auto')
index fb7b1f673f9f42756b273d17aafa0579abb8d9db..cb332731a1dd80c742ebee7280bd9ad335f53576 100644 (file)
@@ -7,9 +7,34 @@ function stopSqueezeboxPlayer($player, $stopIfSync = true)
     if (!$stopIfSync && getState('syncsoiree') == '1') {
         return;
     }
+
     squeezeRequest('sync -', $player);
     squeezeRequest('stop', $player);
     squeezeRequest('power 0', $player);
+
+    $room = getRoomBySqueezeboxPlayer($player);
+    if ($room == 'salon') {
+
+    } else if ($room === 'sdb') {
+        execScene('sdb/ampli/off');
+    } else if ($room === 'bureau') {
+        execScene('bureau/sound/off');
+    } else if ($room === 'chambre') {
+        denon(false);
+    }
+}
+
+function getRoomBySqueezeboxPlayer($player)
+{
+    global $squeezeboxPlayers, $squeezeboxPlayersByRoom;
+    $player = _player($player);
+    $p = array_search($player, $squeezeboxPlayers);
+    foreach ($squeezeboxPlayersByRoom as $room => $players) {
+        if (in_array($p, $players)) {
+            return $room;
+        }
+    }
+    return null;
 }
 
 function stopAllSqueezebox()
@@ -34,12 +59,9 @@ function getSqueezePlayerStatus($player = '')
     return $res['result']['_mode'] == 'play' ? 1 : 0;
 }
 
-function stopSqueezebox($player)
+function stopSqueezebox($player, $stopIfSync = true)
 {
-    $commandes = ['stop', 'power 0', 'sync -'];
-    foreach ($commandes as $commande) {
-        squeezeRequest($commande, $player);
-    }
+    stopSqueezeboxPlayer($player, $stopIfSync);
 }
 
 function stopPlayersIn($room)