]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Mon, 25 Jan 2021 14:45:02 +0000 (15:45 +0100)
committerVincent <vincent@enhydra.fr>
Mon, 25 Jan 2021 14:45:02 +0000 (15:45 +0100)
16 files changed:
.idea/workspace.xml
config/bureau.php
scripts/cron/cron.php
scripts/domoticz_device_event.php
scripts/lib/freebox.php
scripts/lib/harmony.php
scripts/lib/hue.php
scripts/lib/mediarasp.php
scripts/lib/off.php
scripts/lib/scenes.php
scripts/lib/shield.php
scripts/lib/squeezebox.php
scripts/pcgames.php
scripts/share.php
scripts/squeeze.php
servers/logcat.php

index d9a84aaffc8e595b63fb5d0850e687b6df9c5eb8..2ffe36dee4e29c970667b634991b687d76c101fb 100644 (file)
@@ -3,10 +3,21 @@
   <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/bureau.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/bureau.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/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/freebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/freebox.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/harmony.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/harmony.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/hue.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/medialibrary.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/medialibrary.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/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/hue.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/pcgames.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/pcgames.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/share.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/share.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.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="1610959093755" duration="202000" />
       <workItem from="1611259485798" duration="169000" />
       <workItem from="1611260007715" duration="594000" />
-      <workItem from="1611336541554" duration="1183000" />
-    </task>
-    <task id="LOCAL-00387" summary=".">
-      <created>1605188063167</created>
-      <option name="number" value="00387" />
-      <option name="presentableId" value="LOCAL-00387" />
-      <option name="project" value="LOCAL" />
-      <updated>1605188063167</updated>
+      <workItem from="1611336541554" duration="1485000" />
+      <workItem from="1611428507149" duration="1044000" />
+      <workItem from="1611582691581" duration="2261000" />
+      <workItem from="1611585304162" duration="581000" />
     </task>
     <task id="LOCAL-00388" summary=".">
       <created>1605188139134</created>
       <option name="project" value="LOCAL" />
       <updated>1610959164385</updated>
     </task>
-    <option name="localTasksCounter" value="436" />
+    <task id="LOCAL-00436" summary=".">
+      <created>1611337927836</created>
+      <option name="number" value="00436" />
+      <option name="presentableId" value="LOCAL-00436" />
+      <option name="project" value="LOCAL" />
+      <updated>1611337927836</updated>
+    </task>
+    <option name="localTasksCounter" value="437" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index f4171cb2d23a7e48cd106c0e82514f4e78687425..b8b4dafd12dcfebead7d96003e7a9b35a570b6a0 100644 (file)
@@ -3,8 +3,7 @@ config('ROOM_NAME', 'Bureau');
 config('ROOM', 'bureau');
 config('SQUEEZEBOX_PLAYER', 'Bureau');
 config('VIDEOPLAYER', 'mediarasp');
-config('VOLUME', 85);
-config('VOLUME_DEVICE', 'shield');
+config('VOLUME_DEVICE', 'harmony');
 config('SLEEPTYPE', 'screensaver');
 config('SCREENSAVER', 'suncurve');
 config('SLEEPSCREEN', 15);
index 5493cd1acad7fda4bf50c863cffc728857c4e291..b4f8ee19c0181dbf4ed5c4fccd73fe8b721faa51 100644 (file)
@@ -381,16 +381,16 @@ function cronHarmony($cronmin)
         return;
     }
     if ($currentActivity == 'musique') {
-        setPlaying('squeezebox', 'salon');
+        setPlaying('squeezebox', 'bureau');
     } else if ($currentActivity == 'poweroff' || $currentActivity == 'off') {
-        setPlaying('mycanal', 'salon');
-        harmonyDeviceCommand('videoprojecteur-epson', 'power-off');
+        setPlaying('mycanal', 'bureau');
+        harmonyDeviceCommand('sony-projecteur', 'power-off');
     }
 
     if ($currentActivity === 'poweroff' || $currentActivity === 'off' || $currentActivity === 'musique') {
-        harmonyDeviceCommand('videoprojecteur-epson', 'power-off');
+        harmonyDeviceCommand('sony-projecteur', 'power-off');
     } else {
-        harmonyDeviceCommand('videoprojecteur-epson', 'power-on');
+        harmonyDeviceCommand('sony-projecteur', 'power-on');
     }
 }
 
index 2e214d6dbcc5c7973734c611c0bd12df2ca3dae5..21cc7deba1c943cb9a0255f5bf2fca16656f721d 100644 (file)
@@ -33,22 +33,16 @@ if ($_GET['device'] == 480) {
             off('salon');
             break;
         case 'Move':
-            if (getCurrentHarmonyActivity() != 'musique') {
-                _remoteCmd('pause', 'salon');
-            }
+            _remoteCmd('pause', 'salon');
             break;
         case 'Clock_Wise':
-            volume(3,'+');
+            volume(3, '+');
             break;
         case 'Anti_Clock_Wise':
-            volume(3,'-');
+            volume(3, '-');
             break;
         case 'Tap':
-            if (getCurrentHarmonyActivity() == 'poweroff') {
-                squeezePlayByName('FIP', $squeezeboxPlayers['Salon']);
-            } else if (getCurrentHarmonyActivity() == 'musique') {
-                stopHarmony();
-            }
+            squeezePlayByName('FIP', $squeezeboxPlayers['Salon']);
             break;
         case 'Alert':
         default:
@@ -91,13 +85,17 @@ if ($_GET['device'] == 480) {
             off('bureau');
             break;
         case 'Clock_Wise':
-            volume(5, '+');
+            volume(3, '+');
             break;
         case 'Anti_Clock_Wise':
-            volume(5, '-');
+            volume(3, '-');
             break;
         case 'Tap':
-            squeezePlayByName('Samba', $squeezeboxPlayers['Bureau']);
+            if (getCurrentHarmonyActivity() == 'poweroff') {
+                squeezePlayByName('Samba', $squeezeboxPlayers['Bureau']);
+            } else if (getCurrentHarmonyActivity() == 'musique') {
+                stopHarmony();
+            }
             break;
         case 'Alert':
         default:
index d56dbc418713a1a4f7c1e796fc4759dac9aacec9..e99a28de430f1867cabe9aca27acd5165c7a5dd6 100644 (file)
@@ -2,7 +2,7 @@
 
 function freeboxChannel($channel)
 {
-    if (config('DEVICE') === 'salon') {
+    if (config('DEVICE') === 'bureau') {
         $currentActivity = getCurrentHarmonyActivity();
         harmonyActivity('tv');
     }
@@ -15,7 +15,7 @@ function freeboxChannel($channel)
     }
     $keys = array_merge(array('home', 'pause=2', 'home', 'pause=1', 'home', 'left', 'right', 'home'), $commands);
 
-    if (config('DEVICE') === 'salon') {
+    if (config('DEVICE') === 'bureau') {
         if ($currentActivity != 'tv') {
             sleep(50);
         }
index 90f3d8f9af0cd94b86c53f5efd1b0643633ba75f..fc9ff9b5ad49abcd9a60a5b032ccd35c7b1bf1dd 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 
-function harmonyRequest($uri, $method = 'GET', $hub = 'salon')
+function harmonyRequest($uri, $method = 'GET', $hub = 'bureau')
 {
     global $harmonyClient;
 
@@ -31,7 +31,7 @@ function harmonyRequest($uri, $method = 'GET', $hub = 'salon')
 function harmonyActivity($activity)
 {
     if ($activity == 'poweroff' || $activity == 'off') {
-        setPlaying('mycanal', 'salon');
+        setPlaying('mycanal', 'bureau');
     }
     $wait = 0;
     $current = getCurrentHarmonyActivity();
@@ -44,15 +44,14 @@ function harmonyActivity($activity)
         ecoMode('0');
     }
     if ($activity === 'musique' || $activity === 'tv') {
-        shieldWakeup('salon');
+        shieldWakeup('bureau');
     }
     $res = harmonyRequest('activities/' . $activity, 'POST');
     if ($wait > 0) {
         sleep($wait);
     }
     if ($activity == 'tv') {
-        execScene('salon/cinema');
-        runAtEnd('sleep(15);harmonyDeviceCommand(\'videoprojecteur-epson\', \'power-on\');');
+        runAtEnd('sleep(15);harmonyDeviceCommand(\'sony-projecteur\', \'power-on\');');
     }
     return $res;
 }
index 1d12463a1e89bedca3b975c212d4601079132dba..5d005834c34cc691d3746365733c47c4be680e35 100644 (file)
@@ -17,7 +17,7 @@ function getHueState()
     return array('groups' => $hue->getGroups(), 'scenes' => $hue->getScenes(), 'lights' => $hue->getLights());
 }
 
-function hueCommand($action, $transitionTime, $repeat = 2)
+function hueCommand($action, $transitionTime)
 {
     $redis = connectRedis();
     $queue = $redis->igbget('hue_queue');
@@ -26,7 +26,6 @@ function hueCommand($action, $transitionTime, $repeat = 2)
     }
     $command = $action;
     $command['transitionTime'] = $transitionTime;
-    $command['repeat'] = $repeat;
     $queue[] = $command;
     $redis->igbset('hue_queue', $queue);
     $redis->publish('hue_event', 'handle_queue');
index 531f69cd113037239e3437b7cfe4e927b003e6fe..426d10236f04beb6f77fd039902fb6e190f91592 100644 (file)
@@ -58,11 +58,9 @@ function remoteCmd($cmd, $device)
 
     if ((($p === 'netflix' || $p === 'tv') && config('TVPLAYER') === 'shield') || config('VIDEOPLAYER') === 'shield') {
         return shieldRemoteCommand($cmd, $device);
-    } else if ($device == 'salon') {
+    } else if ($device == 'bureau') {
         switch (getCurrentHarmonyActivity()) {
-            case 'media':
-                return remoteCmdMedia($cmd, $device);
-            case 'musique-radio':
+            case 'musique':
                 return remoteCmdSalonMusique($cmd);
             case 'tv':
                 return remoteCmdSalonTV($cmd);
@@ -319,15 +317,13 @@ function mediaRaspCommons($device)
     global $squeezeboxPlayers;
     if ($device == 'salon') {
         stopSqueezebox('Salon');
-        harmonyActivity('tv');
     } else if ($device == 'bureau') {
         execScene('bureau/media/play');
+        harmonyActivity('tv');
         stopSqueezebox($squeezeboxPlayers['Bureau']);
         if (!isAlive('bureau')) {
             sleep(60);
         }
-        irsend('bureau', 'Projector', 'PowerOn');
-        sshRunCommand('/usr/local/bin/soundtohdmi', 'bureau', true, true);
     } else if ($device == 'sdb') {
         execScene('sdb/ampli/on');
     }
index 75168a812d5dbf482ca67299b4df31bfead81e92..dcc59564ebe717ad4ca5688f00a9787130bb1d1a 100644 (file)
@@ -25,14 +25,15 @@ function commonOff($device)
 
 function offSalon()
 {
-    stopHarmony();
     shieldKillAll('salon');
     shieldSleep('salon');
 }
 
 function offBureau()
 {
-    execScene('bureau/media/stop');
+    stopHarmony();
+    shieldKillAll('bureau');
+    shieldSleep('bureau');
 }
 
 function offSdb()
index 3f127409e7240e1b5bc888ce7d42c51f1720cc95..73a87fa6e2160ab107eb2aad39b135b5cd079920 100644 (file)
@@ -335,7 +335,7 @@ $scenes = [
         ['type' => 'function', 'function' => 'synchroSoiree'],
     ],
     'salon/on' => [
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO','repeat'=>2],
         //['type' => 'insteon', 'command' => '0?113=I=0=0'],
         ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
     ],
@@ -352,16 +352,16 @@ $scenes = [
         // ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
     ],
     'salon/cineclub' => [
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu','repeat'=>2],
         ['type' => 'scene', 'scene' => 'salon/cinemabase'],
     ],
     'salon/cinema' => [
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35','repeat'=>2],
         ['type' => 'scene', 'scene' => 'salon/cinemabase'],
     ],
     'salon/tamise' => [
         ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU','repeat'=>2],
         // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
     ],
@@ -377,7 +377,7 @@ $scenes = [
         ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
     ],
     'salon/media/play' => [
-        ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ['tv']],
+
     ],
     'salon/fan/on' => [
         ['type' => 'domoticz', 'device' => '478', 'command' => true],
@@ -526,7 +526,8 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'bureau/rideaux/close'],
         ['type' => 'scene', 'scene' => 'bureau/off'],
         ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]],
-        ['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOn'],
+        //['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOn'],
+        ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ['tv']],
         ['type' => 'scene', 'scene' => 'bureau/sound/on'],
     ],
     'bureau/media/stop' => [
@@ -590,7 +591,7 @@ $scenes = [
         ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'brightness' => 0, 'effect' => 'none']],
     ],
     'sdb/radio/sync/salon' => [
-        ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ["musique"]],
+        //['type' => 'function', 'function' => 'harmonyActivity', 'args' => ["musique"]],
         ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['sync ' . $squeezeboxPlayers['Salon'], $squeezeboxPlayers['Salle de bains']], 'wait' => 1],
         ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['power 1', $squeezeboxPlayers['Salon']]],
         ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['play', $squeezeboxPlayers['Salon']]]
index 828a5e47b4639d76325b4dfd8a0e2ed2856af8da..0587cd8a3e098926ba498731a6204353ed878a9a 100644 (file)
@@ -40,16 +40,13 @@ function shieldRunActivity($device = null)
 
     if ($device['id'] === 'salon') {
         stopPlayersIn('salon', true, false);
-        if ($onlySound) {
-            harmonyActivity('musique');
-        } else {
-            harmonyActivity('tv');
-        }
+
     } else if ($device['id'] === 'bureau' || $device['id'] === 'bureausun') {
         stopPlayersIn('bureau', true, false);
         if ($onlySound) {
-            execScene('bureau/sound/on');
+            harmonyActivity('musique');
         } else {
+            harmonyActivity('tv');
             execScene('bureau/media/play');
         }
     }
index 79b080ffc2e03eff9bdab6103274cb3e4dccbb60..84aa867247d952d95993f31dfe49f94853e2c5fd 100644 (file)
@@ -15,11 +15,13 @@ function stopSqueezeboxPlayer($player, $stopIfSync = true, $devices = true)
     if ($devices) {
         $room = getRoomBySqueezeboxPlayer($player);
         if ($room == 'salon') {
-            harmonyActivity('off');
+
         } else if ($room === 'sdb') {
             execScene('sdb/ampli/off');
         } else if ($room === 'bureau') {
-            execScene('bureau/sound/off');
+            if (getCurrentHarmonyActivity() === 'musique') {
+                harmonyActivity('off');
+            }
         } else if ($room === 'chambre') {
             denon(false);
         }
@@ -130,11 +132,11 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
 
     if ($player == $squeezeboxPlayers['Salon']) {
         setState('maskShieldSalonWakeup', '1');
-        harmonyActivity('musique');
+
     } else if ($player == $squeezeboxPlayers['Salle de bains']) {
         execScene('sdb/ampli/on');
     } else if ($player == $squeezeboxPlayers['Bureau']) {
-        execScene('bureau/sound/on');
+        harmonyActivity('musique');
         setState('maskShieldBureauWakeup', '1');
     } else if ($player == $squeezeboxPlayers['Chambre']) {
         denon(true);
@@ -189,7 +191,6 @@ function isMacAddress($mac)
 function synchroSoiree()
 {
     harmonyActivity('musique');
-    exec('bureau/sound/on');
 
     $devices = ['WC', 'Chambre', 'Bureau', 'Cuisine'];
     $salon = _player('Salon');
index bc2418eecb2ef5e8c7f721b5510d55856cee3b02..60673f9312c8cd65c590fbccf1af859c65730680 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 require_once "import.php";
 
-if (config('DEVICE') == 'salon') {
+if (config('DEVICE') == 'bureau') {
     harmonyActivity('tv');
 }
 
index 3832edcc7ba1638ac90c76724f27d7605104cc15..0b2f3b23d1fe5e3ee3b7db09c37d2f43bd9e5e7c 100644 (file)
@@ -13,7 +13,7 @@ function shareIntent($content, $device = null)
     if (strpos($content, 'http') === 0) {
         $u = parse_url($content);
         if ($u['host'] == 'open.spotify.com') {
-            if ($device == 'salon') {
+            if ($device == 'bureau') {
                 harmonyActivity('musique');
             }
             $p = explode('/', trim($u['path'], '/'));
index a1f2ac5345095d9c23c5a04d32b951d7ed48a488..10e64d0ec35b27fca4966db1f9d5649cdfc7911e 100644 (file)
@@ -13,8 +13,8 @@ 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');
+        print_r(harmonyActivity("musique"));
     }
     setPlaying('squeezebox');
 } else {
index 1fd64288a16cc4d04f9011d0698d793238068327..eba9df3b3a45b71d083069021a27da2c1599d1e4 100644 (file)
@@ -28,19 +28,17 @@ $cases = [
         } else {
             if (getSqueezePlayerStatus($squeezePlayer) <= 0) {
                 shieldRunActivity($device);
-            } else {
-                execScene('bureau/sound/on');
             }
         }
     },
     'WindowManager: handleComboKeys keyCode: 25, keyAction: 1' => function () use ($device) {
-        if ($device === 'salon') {
+        if ($device === 'bureau') {
             echo 'volume-down' . "\n";
             volume('3', '-', 'harmony');
         }
     },
     'WindowManager: handleComboKeys keyCode: 24, keyAction: 1' => function () use ($device) {
-        if ($device === 'salon') {
+        if ($device === 'bureau') {
             echo 'volume-up' . "\n";
             volume('3', '+', 'harmony');
         }