]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 8 Oct 2020 15:32:06 +0000 (17:32 +0200)
committerVincent <vincent@enhydra.fr>
Thu, 8 Oct 2020 15:32:06 +0000 (17:32 +0200)
.idea/workspace.xml
scripts/denon.php [new file with mode: 0644]
scripts/lib/denon.php [new file with mode: 0644]
scripts/lib/lib.php
scripts/lib/off.php
scripts/lib/squeezebox.php

index e5c85ce0c1fa22b6ad75cc9b2eaaeeb52abb4156..aabc8db6df144e78ecb5062f57c66fca69b89adc 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 afterPath="$PROJECT_DIR$/scripts/denon.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/scripts/lib/denon.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.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/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" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1599637876908" duration="1121000" />
       <workItem from="1599927557113" duration="2000" />
       <workItem from="1600851074183" duration="826000" />
-      <workItem from="1602007969304" duration="628000" />
-    </task>
-    <task id="LOCAL-00295" summary=".">
-      <created>1581445218699</created>
-      <option name="number" value="00295" />
-      <option name="presentableId" value="LOCAL-00295" />
-      <option name="project" value="LOCAL" />
-      <updated>1581445218700</updated>
+      <workItem from="1602007969304" duration="1163000" />
+      <workItem from="1602145835697" duration="1869000" />
     </task>
     <task id="LOCAL-00296" summary=".">
       <created>1581445254182</created>
       <option name="project" value="LOCAL" />
       <updated>1599462252288</updated>
     </task>
-    <option name="localTasksCounter" value="344" />
+    <task id="LOCAL-00344" summary=".">
+      <created>1602145314496</created>
+      <option name="number" value="00344" />
+      <option name="presentableId" value="LOCAL-00344" />
+      <option name="project" value="LOCAL" />
+      <updated>1602145314496</updated>
+    </task>
+    <option name="localTasksCounter" value="345" />
     <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="760" y="94" key="#Project_Structure" timestamp="1592377765650">
-      <screen x="0" y="0" width="2560" height="1040" />
-    </state>
-    <state x="760" y="94" key="#Project_Structure/0.0.2560.1040@0.0.2560.1040" timestamp="1592377765650" />
-    <state x="935" y="70" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1599462237142">
+    <state x="935" y="70" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1602145287303">
       <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="1598265694837" />
-    <state x="935" y="70" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1599462237142" />
-    <state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
-      <screen x="0" y="0" width="2560" height="1040" />
-    </state>
-    <state x="1060" y="275" key="FileChooserDialogImpl/0.0.2560.1040@0.0.2560.1040" timestamp="1590912263817" />
-    <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1595317059300">
+    <state x="935" y="70" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1602145287303" />
+    <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1602146675515">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1595317059300" />
+    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1602146675515" />
     <state x="781" y="165" key="SettingsEditor" timestamp="1596008871908">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
diff --git a/scripts/denon.php b/scripts/denon.php
new file mode 100644 (file)
index 0000000..2510f37
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+require_once "import.php";
+setState('denon', false);
\ No newline at end of file
diff --git a/scripts/lib/denon.php b/scripts/lib/denon.php
new file mode 100644 (file)
index 0000000..c48a861
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+function denon($on = false)
+{
+    $state = getState('denon');
+    if ($state === $on) {
+        return;
+    }
+    sshCommand('/usr/local/bin/denon-toogle', 'lit', true, true);
+    setState('denon', $on);
+}
\ No newline at end of file
index 87e291c29d0047318eb458d7072d9d6a5af3a88b..5cf1b111fee7c0b419084afa98ad5bc826f4d29c 100644 (file)
@@ -42,6 +42,7 @@ require_once ROOT . '/scripts/lib/cachemedia.php';
 require_once ROOT . '/scripts/lib/ifttt.php';
 require_once ROOT . '/scripts/lib/router.php';
 require_once ROOT . '/scripts/lib/flowerpower.php';
+require_once ROOT . '/scripts/lib/denon.php';
 
 
 profile('Loaded libraries', __FILE__, __LINE__);
index 77418d04932a9a090932787150d0ce966e22f800..e97c0f3715292ae23d3cc8dc678a0569b9dbfb31 100644 (file)
@@ -12,6 +12,8 @@ function off($device = null)
         offSalon();
     } else if ($device == 'sdb') {
         offSdb();
+    } else if ($device === 'chambre' || $device === 'litvincent' || $device === 'litjerome') {
+        offChambre();
     }
 }
 
@@ -39,6 +41,11 @@ function offSdb()
     offOMX('sdb');
 }
 
+function offChambre()
+{
+    denon(false);
+}
+
 function offAllOMX()
 {
     $devices = ['litvincent', 'litjerome', 'entree', 'sdb', 'bureausun'];
index bc1e36c82015d496cb6e2cf7ff0d4a740e9296ea..7f1295517c9a50e2ed29a95e99c214f961d6631f 100644 (file)
@@ -90,6 +90,9 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     if ($player == $squeezeboxPlayers['Bureau']) {
         sshCommand('/usr/local/bin/soundtojack', 'bureau', true, true);
     }
+    if ($player == $squeezeboxPlayers['Chambre']) {
+        denon(true);
+    }
     squeezeRequest('pause', $player);
     if (null !== $volume) {
         if (config('VOLUME_DEVICE') == 'SqueezeboxPlayer') {