]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Wed, 22 Jul 2020 07:41:57 +0000 (09:41 +0200)
committerVincent <vincent@enhydra.fr>
Wed, 22 Jul 2020 07:41:57 +0000 (09:41 +0200)
.idea/workspace.xml
config/rooms.php
scripts/cron/cron.php
scripts/lib/scenes.php
scripts/vmcoff.php

index 50b1a1d8669e553a926d335a2688d0d52a67e8a7..de8e6c69433558b21fe3c199fc4dd6292da2670a 100644 (file)
@@ -2,10 +2,11 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change afterPath="$PROJECT_DIR$/scripts/vmcoff.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.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/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/vmcoff.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/vmcoff.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1593501805520" duration="1107000" />
       <workItem from="1594399361632" duration="763000" />
       <workItem from="1594621701186" duration="596000" />
-      <workItem from="1595313798230" duration="4556000" />
-    </task>
-    <task id="LOCAL-00283" summary=".">
-      <created>1580377820162</created>
-      <option name="number" value="00283" />
-      <option name="presentableId" value="LOCAL-00283" />
-      <option name="project" value="LOCAL" />
-      <updated>1580377820163</updated>
+      <workItem from="1595313798230" duration="4966000" />
+      <workItem from="1595319860593" duration="474000" />
+      <workItem from="1595398527219" duration="1869000" />
+      <workItem from="1595400793374" duration="2124000" />
     </task>
     <task id="LOCAL-00284" summary=".">
       <created>1580457418659</created>
       <option name="project" value="LOCAL" />
       <updated>1595314774389</updated>
     </task>
-    <option name="localTasksCounter" value="332" />
+    <task id="LOCAL-00332" summary=".">
+      <created>1595319345113</created>
+      <option name="number" value="00332" />
+      <option name="presentableId" value="LOCAL-00332" />
+      <option name="project" value="LOCAL" />
+      <updated>1595319345113</updated>
+    </task>
+    <option name="localTasksCounter" value="333" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="760" y="94" key="#Project_Structure/0.0.2560.1040@0.0.2560.1040" timestamp="1592377765650" />
-    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1595314761980">
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1595319323341">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1593086272091" />
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1595314761980" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1595319323341" />
     <state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
     <state x="655" y="270" key="Vcs.Push.Dialog.v2/0.0.1920.1160@0.0.1920.1160" timestamp="1591870150868" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1595315147407">
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1595319893185">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1595315147407" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1595319893185" />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
index d255b6828aa5ae935fd7c43e92b21e15006774a1..86aee73924600706fbe0f090346b51c30d2566b4 100644 (file)
@@ -152,8 +152,12 @@ function wc()
 function cour()
 {
     $favorites = [
-        ['type' => 'light', 'scene' => 'cour/on', 'label' => 'Allumer'],
+        ['type' => 'light', 'scene' => 'cour/auto', 'label' => 'Allumer'],
         ['type' => 'light', 'scene' => 'cour/off', 'label' => 'éteindre'],
+        ['type' => 'light', 'scene' => 'cour/lumineux', 'label' => 'lumineux'],
+        ['type' => 'light', 'scene' => 'cour/daylight', 'label' => 'jour'],
+        ['type' => 'light', 'scene' => 'cour/croissance', 'label' => 'grow'],
+        ['type' => 'light', 'scene' => 'cour/tropical', 'label' => 'crepuscule tropical'],
         ['type' => 'separator', 'label' => 'Projecteurs'],
         ['type' => 'light', 'scene' => 'cour/projecteurs/on', 'label' => 'Allumer'],
         ['type' => 'light', 'scene' => 'cour/projecteurs/off', 'label' => 'éteindre'],
index 35aba3ba6d52ea803080ea929463323987c79861..fa4c6578b1adf6f54839048d07a8f08fafe90030 100644 (file)
@@ -96,6 +96,9 @@ function cronRooms($cronmin)
     if (getState('chambreAutoMode') == '1') {
         updateChambreAuto();
     }
+    if (getState('courAutoMode') == '1') {
+        updateCourAuto();
+    }
     checkPlanetarium();
 }
 
index 9ddc4edc86509c502b5ee6f342ed77d5a0185a3f..97ddcbbba188d8be565221006f61cd296267f703 100644 (file)
@@ -469,7 +469,6 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'chambre/off'],
         ['type' => 'scene', 'scene' => 'sdb/off'],
         ['type' => 'scene', 'scene' => 'wc/off'],
-        ['type' => 'scene', 'scene' => 'cour/off'],
         ['type' => 'function', 'function' => 'stopHarmony'],
         ['type' => 'function', 'function' => 'stopAllSqueezebox'],
         ['type' => 'function', 'function' => 'offAllOMX'],
@@ -487,7 +486,7 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'bureau/auto'],
         ['type' => 'scene', 'scene' => 'chambre/auto'],
         ['type' => 'scene', 'scene' => 'sdb/on'],
-        ['type' => 'scene', 'scene' => 'cour/on'],
+        ['type' => 'scene', 'scene' => 'cour/auto'],
         ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
     ],
     'home/hueoff' => [
@@ -580,13 +579,30 @@ $scenes = [
     'salon/freebox/off' => [
         ['type' => 'domoticz', 'device' => '1439', 'command' => false],
     ],
-    'cour/on' => [
+    'cour/auto' => [
+        ['type' => 'domoticz', 'device' => '678', 'command' => true],
+        ['type' => 'function', 'function' => 'courAuto', 'args' => [true]],
+    ],
+    'cour/daylight' => [
+        ['type' => 'domoticz', 'device' => '678', 'command' => true],
+        ['type' => 'hue', 'group' => $cour, 'scene' => '8RyJJ3Dn7ayPQ8t'],
+    ],
+    'cour/lumineux' => [
         ['type' => 'domoticz', 'device' => '678', 'command' => true],
-        ['type' => 'hue', 'group' => $cour, 'scene' => '4JQxlqu9utk0geI'],
+        ['type' => 'hue', 'group' => $cour, 'scene' => 'XzV1CuYIdHXPKoJ'],
+    ],
+    'cour/tropical' => [
+        ['type' => 'domoticz', 'device' => '678', 'command' => true],
+        ['type' => 'hue', 'group' => $cour, 'scene' => 'wBdbymg1w5ZZvtS'],
+    ],
+    'cour/grow' => [
+        ['type' => 'domoticz', 'device' => '678', 'command' => true],
+        ['type' => 'hue', 'group' => $cour, 'scene' => 'WVanIpWUWjkBjsS'],
     ],
     'cour/off' => [
         // ['type' => 'domoticz', 'device' => '678', 'command' => false],
         ['type' => 'hue', 'group' => $cour, 'scene' => ['on' => false]],
+        ['type' => 'function', 'function' => 'courAuto', 'args' => [false]],
     ],
     'cour/projecteurs/on' => [
         ['type' => 'domoticz', 'device' => '679', 'command' => true],
@@ -623,11 +639,13 @@ function execScene($name, $fromUserAction = false, $transitionTime = null)
 
     $e = explode('/', $name);
 
-    if ($fromUserAction) {
+    if ($fromUserAction && $e[1]!=='auto') {
         if ($e[0] == 'chambre') {
             chambreAuto(false);
         } else if ($e[0] == 'bureau') {
             bureauAuto(false);
+        }else if($e[0]=='cour'){
+            courAuto(false);
         }
     }
 
@@ -881,6 +899,16 @@ function bureauAuto($on = true)
     }
 }
 
+function courAuto($on = true)
+{
+    if ($on) {
+        setState('courAutoMode', '1');
+        updateCourAuto();
+    } else {
+        setState('courAutoMode', '0');
+    }
+}
+
 function updateChambreAuto($transitionTime = null)
 {
     $hours = intval(date('H'));
@@ -919,6 +947,16 @@ function updateBureauAuto()
     execScene('bureau/' . $scene);
 }
 
+function updateCourAuto()
+{
+    if(isDay()){
+        $scene='daylight';
+    }else{
+        $scene='lumineux';
+    }
+    execScene('cour/' . $scene);
+}
+
 function wcVMCOn()
 {
     // This cancel a previous call to vmc off
@@ -955,7 +993,7 @@ function delayHttpCall($url, $delay)
 
 function delayScene($scene, $delay)
 {
-    $timeout = $$delay + 30;
-    $url = WEB_ROOT . 'scripts/light.php?delay=' . $delay['delay'] . '&scene=' . $scene . '&sid=' . session_id();
+    $timeout = $delay + 30;
+    $url = WEB_ROOT . 'scripts/light.php?delay=' . $delay . '&scene=' . $scene . '&sid=' . session_id();
     return delayHttpCall($url, $timeout);
 }
\ No newline at end of file
index b7d8dd0ab82ee28e7c02fc4745740fa0ab9e1f10..5c6ea72c47bdca909cf0b8ec332afdaf8e5c2116 100644 (file)
@@ -4,7 +4,7 @@ include "import.php";
 
 $rand = rand(100000, 1000000);
 setState('wcTimeout', $rand);
-sleep($_GET['timeout']);
+sleep($_GET['delay']);
 if (getState('wcTimeout') == $rand) {
     execScene('wc/vmc/off');
 }
\ No newline at end of file