]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Tue, 3 Nov 2020 14:43:38 +0000 (15:43 +0100)
committerVincent <vincent@enhydra.fr>
Tue, 3 Nov 2020 14:43:38 +0000 (15:43 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/harmony.php
scripts/lib/scenes.php
scripts/lib/shield.php

index 976b62d61572ad6100b6eace0e4a462702a2aed8..1425995454c5362c866350999bc8947786f47f70 100644 (file)
@@ -3,18 +3,10 @@
   <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/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/media.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/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/ecomode.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/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/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" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1603958541180" duration="5032000" />
       <workItem from="1604042543878" duration="11137000" />
       <workItem from="1604152329376" duration="42646000" />
-      <workItem from="1604347943058" duration="5502000" />
-    </task>
-    <task id="LOCAL-00320" summary=".">
-      <created>1586519228613</created>
-      <option name="number" value="00320" />
-      <option name="presentableId" value="LOCAL-00320" />
-      <option name="project" value="LOCAL" />
-      <updated>1586519228613</updated>
+      <workItem from="1604347943058" duration="9001000" />
     </task>
     <task id="LOCAL-00321" summary=".">
       <created>1590317532388</created>
       <option name="project" value="LOCAL" />
       <updated>1604390350662</updated>
     </task>
-    <option name="localTasksCounter" value="369" />
+    <task id="LOCAL-00369" summary=".">
+      <created>1604396748171</created>
+      <option name="number" value="00369" />
+      <option name="presentableId" value="LOCAL-00369" />
+      <option name="project" value="LOCAL" />
+      <updated>1604396748171</updated>
+    </task>
+    <option name="localTasksCounter" value="370" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state x="740" y="229" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.1707.920@0.0.1707.920" timestamp="1604146905948" />
-    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604390342755">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604396727202">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="132" y="0" width="737" height="502" key="CommitChangelistDialog2/0.0.1707.920@0.0.1707.920" timestamp="1604307637401" />
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604390342755" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604396727202" />
     <state x="635" y="216" key="FileChooserDialogImpl" timestamp="1604227698339">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
index 06865ffa8799dca081588958d62fffa2fd583e04..1e1f37ff4e53296ce7955e296c26e004f42da92e 100644 (file)
@@ -337,23 +337,10 @@ function cronHarmony($cronmin)
     _logSection('Harmony');
     $currentActivity = getCurrentHarmonyActivity();
 
-    if ($currentActivity == 'tv') {
-        // On allume la freebox si ce n'est pas déjà le cas
-        execScene('salon/freebox/on');
-    } else {
-        // Toutes les 15 minutes on éteint la freebox si elle est allumée
-        if ($cronmin % 15 == 0) {
-            execScene('salon/freebox/off');
-        }
-    }
-
     if (!$currentActivity) {
         return;
     }
-
-    if ($currentActivity == 'tv') {
-        setPlaying('mycanal', 'salon');
-    } else if ($currentActivity == 'musique') {
+    if ($currentActivity == 'musique') {
         setPlaying('squeezebox', 'salon');
     } else if ($currentActivity == 'poweroff' || $currentActivity == 'off') {
         setPlaying('mycanal', 'salon');
index e810aec47214da7670f1a3812b7a726fe8f21f19..aded60d7c086d8579d0134db96d98b853a9f4aff 100644 (file)
@@ -30,7 +30,7 @@ function harmonyRequest($uri, $method = 'GET', $hub = 'salon')
 
 function harmonyActivity($activity)
 {
-    if ($activity == 'tv' $activity == 'poweroff' || $activity == 'off') {
+    if ($activity == 'poweroff' || $activity == 'off') {
         setPlaying('mycanal', 'salon');
     }
     $wait = 0;
@@ -47,7 +47,7 @@ function harmonyActivity($activity)
     if ($wait > 0) {
         sleep($wait);
     }
-    if ($activity == 'tv' ) {
+    if ($activity == 'tv') {
         runAtEnd('sleep(5);harmonyDeviceCommand(\'videoprojecteur-epson\', \'power-on\');');
     }
     return $res;
index 7b1a97a02c586d7dcc89fccc7948229ba2b00458..f79ae68abced9631780c334cc73bff7b65f33479 100644 (file)
@@ -312,7 +312,7 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'home/aulitbase'],
         ['type' => 'scene', 'scene' => 'chambre/bed'],
     ],
-    'home/aulitoff'=>[
+    'home/aulitoff' => [
         ['type' => 'scene', 'scene' => 'home/aulitbase'],
         ['type' => 'scene', 'scene' => 'chambre/bed/off'],
         ['type' => 'scene', 'scene' => 'sdb/off'],
@@ -784,7 +784,7 @@ function execScene($name, $fromUserAction = false, $transitionTime = null)
         } else if ($action['type'] == 'phonetask') {
             phoneTask($action['task'], $action['phone'], true);
         } else if ($action['type'] == 'ecomode') {
-            ecoMode($action['mode']);
+            ecoMode($action['mode'], true);
         } else if ($action['type'] == 'domoticz') {
             if (isset($action['scene'])) {
                 $action['device'] = $action['scene'];
index 0f22b8541851093a58a0444eb05b74839791fabe..5ecbffa7993b51d656476d480a44b8dc17e99faf 100644 (file)
@@ -16,6 +16,13 @@ function shieldConnect()
     }
 }
 
+function shieldRunActivity($device=null){
+    $device=getDevice($device);
+    if($device==='salon'){
+        harmonyActivity('tv');
+    }
+}
+
 function shieldCommand($command, $params)
 {
     shieldConnect();
@@ -79,14 +86,10 @@ function shieldKey($keys, $device = true)
 
 function shieldNetflix($id = null, $device = null)
 {
+    shieldRunActivity($device);
     shieldHome();
     sleep(1);
 
-    $device=getDevice($device);
-    if($device==='salon'){
-        harmonyActivity('tv');
-    }
-
     $url = 'http://www.netflix.com/';
     if (null !== $id && $id !== 'home') {
         $url .= 'watch/' . $id;
@@ -145,6 +148,7 @@ function shieldLaunchApp($activity)
 
 function shieldMyCanal($channel = false, $type = 'live', $device = null)
 {
+    shieldRunActivity($device);
     if ($type === 'replay') {
         if ($channel === 'arte') {
             return shieldArte();
@@ -158,16 +162,13 @@ function shieldMyCanal($channel = false, $type = 'live', $device = null)
     } else if ($type === 'live') {
         $url = 'https://www.canalplus.com/live/?channel=' . $channel;
     }
-    $device=getDevice($device);
-    if($device==='salon'){
-        harmonyActivity('tv');
-    }
     setPlaying('mycanal', $device);
     _adb('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.app.common.legacy.DeepLinkActivity');
 }
 
 function shieldKodi($file,$device=null)
 {
+    shieldRunActivity($device);
     shieldHome();
     $device=getDevice($device);
     if($device==='salon'){
@@ -187,8 +188,8 @@ function shieldNormalizeURL($input)
 
 function shieldVLC($file)
 {
+    shieldRunActivity($device);
     shieldHome();
-    $url = 'smb://Share:dcfyjbcyckwydtgufjx@192.168.13.4/Share/' . $file;
     _adb('shell am start', '-a android.intent.action.VIEW  -d \'"' . shieldNormalizeURL($file) . '"\' -n org.videolan.vlc/.StartActivity');
 }