]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Tue, 13 Apr 2021 19:17:36 +0000 (21:17 +0200)
committerVincent <vincent@enhydra.fr>
Tue, 13 Apr 2021 19:17:36 +0000 (21:17 +0200)
.idea/workspace.xml
scripts/lib/denon.php

index df3c981ce24f71e06cd5ca42ca23bac1c88a8e8e..864182e23b8e5cb79ff81c14a7ef7f313470c30b 100644 (file)
@@ -3,15 +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$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/kodi.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/kodi.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.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/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/logcat.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcat.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1617794856868" duration="1126000" />
       <workItem from="1617801536336" duration="4107000" />
       <workItem from="1618050897134" duration="4462000" />
-      <workItem from="1618158049208" duration="17694000" />
-    </task>
-    <task id="LOCAL-00416" summary=".">
-      <created>1606938157166</created>
-      <option name="number" value="00416" />
-      <option name="presentableId" value="LOCAL-00416" />
-      <option name="project" value="LOCAL" />
-      <updated>1606938157166</updated>
+      <workItem from="1618158049208" duration="18005000" />
     </task>
     <task id="LOCAL-00417" summary=".">
       <created>1607282050429</created>
       <option name="project" value="LOCAL" />
       <updated>1618321419071</updated>
     </task>
-    <option name="localTasksCounter" value="465" />
+    <task id="LOCAL-00465" summary=".">
+      <created>1618341048382</created>
+      <option name="number" value="00465" />
+      <option name="presentableId" value="LOCAL-00465" />
+      <option name="project" value="LOCAL" />
+      <updated>1618341048382</updated>
+    </task>
+    <option name="localTasksCounter" value="466" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 1a0125562a0cf127489795f5ea84ae64db5ec48e..fb5dc24458c598c77817bd7e3d690750caff0bfe 100644 (file)
@@ -30,13 +30,14 @@ function denonAVRVolume($volume, $increase = '')
 
 function denonAVROn($input = 'Media Player', $force = false)
 {
+    $setvolume = !denonAVRGetPowerState();
     if ($force || !denonAVRGetPowerState()) {
         _denonTelnet('ZMON');
     }
-    denonAVRInput($input);
+    denonAVRInput($input, $setvolume);
 }
 
-function denonAVRInput($input)
+function denonAVRInput($input, $setvolume = false)
 {
     $map = ['Media Player' => 'MPLAY', 'CBL/SAT' => 'SAT/CBL', 'Blu-Ray' => 'BD', 'AUX' => 'AUX1', 'HEOS Music' => 'NET', 'TV Audio' => 'TV'];
     if (isset($map[$input])) {
@@ -45,13 +46,18 @@ function denonAVRInput($input)
         $cmd = $input;
     }
     $cmd = 'SI' . strtoupper($cmd);
+    $changedInput = false;
     if (denonAVRGetInput() !== $cmd) {
+        $changedInput = true;
         _denonTelnet($cmd);
         sleep(1);
+    }
+
+    if ($changedInput || $setvolume) {
         $volumes = ['Media Player' => 60, 'HEOS Music' => 50, 'CD' => 30, 'AUX' => 26];
         if (isset($volumes[$input])) {
             denonAVRVolume($volumes[$input], '');
-            usleep(1000000 * 1);
+            sleep(1);
         }
     }