]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Tue, 3 Nov 2020 07:49:44 +0000 (08:49 +0100)
committerVincent <vincent@enhydra.fr>
Tue, 3 Nov 2020 07:49:44 +0000 (08:49 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/ecomode.php
scripts/lib/harmony.php
scripts/lib/scenes.php

index 8d0377124f9165692ed699727bf3a320a3e96d86..8156e3ed10a2dcd073110f8995c8d652bbd1a439 100644 (file)
@@ -3,9 +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/tv.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/tv.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/lib/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/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/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1603958541180" duration="5032000" />
       <workItem from="1604042543878" duration="11137000" />
       <workItem from="1604152329376" duration="42646000" />
-      <workItem from="1604347943058" duration="1403000" />
-    </task>
-    <task id="LOCAL-00317" summary=".">
-      <created>1585553503259</created>
-      <option name="number" value="00317" />
-      <option name="presentableId" value="LOCAL-00317" />
-      <option name="project" value="LOCAL" />
-      <updated>1585553503260</updated>
+      <workItem from="1604347943058" duration="3877000" />
     </task>
     <task id="LOCAL-00318" summary=".">
       <created>1585669021651</created>
       <option name="project" value="LOCAL" />
       <updated>1604307642081</updated>
     </task>
-    <option name="localTasksCounter" value="366" />
+    <task id="LOCAL-00366" summary=".">
+      <created>1604387168422</created>
+      <option name="number" value="00366" />
+      <option name="presentableId" value="LOCAL-00366" />
+      <option name="project" value="LOCAL" />
+      <updated>1604387168423</updated>
+    </task>
+    <option name="localTasksCounter" value="367" />
     <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="132" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604307637401">
-      <screen x="0" y="0" width="1707" height="920" />
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604387115667">
+      <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="1603961854066" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604387115667" />
     <state x="635" y="216" key="FileChooserDialogImpl" timestamp="1604227698339">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state width="498" height="446" key="SwitcherDM/0.0.1707.920@0.0.1707.920" timestamp="1604228166964" />
-    <state x="655" y="270" width="816" height="530" key="Vcs.Push.Dialog.v2" timestamp="1595521362224">
-      <screen x="0" y="0" width="1920" height="1160" />
-    </state>
-    <state x="655" y="270" width="816" height="530" key="Vcs.Push.Dialog.v2/0.0.1920.1160@0.0.1920.1160" timestamp="1595521362224" />
     <state x="295" y="0" width="1290" height="907" key="dock-window-1" timestamp="1603274697406">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index fa4c6578b1adf6f54839048d07a8f08fafe90030..1310b223c024c696e2f440f19317981c2c769cfc 100644 (file)
@@ -73,6 +73,7 @@ function cronEcoMode($cronmin)
     _logSection('Ecomode');
     $ecomode = (int)getEcoMode();
     $scenes = [0 => 'off', 1 => 'on', 2 => 'super'];
+
     execScene('ecomode/' . $scenes[$ecomode]);
 }
 
index 202e1d49524fac3a0f71b46db704bad369241a78..ca88c7421276ef1056dd55d8994d638b0bee90a5 100644 (file)
@@ -1,15 +1,18 @@
 <?php
 function ecoMode($mode)
 {
-    $currentMode = getState('ecomode', '0');
 
     setState('ecomode', $mode);
     $mode = getEcoMode();
+
+    $currentMode = getState('triggeredEcomode', '0');
+    if ($mode == $currentMode) {
+        return;
+    }
+    getState('triggeredEcomode', $mode);
+
     $scenes = [0 => 'off', 1 => 'on', 2 => 'super'];
     execScene('ecomode/' . $scenes[$mode]);
-
-//    $server = new \Hoa\Eventsource\Server();
-//    $server->ecomode->send($mode);
 }
 
 function disableSuperEcoMode()
index ef03b7bdd9cba1bed14e6fd5dddd36a457f4995b..d8166fa32609d645de2689dce076b72d8ad68229 100644 (file)
@@ -30,13 +30,13 @@ function harmonyRequest($uri, $method = 'GET', $hub = 'salon')
 
 function harmonyActivity($activity)
 {
-    if ($activity == 'tv' || $activity == 'poweroff' || $activity == 'off') {
+    if ($activity == 'tv' || $activity == 'shield' || $activity == 'poweroff' || $activity == 'off') {
         setPlaying('mycanal', 'salon');
     }
     $wait = 0;
     $current = getCurrentHarmonyActivity();
     if ($current == 'off' || $current == 'poweroff' || !$current) {
-        if ($activity == 'media') {
+        if ($activity == 'media' || $activity == 'shield' || $activity == 'tv') {
             $wait = 30;
         }
     }
index d716daa086f4de95759210d1af1e29e8118eca40..e2453baa841120498027c707575fffdeba42d2ee 100644 (file)
@@ -56,25 +56,60 @@ $scenes = [
         ['type' => 'nightmode', 'mode' => '0'],
         ['type' => 'function', 'function' => 'chambreAuto', 'args' => [true]],
     ],
+    'chambre/bed/base' => [
+        ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
+        ['type' => 'nightmode', 'mode' => '1'],
+        ['type' => 'ecomode', 'mode' => '1'],
+        ['type' => 'state', 'key' => 'chambre', 'value' => 0],
+        ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
+        ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
+        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
+        ['type' => 'scene', 'scene' => 'chambre/raspberry/off'],
+        ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'],
+    ],
     'chambre/bed' => [
-        ['type' => 'scene', 'scene' => 'chambre/bedbase'],
+        ['type' => 'scene', 'scene' => 'chambre/bed/base'],
         ['type' => 'scene', 'scene' => 'chambre/nightlights'],
+        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
+        ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
         ['type' => 'scene', 'scene' => 'sdb/nuit'],
         ['type' => 'scene', 'scene' => 'chambre/cheminee'],
     ],
-    'chambre/bedbase' => [
-        ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
+    'chambre/bed/off' => [
+        ['type' => 'scene', 'scene' => 'chambre/bed/base'],
         ['type' => 'nightmode', 'mode' => '1'],
         ['type' => 'ecomode', 'mode' => '1'],
+        ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
+        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
+        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
+        ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
+    ],
+    'chambre/sleep/off' => [
+        ['type' => 'scene', 'scene' => 'chambre/bed/base'],
+        ['type' => 'scene', 'scene' => 'sdb/off'],
+    ],
+    'chambre/sleep/base' => [
+        ['type' => 'nightmode', 'mode' => '1'],
+        ['type' => 'ecomode', 'mode' => '1'],
+        ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
         ['type' => 'state', 'key' => 'chambre', 'value' => 0],
-        ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
-        ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+        ['type' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
         ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
+        ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
+        ['type' => 'scene', 'scene' => 'sdb/off'],
         ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
         ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
-        ['type' => 'scene', 'scene' => 'chambre/raspberry/off'],
-        ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'],
+        ['type' => 'delay', 'scene' => 'chambre/planetarium/off', 'delay' => 3600], // Planétarium off dans une heure
     ],
+    'chambre/sleep' => [
+        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
+        ['type' => 'hue', 'group' => $chambre, 'scene' => '-P3feFyrTnFNfXi'], // Veilleuse +
+        ['type' => 'domoticz', 'scene' => 10, 'command' => true, 'priority' => true],
+        ['type' => 'scene', 'scene' => 'chambre/sleep/base'],
+        ['type' => 'delay', 'scene' => 'chambre/bed/off', 'delay' => 300], // Tout off dans 5 min
+    ],
+
     'chambre/boreal' => [
         ['type' => 'nightmode', 'mode' => '0'],
         ['type' => 'state', 'key' => 'chambre', 'value' => 1],
@@ -127,31 +162,7 @@ $scenes = [
         ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
         ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
     ],
-    'chambre/sleepoff' => [
-        ['type' => 'scene', 'scene' => 'chambre/bedbase'],
-        ['type' => 'scene', 'scene' => 'sdb/off'],
-        ['type' => 'scene', 'scene' => 'sdb/off'],
-    ],
-    'chambre/sleepbase' => [
-        ['type' => 'nightmode', 'mode' => '1'],
-        ['type' => 'ecomode', 'mode' => '1'],
-        ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
-        ['type' => 'state', 'key' => 'chambre', 'value' => 0],
-        ['type' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
-        ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
-        ['type' => 'scene', 'scene' => 'sdb/off'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
-        ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
-        ['type' => 'delay', 'scene' => 'chambre/bedoff', 'delay' => 300], // Tout off dans 5 min
-        ['type' => 'delay', 'scene' => 'chambre/planetarium/off', 'delay' => 3600], // Planétarium off dans une heure
-    ],
-    'chambre/sleep' => [
-        ['type' => 'hue', 'group' => $chambre, 'scene' => '-P3feFyrTnFNfXi'], // Veilleuse +
-        ['type' => 'domoticz', 'scene' => 10, 'command' => true, 'priority' => true],
-        ['type' => 'scene', 'scene' => 'chambre/sleepbase'],
-    ],
+
     'chambre/moon' => [
         ['type' => 'hue', 'group' => $chambre, 'scene' => '5PKfoOn8ss17o2l'], // Clair de lune
         ['type' => 'domoticz', 'scene' => 11, 'command' => true, 'priority' => true],
@@ -234,14 +245,7 @@ $scenes = [
         ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
         ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true],
     ],
-    'chambre/bedoff' => [
-        ['type' => 'nightmode', 'mode' => '1'],
-        ['type' => 'ecomode', 'mode' => '1'],
-        ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
-    ],
+
     'chambre/cheminee' => [
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['chambre', 'fire', 1]],
     ],
@@ -305,12 +309,12 @@ $scenes = [
         ['type' => 'domoticz', 'device' => '392', 'command' => true, 'priority' => true],
     ],
     'home/aulit' => [
-        ['type' => 'scene', 'scene' => 'chambre/aulitbase'],
+        ['type' => 'scene', 'scene' => 'home/aulitbase'],
         ['type' => 'scene', 'scene' => 'chambre/bed'],
     ],
     'home/aulitoff'=>[
-        ['type' => 'scene', 'scene' => 'chambre/aulitbase'],
-        ['type' => 'scene', 'scene' => 'chambre/off'],
+        ['type' => 'scene', 'scene' => 'home/aulitbase'],
+        ['type' => 'scene', 'scene' => 'chambre/bed/off'],
         ['type' => 'scene', 'scene' => 'sdb/off'],
     ],
     'home/aulitbase' => [