]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Wed, 21 Oct 2020 10:27:06 +0000 (12:27 +0200)
committerVincent <vincent@enhydra.fr>
Wed, 21 Oct 2020 10:27:06 +0000 (12:27 +0200)
.idea/workspace.xml
config/global.php
config/rooms.php
scripts/domoticz_device_event.php
scripts/lib/off.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php

index 9d8c73b074fed7ff60b2c396e3663eb637080fe5..623af14185c76158daee42f69bf53842a7d7231e 100644 (file)
@@ -3,7 +3,12 @@
   <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$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.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" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1602501229079" duration="559000" />
       <workItem from="1602581583330" duration="1284000" />
       <workItem from="1602862886793" duration="1014000" />
-      <workItem from="1603095373591" duration="50000" />
-    </task>
-    <task id="LOCAL-00299" summary=".">
-      <created>1581934414894</created>
-      <option name="number" value="00299" />
-      <option name="presentableId" value="LOCAL-00299" />
-      <option name="project" value="LOCAL" />
-      <updated>1581934414894</updated>
+      <workItem from="1603095373591" duration="1368000" />
+      <workItem from="1603270756890" duration="2727000" />
     </task>
     <task id="LOCAL-00300" summary=".">
       <created>1581951532460</created>
       <option name="project" value="LOCAL" />
       <updated>1602863336459</updated>
     </task>
-    <option name="localTasksCounter" value="348" />
+    <task id="LOCAL-00348" summary=".">
+      <created>1603131455368</created>
+      <option name="number" value="00348" />
+      <option name="presentableId" value="LOCAL-00348" />
+      <option name="project" value="LOCAL" />
+      <updated>1603131455369</updated>
+    </task>
+    <option name="localTasksCounter" value="349" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="872" y="161" key="#Plugins/0.0.2560.1040@0.0.2560.1040" timestamp="1596008801840" />
-    <state x="935" y="70" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1602863330816">
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603131428714">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
-    <state x="935" y="70" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1602863330816" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603131428714" />
     <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1602146675515">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
     <state x="655" y="270" width="816" height="530" key="Vcs.Push.Dialog.v2/0.0.1920.1160@0.0.1920.1160" timestamp="1595521362224" />
+    <state x="295" y="0" width="1290" height="907" key="dock-window-1" timestamp="1603274697406">
+      <screen x="0" y="0" width="2560" height="1040" />
+    </state>
+    <state x="295" y="0" width="1290" height="907" key="dock-window-1/0.0.2560.1040@0.0.2560.1040" timestamp="1603274697406" />
     <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1598297024487">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index 5c7ec3898310569dc243f83a03cd0f20db930e4f..7a6b7eebfb6dbe2b43323917b65d5c8605d718ce 100644 (file)
@@ -30,6 +30,16 @@ $phones = array('vincent' => array(
     'password' => '4pyA?Rnyeyc1$44M')
 );
 
+$squeezeboxPlayersByRoom = [
+    'bureau' => ['Bureau'],
+    'bureausun' => ['Bureau'],
+    'chambre' => ['Lit Vincent', 'Lit Jérôme', 'Chambre'],
+    'salon' => ['Salon'],
+    'cuisine' => ['Cuisine'],
+    'sdb' => ['Salle de bains'],
+    'wc' => ['WC'],
+];
+
 $devices = [
     'cerveau' => ['id' => 'cerveau', 'host' => '192.168.13.60', 'user' => 'pi', 'password' => 'atacama'],
     'litvincent' => ['id' => 'litvincent', 'host' => '192.168.13.61', 'user' => 'pi', 'password' => 'atacama'],
@@ -54,7 +64,7 @@ $directories = array('Séries TV' => array('dir' => 'Series', 'context' => 'tvsh
     'X' => array('dir' => 'Z/X', 'context' => 'movie', 'id' => 'x')
 );
 
-$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg','divx'];
+$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg', 'divx'];
 
 profile('Set globals', __FILE__, __LINE__);
 
index 4889999fb7d52591d32a7a3312ca42a3f1219147..979a359bf3f5f8b0f450e5d26831125816185ff5 100644 (file)
@@ -60,6 +60,7 @@ function salon()
         ['type' => 'light', 'scene' => 'salon/on', 'label' => 'Allumer'],
         ['type' => 'light', 'scene' => 'salon/off', 'label' => 'éteindre'],
         ['type' => 'light', 'scene' => 'salon/cinema', 'label' => 'cinéma'],
+        ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'],
         ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'],
         ['type' => 'light', 'scene' => 'salon/lecturenocture', 'label' => 'Lecture nocturne'],
         ['type' => 'light', 'scene' => 'salon/cheminee', 'label' => 'Cheminée'],
index 22149f366c34c15d6ea1034ead9031dba7d42086..8e9c0836b60d7f3cfb6b8510c21dd26fedaa0acb 100644 (file)
@@ -9,12 +9,15 @@ if ($_GET['device'] == 1033 || $_GET['device'] == 1476 || $_GET['device'] == 147
 if ($_GET['device'] == 1695) {
     $forceConfig = 'wc';
 }
+if ($_GET['device'] == 1478) {
+    $forceConfig = 'bureau';
+}
 
 require_once "import.php";
 
 if ($_GET['device'] == 480) {
     chambreToggle();
-} else if ($_GET['device'] == 1033 || $_GET['device'] == 1476 || $_GET['device'] == 1478) {
+} else if ($_GET['device'] == 1033 || $_GET['device'] == 1476) {
     // Cube
     switch ($_GET['state']) {
         case 'Shake':
@@ -59,7 +62,7 @@ if ($_GET['device'] == 480) {
 } else if ($_GET['device'] == 1451) {
     domoticzSwitch(1450);
 } else if ($_GET['device'] == 1695) {
-    $forceConfig = 'salon';
+    $forceConfig = 'wc';
     switch ($_GET['state']) {
         case 'Double_Click':
             execScene('wc/spa');
@@ -73,5 +76,37 @@ if ($_GET['device'] == 480) {
             wcToggle();
             break;
     }
+} else if ($_GET['device'] == 1478) {
+    // Cube
+    switch ($_GET['state']) {
+        case 'Shake':
+            execScene('home/alert');
+            break;
+        case 'Flip_90':
+            execScene('bureau/rideaux/toggle');
+            break;
+        case 'Flip_180':
+            execScene('bureau/auto');
+            break;
+        case 'Free_Fall':
+            execScene('bureau/off');
+            off('bureau');
+            break;
+        case 'Move':
+            off('bureau');
+            break;
+        case 'Clock_Wise':
+            volume(5, '+');
+            break;
+        case 'Anti_Clock_Wise':
+            volume(5, '-');
+            break;
+        case 'Tap':
+            squeezePlayByName('Samba', $squeezeboxPlayers['Bureau']);
+            break;
+        case 'Alert':
+        default:
+            break;
+    }
 }
 echo '1';
\ No newline at end of file
index e97c0f3715292ae23d3cc8dc678a0569b9dbfb31..2e9f26800f97f3c2ad40c38130ff4507b50952bd 100644 (file)
@@ -20,7 +20,7 @@ function off($device = null)
 function commonOff($device)
 {
     remoteCmdMedia('stop', $device);
-    squeezeRequest('stop');
+    stopPlayersIn($device);
 }
 
 function offSalon()
index 0c09abeac9db189b3c61dca63e975889574d27ae..1e4c8c22efb5a86277d38017727f4354d6223368 100644 (file)
@@ -323,11 +323,19 @@ $scenes = [
         ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
         ['type' => 'scene', 'scene' => 'salon/fan/off'],
     ],
-    'salon/cinema' => [
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+    'salon/cinemabase' => [
         ['type' => 'scene', 'scene' => 'cuisine/tamise'],
         ['type' => 'ecomode', 'mode' => '0'],
         ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
+    ],
+    'salon/cineclub' => [
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
+        ['type' => 'scene', 'scene' => 'salon/cinemabase'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
+    ],
+    'salon/cinema' => [
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+        ['type' => 'scene', 'scene' => 'salon/cinemabase'],
         ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
     ],
     'salon/tamise' => [
@@ -375,7 +383,6 @@ $scenes = [
         ['type' => 'ecomode', 'mode' => '0'],
         ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
     ],
-
     'bureau/l61/on' => [
         ['type' => 'domoticz', 'device' => '2074', 'command' => true],
     ],
@@ -504,6 +511,9 @@ $scenes = [
     'bureau/rideaux/open' => [
         ['type' => 'domoticz', 'device' => '391', 'command' => true, 'priority' => true],
     ],
+    'bureau/rideaux/toggle' => [
+        ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
+    ],
     'insteon/off' => [
         ['type' => 'insteon', 'command' => '0?135=I=0=0'],
     ],
index 7f1295517c9a50e2ed29a95e99c214f961d6631f..81a65616779cd7627f86f95ce8a2051e71abdcb0 100644 (file)
@@ -29,6 +29,16 @@ function stopSqueezebox($player)
     }
 }
 
+function stopPlayersIn($room)
+{
+    global $squeezeboxPlayers, $squeezeboxPlayersByRoom;
+    if (isset($squeezeboxPlayersByRoom[$room])) {
+        foreach ($squeezeboxPlayersByRoom[$room] as $player) {
+            stopSqueezebox($player);
+        }
+    }
+}
+
 function squeezeRequest($params, $player = '')
 {
     $redis = connectRedis();