]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Fri, 22 Jan 2021 17:52:07 +0000 (18:52 +0100)
committerVincent <vincent@enhydra.fr>
Fri, 22 Jan 2021 17:52:07 +0000 (18:52 +0100)
.idea/workspace.xml
scripts/lib/hue.php
scripts/lib/medialibrary.php
scripts/lib/scenes.php
servers/hue.php

index d6351bc0cc8b5c4b3e462b7d02e65deb6fd934b9..d9a84aaffc8e595b63fb5d0850e687b6df9c5eb8 100644 (file)
@@ -3,6 +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$/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/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" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1610462926782" duration="1001000" />
       <workItem from="1610483375018" duration="3692000" />
       <workItem from="1610701873024" duration="644000" />
-      <workItem from="1610959093755" duration="44000" />
-    </task>
-    <task id="LOCAL-00386" summary=".">
-      <created>1605171515396</created>
-      <option name="number" value="00386" />
-      <option name="presentableId" value="LOCAL-00386" />
-      <option name="project" value="LOCAL" />
-      <updated>1605171515396</updated>
+      <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="project" value="LOCAL" />
       <updated>1610702549932</updated>
     </task>
-    <option name="localTasksCounter" value="435" />
+    <task id="LOCAL-00435" summary=".">
+      <created>1610959164385</created>
+      <option name="number" value="00435" />
+      <option name="presentableId" value="LOCAL-00435" />
+      <option name="project" value="LOCAL" />
+      <updated>1610959164385</updated>
+    </task>
+    <option name="localTasksCounter" value="436" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 5d005834c34cc691d3746365733c47c4be680e35..1d12463a1e89bedca3b975c212d4601079132dba 100644 (file)
@@ -17,7 +17,7 @@ function getHueState()
     return array('groups' => $hue->getGroups(), 'scenes' => $hue->getScenes(), 'lights' => $hue->getLights());
 }
 
-function hueCommand($action, $transitionTime)
+function hueCommand($action, $transitionTime, $repeat = 2)
 {
     $redis = connectRedis();
     $queue = $redis->igbget('hue_queue');
@@ -26,6 +26,7 @@ function hueCommand($action, $transitionTime)
     }
     $command = $action;
     $command['transitionTime'] = $transitionTime;
+    $command['repeat'] = $repeat;
     $queue[] = $command;
     $redis->igbset('hue_queue', $queue);
     $redis->publish('hue_event', 'handle_queue');
index 6523ef3f2a61492c7e395d06316ebf61f41e4280..38062c2c46c30ddc09626698e0442e523536f5a6 100644 (file)
@@ -159,6 +159,7 @@ function getTranscodedPath(SplFileInfo $item)
 
 function transcodeOneVideo()
 {
+    return;
     if (getState('night') == '1' || getState('device_avion_awake') == '0') {
         return;
     }
index 492b53c541f2fd701503049a85c313d966abfe6e..3f127409e7240e1b5bc888ce7d42c51f1720cc95 100644 (file)
@@ -307,9 +307,10 @@ $scenes = [
         ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group On', 'priority' => true],
     ],
     'home/alert' => [
-        ['type' => 'hue', 'group' => $alert, 'scene' => ['alert' => 'lselect']],
-        ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Tortuga Alerte'],
         ['type' => 'domoticz', 'device' => '392', 'command' => true, 'priority' => true],
+        ['type' => 'hue', 'group' => $alert, 'scene' => ['alert' => 'select']],
+        ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Tortuga Alerte'],
+        ['type' => 'hue', 'group' => $alert, 'delay' => 1, 'scene' => ['alert' => 'none']],
     ],
     'home/aulit' => [
         ['type' => 'scene', 'scene' => 'chambre/bed'],
@@ -337,7 +338,6 @@ $scenes = [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
         //['type' => 'insteon', 'command' => '0?113=I=0=0'],
         ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
     ],
     'salon/off' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
@@ -354,25 +354,21 @@ $scenes = [
     'salon/cineclub' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
         ['type' => 'scene', 'scene' => 'salon/cinemabase'],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
     ],
     'salon/cinema' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
         ['type' => 'scene', 'scene' => 'salon/cinemabase'],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
     ],
     'salon/tamise' => [
         ['type' => 'ecomode', 'mode' => '0'],
         ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
         // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
     ],
     'salon/lecturenocture' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
         // ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
     ],
     'salon/cheminee' => [
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 1]],
index 0dcaba855efef0a33dcf448bb044a3eecda3d995..6e6c4980a6d4b68937d0ce366788b3be31ce8464 100644 (file)
@@ -31,14 +31,20 @@ function handleHueQueue()
             break;
         }
 
-        $queue = array_unique($queue);
-
         echo 'Handle Queue : current state ' . json_encode($queue) . "\n";
 
         $command = array_shift($queue);
+        if (isset($command['repeat']) && $command['repeat'] > 0) {
+            $command['repeat']--;
+            array_push($queue, $command);
+        }
         $redis->igbset('hue_queue', $queue);
         echo 'Run command ' . json_encode($command) . "\n";
-        _hueCommand($command);
+        try {
+            _hueCommand($command);
+        }catch (Exception $e){
+
+        }
         usleep(1000000 * 0.1);
     }
     echo 'End of handling queue' . "\n";