]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 28 Nov 2019 18:35:16 +0000 (19:35 +0100)
committerVincent <vincent@enhydra.fr>
Thu, 28 Nov 2019 18:35:16 +0000 (19:35 +0100)
.idea/workspace.xml
scripts/domoticz_device_event.php
scripts/lib/lib.php
scripts/lib/mediarasp.php
scripts/lib/scenes.php
scripts/remotecmd.php

index caf033c98ab2861205859e0811a5620ced9594ad..f3b748d5b78a9819a044c5b81cb9a62d5245223e 100644 (file)
@@ -3,9 +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$/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/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/remotecmd.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/remotecmd.php" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
               <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
               <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@6b2d7142" type="7427dc5b:ServiceModel$ServiceGroupNode" />
             </path>
-            <path>
-              <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
-              <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@6b2d7142" type="7427dc5b:ServiceModel$ServiceGroupNode" />
-              <item name="com.intellij.execution.services.ServiceModel$ServiceNode@3e99f178" type="9fbbdea:ServiceModel$ServiceNode" />
-            </path>
           </expand>
           <select />
         </treeState>
       <workItem from="1574065436563" duration="754000" />
       <workItem from="1574066213679" duration="8067000" />
       <workItem from="1574273415760" duration="2973000" />
-      <workItem from="1574323616439" duration="9643000" />
-    </task>
-    <task id="LOCAL-00198" summary=".">
-      <created>1562746751936</created>
-      <option name="number" value="00198" />
-      <option name="presentableId" value="LOCAL-00198" />
-      <option name="project" value="LOCAL" />
-      <updated>1562746751936</updated>
+      <workItem from="1574323616439" duration="14023000" />
     </task>
     <task id="LOCAL-00199" summary=".">
       <created>1562828700494</created>
       <option name="project" value="LOCAL" />
       <updated>1574340363978</updated>
     </task>
-    <option name="localTasksCounter" value="247" />
+    <task id="LOCAL-00247" summary=".">
+      <created>1574411352997</created>
+      <option name="number" value="00247" />
+      <option name="presentableId" value="LOCAL-00247" />
+      <option name="project" value="LOCAL" />
+      <updated>1574411352997</updated>
+    </task>
+    <option name="localTasksCounter" value="248" />
     <servers />
   </component>
   <component name="TodoView">
index 44656603fae431a7fdf67427aa9eafdb89591587..624d41f72c8d5b8cfaec95ea59947ac93206bf79 100644 (file)
@@ -1,7 +1,11 @@
 <?php
+if ($_GET['device'] == '1033') {
+    $forceConfig = 'salon';
+}
 
 require_once "import.php";
 
+
 if ($_GET['device'] == 480) {
     chambreToggle();
 } else if ($_GET['device'] == 1033) {
@@ -20,13 +24,17 @@ if ($_GET['device'] == 480) {
             execScene('salon/off');
             break;
         case 'Move':
-            _remoteCmd('play', 'salon');
+            _remoteCmd('pause', 'salon');
             break;
         case 'Clock_Wise':
-            _remoteCmd('forward', 'salon');
+            if (getCurrentHarmonyActivity() !== 'poweroff') {
+                harmonyRequest('commands/volume-up?repeat=3', 'POST');
+            }
             break;
         case 'Anti_Clock_Wise':
-            _remoteCmd('rewind', 'salon');
+            if (getCurrentHarmonyActivity() !== 'poweroff') {
+                harmonyRequest('commands/volume-down?repeat=5', 'POST');
+            }
             break;
         case 'Tap':
             if (getCurrentHarmonyActivity() == 'poweroff') {
@@ -39,4 +47,5 @@ if ($_GET['device'] == 480) {
         default:
             break;
     }
-}
\ No newline at end of file
+}
+echo '1';
\ No newline at end of file
index d9a5def3aff88594ca1675eaedb67c18bf8978e4..a3e065c96e21dc5d13d0b94560c03758152671d6 100644 (file)
@@ -64,11 +64,16 @@ function shutdown()
 
 function getCurrentConfig()
 {
-    if (isset($_SERVER['HTTP_HOST']) && stristr($_SERVER['HTTP_HOST'], '.home.tortuga.enhydra.fr')) {
+    global $forceConfig;
+    if (!isset($forceConfig) && isset($_SERVER['HTTP_HOST']) && stristr($_SERVER['HTTP_HOST'], '.home.tortuga.enhydra.fr')) {
         $e = explode('.', $_SERVER['HTTP_HOST']);
         $_GET['c'] = array_shift($e);
     }
 
+    if (isset($forceConfig)) {
+        $_GET['c'] = $forceConfig;
+    }
+
     if (isset($_GET['c'])) {
         setcookie('config', $_GET['c'], 0, '/');
         $_COOKIE['config'] = $_GET['c'];
index e2fb2528ee9737822af6dea1aab6c9f72dfe1262..1416a8eed93d267c9d97e913911aebbcab6f67be 100644 (file)
@@ -2,8 +2,16 @@
 
 $mediaraspclient = null;
 
-function _removeCmd($cmd,$device){
-
+function _remoteCmd($cmd,$device){
+    // We first try to send it to salon raspberry before sending a less robust ir command
+    if (!remoteCmd($cmd, $device)) {
+        if ($device == 'salon') {
+            echo 'run '.$cmd.' with harmony';
+            harmonyRequest('commands/' . $cmd, 'POST');
+        }else{
+            echo 'ok';
+        }
+    }
 }
 
 function remoteCmd($cmd, $device)
index c2a8befca79d9b61867e6e401341671b17310160..9b817d036204157202a47d3059c2121fe62cb673 100644 (file)
@@ -515,10 +515,10 @@ $scenes = [
         ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['WC'], 65]],
     ],
     'sdb/ampli/on' => [
-        ['type' => 'hue', 'light' => $sdb_ampli, 'scene' => ['on' => true]],
+        ['type' => 'domoticz', 'device' => '1062', 'command' => true, 'priority' => true],
     ],
     'sdb/ampli/off' => [
-        ['type' => 'hue', 'light' => $sdb_ampli, 'scene' => ['on' => false]],
+        ['type' => 'domoticz', 'device' => '1062', 'command' => false, 'priority' => true],
     ],
     'sdb/off' => [
         ['type' => 'state', 'key' => 'sdb', 'value' => 0],
@@ -546,10 +546,10 @@ $scenes = [
         ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['Salle de bains'], 65]],
     ],
     'salon/freebox/on' => [
-        ['type' => 'hue', 'light' => $freebox, 'scene' => ['on' => true]],
+        ['type' => 'domoticz', 'device' => '479', 'command' => true, 'priority' => true],
     ],
     'salon/freebox/off' => [
-        ['type' => 'hue', 'light' => $freebox, 'scene' => ['on' => false]],
+        ['type' => 'domoticz', 'device' => '479', 'command' => true, 'priority' => true],
     ],
     'ecomode/basic' => [
         ['type' => 'scene', 'scene' => 'bureau/media/off'],// Media bureau
index fd19c3e5e796384b7b8dba7928e2f3372dac7aa9..1740ec7c9dd1094547b243695ec9edf99190c496 100644 (file)
@@ -10,12 +10,4 @@ if (!isset($_GET['device'])) {
        $_GET['device'] = config('DEVICE');
 }
 
-// We first try to send it to salon raspberry before sending a less robust ir command
-if (!remoteCmd($cmd, $_GET['device'])) {
-       if ($_GET['device'] == 'salon') {
-           echo 'run '.$cmd.' with harmony';
-               harmonyRequest('commands/' . $cmd, 'POST');
-       }else{
-           echo 'ok';
-    }
-}
\ No newline at end of file
+_remoteCmd($cmd,$_GET['device']);
\ No newline at end of file