]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sun, 25 Aug 2019 12:50:17 +0000 (14:50 +0200)
committerVincent <vincent@enhydra.fr>
Sun, 25 Aug 2019 12:50:17 +0000 (14:50 +0200)
.idea/workspace.xml
config/global.php
scripts/lib/lib.php
scripts/lib/mediarasp.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php
scripts/raspberrycast.php

index 806509244f09e66b30f8a2525d9b76c2d1edde22..7a049f9dab2f171b4910d9ce97950a6fa47fa24b 100644 (file)
@@ -3,9 +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$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.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/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.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/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" />
+      <change beforePath="$PROJECT_DIR$/scripts/raspberrycast.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/raspberrycast.php" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
       <list>
-        <option value="Python Script" />
         <option value="Less File" />
-        <option value="JavaScript File" />
         <option value="Setup Script" />
         <option value="HTML File" />
+        <option value="JavaScript File" />
+        <option value="Python Script" />
       </list>
     </option>
   </component>
       <workItem from="1566402117063" duration="1534000" />
       <workItem from="1566458804773" duration="6134000" />
       <workItem from="1566546848697" duration="3695000" />
-      <workItem from="1566602835458" duration="736000" />
-    </task>
-    <task id="LOCAL-00164" summary=".">
-      <created>1551125943544</created>
-      <option name="number" value="00164" />
-      <option name="presentableId" value="LOCAL-00164" />
-      <option name="project" value="LOCAL" />
-      <updated>1551125943544</updated>
+      <workItem from="1566602835458" duration="785000" />
+      <workItem from="1566643527124" duration="3756000" />
+      <workItem from="1566649679962" duration="18000" />
+      <workItem from="1566649714025" duration="6753000" />
     </task>
     <task id="LOCAL-00165" summary=".">
       <created>1551166201535</created>
       <option name="project" value="LOCAL" />
       <updated>1566551436129</updated>
     </task>
-    <option name="localTasksCounter" value="213" />
+    <task id="LOCAL-00213" summary=".">
+      <created>1566603610179</created>
+      <option name="number" value="00213" />
+      <option name="presentableId" value="LOCAL-00213" />
+      <option name="project" value="LOCAL" />
+      <updated>1566603610179</updated>
+    </task>
+    <option name="localTasksCounter" value="214" />
     <servers />
   </component>
   <component name="TodoView">
index a287c7383bb962449377d74859bc7f9ef4e8cca1..df158815d55431a3cb724b764bf09cdef5efa2f4 100644 (file)
@@ -28,18 +28,19 @@ $phones = array('vincent' => array(
 );
 
 $devices = [
-    'cerveau' => ['host' => '192.168.13.60', 'user' => 'pi', 'password' => 'atacama'],
-    'litvincent' => ['host' => '192.168.13.61', 'user' => 'pi', 'password' => 'atacama'],
-    'litjerome' => ['host' => '192.168.13.62', 'user' => 'pi', 'password' => 'atacama'],
-    'sdb' => ['host' => '192.168.13.63', 'user' => 'pi', 'password' => 'atacama'],
-    'entree' => ['host' => '192.168.13.64', 'user' => 'pi', 'password' => 'atacama'],
-    'jarvis' => ['host' => '192.168.13.60', 'user' => 'jarvis', 'password' => 'atacama'],
-    'minitel1' => ['host' => '192.168.13.65', 'user' => 'pi', 'password' => 'atacama'],
-    'salon' => ['host' => '192.168.13.66', 'user' => 'pi', 'password' => 'atacama'],
-    'bureau' => ['host' => '192.168.13.67', 'user' => 'pi', 'password' => 'atacama'],
-    'cuisine' => ['host' => '192.168.13.68', 'user' => 'pi', 'password' => 'atacama'],
-    'bureausun' => ['host' => '192.168.13.70', 'user' => 'pi', 'password' => 'atacama'],
-    'avion' => ['host' => '192.168.13.5', 'user' => 'Tortuga', 'password' => 's77vpo*wu', 'mac' => 'E0:D5:5E:68:67:B9'],
+    'cerveau' => ['id'=>'cerveau','host' => '192.168.13.60', 'user' => 'pi', 'password' => 'atacama'],
+    'litvincent' => ['id'=>'litvincent','host' => '192.168.13.61', 'user' => 'pi', 'password' => 'atacama'],
+    'litjerome' => ['id'=>'litjerome','host' => '192.168.13.62', 'user' => 'pi', 'password' => 'atacama'],
+    'sdb' => ['id'=>'sdb','host' => '192.168.13.63', 'user' => 'pi', 'password' => 'atacama'],
+    'entree' => ['id'=>'entree','host' => '192.168.13.64', 'user' => 'pi', 'password' => 'atacama'],
+    'jarvis' => ['id'=>'jarvis','host' => '192.168.13.60', 'user' => 'jarvis', 'password' => 'atacama'],
+    'minitel1' => ['id'=>'minitel1','host' => '192.168.13.65', 'user' => 'pi', 'password' => 'atacama'],
+    'salon' => ['id'=>'salon','host' => '192.168.13.66', 'user' => 'pi', 'password' => 'atacama'],
+    'bureau' => ['id'=>'bureau','host' => '192.168.13.67', 'user' => 'pi', 'password' => 'atacama'],
+    'cuisine' => ['id'=>'cuisine','host' => '192.168.13.68', 'user' => 'pi', 'password' => 'atacama'],
+    'bureausun' => ['id'=>'bureausun','host' => '192.168.13.70', 'user' => 'pi', 'password' => 'atacama'],
+    'lit' => ['id'=>'lit','host' => '192.168.13.71', 'user' => 'pi', 'password' => 'atacama'],
+    'avion' => ['id'=>'avion','host' => '192.168.13.5', 'user' => 'Tortuga', 'password' => 's77vpo*wu', 'mac' => 'E0:D5:5E:68:67:B9'],
 ];
 
 // Browse media files on NAS
index c43a57f6a5ba70fd10848a4a6ddff40b4eaa4401..2b7c8716855131f0a230995af3de4702f51456fd 100644 (file)
@@ -412,7 +412,7 @@ function volume($volume, $increase = '')
         } elseif ($p == 'raspberrycast') {
             $d = 'RaspberryCast';
         } elseif ($p == 'mediarasp') {
-            $d = 'OMX';
+            $d = 'VLC';
         }
     }
 
@@ -434,7 +434,7 @@ function volume($volume, $increase = '')
         case 'RaspberryCast':
             return raspberryCast('sound?vol=' . ($increase == '-' ? 'less' : 'more'));
         case 'OMX':
-            return OMXCmd(['action' => 'shortcut', 'shortcut' => $increase], $device);
+            return VLCCmd(['action' => 'shortcut', 'shortcut' => $increase], $device);
     }
 }
 
index 48f95de6f820a5b51dd593fb7840c8cc11c483ea..faf933cabb0fe14a14241e807f7ef852ab4936ac 100644 (file)
@@ -318,6 +318,7 @@ function mediaRaspCommons($device)
     } else if ($device == 'bureau') {
         execScene('bureau/media/play');
         stopSqueezebox($squeezeboxPlayers['Bureau']);
+        sshCommand('/usr/local/bin/soundtohdmi', $device);
     } else if ($device == 'sdb') {
         execScene('sdb/ampli/on');
     }
@@ -477,7 +478,6 @@ function VLCCmd($params, $device = null, $timeout = 5)
         $query = 'requests/status.xml';
     }
     $url = 'http://' . $d['host'] . ':8754/' . $query;
-    // echo $url.': '.print_r($params,true);
     $client = getMediaRaspClient();
     try {
         $response = $client->get($url, ['query' => $params, 'timeout' => $timeout, 'auth' => ['', 'atacama']]);
@@ -486,7 +486,6 @@ function VLCCmd($params, $device = null, $timeout = 5)
         echo $d['host'] . print_r($params) . ':' . $e->getMessage();
         return false;
     }
-
 }
 
 function VLCPlay($fileorstream, $device = null, $timeout = 5)
@@ -499,7 +498,6 @@ function VLCPlay($fileorstream, $device = null, $timeout = 5)
     return VLCCmd(['command' => 'in_play', 'input' => $fileorstream], $device, $timeout);
 }
 
-
 function OMXCmd($params, $device = null, $timeout = 5)
 {
     global $devices;
index 070c1f960f20803ead46b3db1c4eacfddd655545..fdf7f6fddd5979db1ab762d6ac0816fefa60d27a 100644 (file)
@@ -735,7 +735,7 @@ function cheminee($lightId, $room = 'salon', $program = 'fire', $brightness = 1)
 function killCheminee($room)
 {
     // Kill current animation
-    $kill = "/bin/kill $(ps aux | grep '[c]heminee_running/" . $room . "' | awk '{print $2}')";
+    $kill = 'id -u -n;/bin/kill $(ps aux | grep \'[c]heminee_running/' . $room . '\' | awk \'{print $2}\') 2>&1';
     $res = `$kill`;
     echo 'Kill cheminĂ©e ' . $room . ' :: ' . $res;
     return $res;
index 83273dce59758cea279af6eebb66a192fa1e2fb9..1547a05a8735a49c7ccfc68b5647471cf7d72109 100644 (file)
@@ -87,6 +87,7 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     if ($player == $squeezeboxPlayers['Salle de bains']) {
         execScene('sdb/ampli/on');
     }
+
     squeezeRequest('pause', $player);
     if (null !== $volume) {
         if (config('VOLUME_DEVICE') == 'SqueezeboxPlayer') {
@@ -102,6 +103,9 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
         echo $player . ':' . $command . '<br />';
         squeezeRequest($command, $player);
     }
+    if ($player == $squeezeboxPlayers['Bureau']) {
+        sshCommand('/usr/local/bin/soundtojack', 'bureau');
+    }
 }
 
 function _player($player = null)
index f4754569672c2e87ca0c3a1cc3d0688ad23c58d0..47072c882f478661dd12066095974538bc7f9d47 100644 (file)
@@ -4,6 +4,6 @@ require_once "import.php";
 if ($_GET['action'] == 'init') {
        setPlaying('raspberrycast:' . $_GET['url'], $_GET['device']);
        execScene($_GET['device'] . '/media/play');
-       VLCCmd([ 'command' => 'pl_stop'], $_GET['device']);
+       VLCCmd(['command' => 'pl_stop'], $_GET['device']);
        stopSqueezebox($_GET['device']);
 }
\ No newline at end of file