]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 17 Dec 2020 09:11:30 +0000 (10:11 +0100)
committerVincent <vincent@enhydra.fr>
Thu, 17 Dec 2020 09:11:30 +0000 (10:11 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/shield.php
scripts/lib/squeezebox.php
scripts/remoteinfos.php
scripts/squeeze.php

index 00a1b33c44a909b964f9d87c638bf843ee0aa7e0..e1288fa32ac8ddf835efeec522b42c83f2fab06f 100644 (file)
@@ -3,12 +3,11 @@
   <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/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.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/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/logcat.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcat.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/remoteinfos.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.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="1607439614302" duration="1182000" />
       <workItem from="1607546452054" duration="634000" />
       <workItem from="1607872973632" duration="1438000" />
-      <workItem from="1607932840253" duration="4147000" />
-    </task>
-    <task id="LOCAL-00373" summary=".">
-      <created>1604522275963</created>
-      <option name="number" value="00373" />
-      <option name="presentableId" value="LOCAL-00373" />
-      <option name="project" value="LOCAL" />
-      <updated>1604522275963</updated>
+      <workItem from="1607932840253" duration="5614000" />
+      <workItem from="1607945700829" duration="1423000" />
     </task>
     <task id="LOCAL-00374" summary=".">
       <created>1604568864147</created>
       <option name="project" value="LOCAL" />
       <updated>1607933724636</updated>
     </task>
-    <option name="localTasksCounter" value="422" />
+    <task id="LOCAL-00422" summary=".">
+      <created>1607938357925</created>
+      <option name="number" value="00422" />
+      <option name="presentableId" value="LOCAL-00422" />
+      <option name="project" value="LOCAL" />
+      <updated>1607938357925</updated>
+    </task>
+    <option name="localTasksCounter" value="423" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index b5b96ce830e951a835428ab23f48f7f6b0805915..0776f5664c90ec035f959c657cebad572b4b5423 100644 (file)
@@ -198,8 +198,10 @@ function cronSqueezeCheckPlayers($cronmin)
     $players = ['Salon' => 'salon', 'Bureau' => 'bureau'];
     foreach ($players as $player => $device) {
         if (getSqueezePlayerStatus($player) === -1) {
-            shieldRunAppAndBackHome('sbplayer', $device, 1, true);
-            sleep(5);
+            if(!shieldPlayingVideo($device)) {
+                shieldRunAppAndBackHome('sbplayer', $device, 1, true);
+                sleep(5);
+            }
         }
     }
 }
index 60751fd76696bcfecd3523388d29cdc3caf7bc27..3e026e1de31d92198276af1e9c5907e9cca2fb00 100644 (file)
@@ -36,10 +36,20 @@ function shieldWakeup($device = null)
 function shieldRunActivity($device = null)
 {
     $device = getDevice($device);
+    $onlySound = in_array(shieldGetCurrentApp($device), ['spotify']);
+
     if ($device['id'] === 'salon') {
-        harmonyActivity('tv');
+        if ($onlySound) {
+            harmonyActivity('musique');
+        } else {
+            harmonyActivity('tv');
+        }
     } else if ($device['id'] === 'bureau' || $device['id'] === 'bureausun') {
-        execScene('bureau/media/play');
+        if ($onlySound) {
+            execScene('bureau/sound/on');
+        } else {
+            execScene('bureau/media/play');
+        }
     }
 }
 
@@ -147,7 +157,7 @@ function shieldFranceTv($device = null)
     shieldLaunchApp('fr.francetv.pluzz/fr.francetv.androidtv.main.MainActivity', $device);
 }
 
-function shieldLaunchApp($activity, $device=null)
+function shieldLaunchApp($activity, $device = null)
 {
     shieldHome($device);
 
@@ -157,7 +167,7 @@ function shieldLaunchApp($activity, $device=null)
         if (strpos($activity, '.') === false) {
             $activity = shieldGetAppId($activity);
         }
-        shieldCommand('shell monkey', '-p ' . $activity.' 1', $device);
+        shieldCommand('shell monkey', '-p ' . $activity . ' 1', $device);
     } else {
         shieldCommand('shell am start', '-n ' . $activity, $device);
     }
@@ -256,6 +266,12 @@ function shieldGetApps()
     ];
 }
 
+function shieldPlayingVideo($device = null)
+{
+    $videoApps = ['kodi', 'vlc', 'mycanal', 'netflix', 'arte', 'francetv', 'gamecast', 'twitch', 'youtube', 'dailymotion', 'vimeo', 'steamlink'];
+    return in_array(shieldGetCurrentApp($device), $videoApps);
+}
+
 function shieldRunAppAndBackHome($app, $device = null, $waitBeforeBack = 1, $backToSleep = true)
 {
 
@@ -267,10 +283,10 @@ function shieldRunAppAndBackHome($app, $device = null, $waitBeforeBack = 1, $bac
         $s = 'maskShield' . ucfirst($d['id']) . 'Wakeup';
         setState($s, '1');
     }
-    echo 'shieldLaunchApp :: '.$app."\n";
+    echo 'shieldLaunchApp :: ' . $app . "\n";
     shieldLaunchApp($app, $device);
     sleep($waitBeforeBack);
-     echo 'shieldHome'."\n";
+    echo 'shieldHome' . "\n";
     shieldHome($device);
     if ($backToSleep) {
         shieldSleep($device);
@@ -334,7 +350,6 @@ function shieldGetCurrentApp($device = null)
 }
 
 
-
 function _adb($command, $params = '', $device = null)
 {
     $c = _adbcmd($command, $params, $device);
index 47378cdc80ff0bcff0f1625c86f6a05ce47e449b..4fbdcdee67fd78876b3086db6c0bda81309da964 100644 (file)
@@ -110,7 +110,7 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     } else if ($player == $squeezeboxPlayers['Salle de bains']) {
         execScene('sdb/ampli/on');
     } else if ($player == $squeezeboxPlayers['Bureau']) {
-        exec('bureau/sound/on');
+        execScene('bureau/sound/on');
         setState('maskShieldBureauWakeup', '1');
     } else if ($player == $squeezeboxPlayers['Chambre']) {
         denon(true);
index cd22a3ab0f0656d4f4d754f0a9a6cc1794ea4a48..b40ddff456b00b05766bcee41da1884d76888b4b 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 require_once "import.php";
+
 header('Content-Type: application/json');
-echo remoteInfos();
-exit;
\ No newline at end of file
+$res = remoteInfos();
+ob_end_clean();
+die($res);
\ No newline at end of file
index dac3001f3aafb01f9dfc2683548986f82e3ea1be..a1f2ac5345095d9c23c5a04d32b951d7ed48a488 100644 (file)
@@ -13,6 +13,7 @@ if (!in_array('stop', $requests) || isset($_GET['name'])) {
     } elseif ($_GET['player'] == 'Salle de bains') {
         execScene('sdb/ampli/on');
     } else if ($_GET['player'] === 'Bureau') {
+        execScene('bureau/sound/on');
         setState('maskShieldBureauWakeup', '1');
     }
     setPlaying('squeezebox');