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

index 8156e3ed10a2dcd073110f8995c8d652bbd1a439..7628581f82286b159c9cb665451d8868914cc54f 100644 (file)
@@ -3,10 +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/settings.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/settings.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/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/ecomode.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/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" />
       <workItem from="1603958541180" duration="5032000" />
       <workItem from="1604042543878" duration="11137000" />
       <workItem from="1604152329376" duration="42646000" />
-      <workItem from="1604347943058" duration="3877000" />
-    </task>
-    <task id="LOCAL-00318" summary=".">
-      <created>1585669021651</created>
-      <option name="number" value="00318" />
-      <option name="presentableId" value="LOCAL-00318" />
-      <option name="project" value="LOCAL" />
-      <updated>1585669021651</updated>
+      <workItem from="1604347943058" duration="4570000" />
     </task>
     <task id="LOCAL-00319" summary=".">
       <created>1585899396649</created>
       <option name="project" value="LOCAL" />
       <updated>1604387168423</updated>
     </task>
-    <option name="localTasksCounter" value="367" />
+    <task id="LOCAL-00367" summary=".">
+      <created>1604389791156</created>
+      <option name="number" value="00367" />
+      <option name="presentableId" value="LOCAL-00367" />
+      <option name="project" value="LOCAL" />
+      <updated>1604389791157</updated>
+    </task>
+    <option name="localTasksCounter" value="368" />
     <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="1604387115667">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604389742372">
       <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="1604387115667" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604389742372" />
     <state x="635" y="216" key="FileChooserDialogImpl" timestamp="1604227698339">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state x="635" y="216" key="FileChooserDialogImpl/0.0.1707.920@0.0.1707.920" timestamp="1604227698339" />
-    <state x="743" y="392" key="NewPhpFileDialog" timestamp="1604238041494">
-      <screen x="0" y="0" width="1707" height="920" />
+    <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1604390075365">
+      <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="743" y="392" key="NewPhpFileDialog/0.0.1707.920@0.0.1707.920" timestamp="1604238041494" />
-    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1603958673068" />
+    <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1604390075365" />
     <state x="781" y="165" key="SettingsEditor" timestamp="1596008871908">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="295" y="0" width="1290" height="907" key="dock-window-1/0.0.2560.1040@0.0.2560.1040" timestamp="1603274697406" />
-    <state x="651" y="227" width="550" height="534" key="find.popup" timestamp="1604301949692">
-      <screen x="0" y="0" width="1707" height="920" />
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1604389892117">
+      <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="651" y="227" width="550" height="534" key="find.popup/0.0.1707.920@0.0.1707.920" timestamp="1604301949692" />
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1603559077781" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1604389892117" />
     <state x="512" y="211" key="run.anything.popup" timestamp="1604146410464">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
index f5b637aaea0748cf4a8ade7cf6210dcdbe79831e..cfd1046e4c7959474443b6f9f7653e828111e0dd 100644 (file)
@@ -20,6 +20,7 @@ $shortcuts['settings'] = [
     ['type' => 'action', 'action' => 'close', 'label' => 'Fermer'],
     ['type' => 'action', 'action' => 'reload', 'label' => 'Recharger'],
     ['type' => 'action', 'action' => 'reboot', 'label' => 'Reboot'],
+    ['type' => 'url', 'href' => '/scripts/ecomode.php?action=fix', 'label' => 'Réparer scènes']
 ];
 
 if (in_array(getCurrentConfig(), $simple)) {
index 1310b223c024c696e2f440f19317981c2c769cfc..5ca5e3a5454aa520683736649950a6edf9bada1d 100644 (file)
@@ -71,10 +71,7 @@ function cronInsteon($cronmin)
 function cronEcoMode($cronmin)
 {
     _logSection('Ecomode');
-    $ecomode = (int)getEcoMode();
-    $scenes = [0 => 'off', 1 => 'on', 2 => 'super'];
-
-    execScene('ecomode/' . $scenes[$ecomode]);
+    ecoMode(null);
 }
 
 function cronTranscode($cronmin)
index b6ea01bdb65232c57a265e778f04847186a3432e..27adc5da38d9e0255bfe2e37eddfcef858d9af04 100644 (file)
@@ -3,6 +3,10 @@ require_once "import.php";
 if (isset($_GET['action'])) {
     if ($_GET['action'] = 'disablesuper') {
         disableSuperEcoMode();
+    } else if ($_GET['action'] == 'fix') {
+        ecoMode(null, true);
+        header('/');
+        exit;
     }
 } else {
     heartbeat();
index ca88c7421276ef1056dd55d8994d638b0bee90a5..8de82b59ab85990822f7fae029980e3a17cbce2b 100644 (file)
@@ -1,12 +1,13 @@
 <?php
-function ecoMode($mode)
+function ecoMode($mode = null, $force = false)
 {
-
-    setState('ecomode', $mode);
+    if (null !== $mode) {
+        setState('ecomode', $mode);
+    }
     $mode = getEcoMode();
 
     $currentMode = getState('triggeredEcomode', '0');
-    if ($mode == $currentMode) {
+    if (!$force && $mode == $currentMode) {
         return;
     }
     getState('triggeredEcomode', $mode);