]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 25 Jun 2020 11:57:55 +0000 (13:57 +0200)
committerVincent <vincent@enhydra.fr>
Thu, 25 Jun 2020 11:57:55 +0000 (13:57 +0200)
.idea/workspace.xml
config/chambre.php
config/lit.php
config/litvincent.php
config/salon.php
scripts/lib/domoticz.php
scripts/lib/scenes.php

index 26e4c96b3ffaf6e544a4c41a3c77484ffd488efb..ac2fd631568ccab87dc27b90b9940cc3bbd27944 100644 (file)
@@ -3,10 +3,12 @@
   <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/cuisine.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cuisine.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/chambre.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/chambre.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/lit.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/lit.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/litvincent.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/litvincent.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.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$/tools/pop/pop.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/pop.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/tools/pop/stoppopdaemon" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/stoppopdaemon" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1591856612414" duration="3601000" />
       <workItem from="1592205539041" duration="8326000" />
       <workItem from="1592379506437" duration="1336000" />
-      <workItem from="1592546736447" duration="1435000" />
-    </task>
-    <task id="LOCAL-00278" summary=".">
-      <created>1579602721221</created>
-      <option name="number" value="00278" />
-      <option name="presentableId" value="LOCAL-00278" />
-      <option name="project" value="LOCAL" />
-      <updated>1579602721221</updated>
+      <workItem from="1592546736447" duration="1681000" />
+      <workItem from="1593068187054" duration="1620000" />
     </task>
     <task id="LOCAL-00279" summary=".">
       <created>1579628617831</created>
       <option name="project" value="LOCAL" />
       <updated>1592288366341</updated>
     </task>
-    <option name="localTasksCounter" value="327" />
+    <task id="LOCAL-00327" summary=".">
+      <created>1592548753578</created>
+      <option name="number" value="00327" />
+      <option name="presentableId" value="LOCAL-00327" />
+      <option name="project" value="LOCAL" />
+      <updated>1592548753578</updated>
+    </task>
+    <option name="localTasksCounter" value="328" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1585852940968" />
-    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1592288343397">
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1592548742823">
       <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="1591868920174" />
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1592288343397" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1592548742823" />
     <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="2560" height="1040" />
     </state>
     <state x="1456" y="240" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1586418523328" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1591459411916">
-      <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="1591459411916" />
-    <state x="943" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1584289936754">
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1593068905381">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="943" y="225" width="672" height="678" key="search.everywhere.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1584289936754" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1593068905381" />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
index 541aef09d2deb85c89ddfa62900091947e5bcefe..4c7febbff16984e5996414c8837880fb669c1352 100644 (file)
@@ -23,6 +23,7 @@ if(DISPLAYINTERFACE) {
     $nav = '<a href="#" data-menu="home"><i class="fa fa-home" aria-hidden="true"></i></a>
     <a href="#" data-menu="lights"><i class="far fa-lightbulb" aria-hidden="true"></i></a>
     <a href="#" data-menu="music"><i class="fa fa-music" aria-hidden="true"></i></a>
+    <a href="/scripts/light.php?scene=chambre/fan/toggle" class="ajax"><i class="fa fa-fan" aria-hidden="true"></i></a>
     <a href="#" data-menu="coffee"><i class="fa fa-coffee" aria-hidden="true"></i></a>
     <a href="#" data-menu="settings"><i class="fa fa-cog" aria-hidden="true"></i></a>
     <a href="#" data-action="alert"><i class="fa fa-bell" aria-hidden="true"></i></a>
index c0d63c441c6e32a0e6dd54ea4400adf065631648..6f20b745a8b44ca1adf569388e04f3efc22bd5ba 100644 (file)
@@ -19,6 +19,7 @@ if (DISPLAYINTERFACE) {
     <a href="#" data-menu="music"><i class="fa fa-music" aria-hidden="true"></i></a>
     <a href="#" data-menu="media"><i class="fa fa-tv-retro" aria-hidden="true"></i></a>
     <a href="#" data-menu="coffee"><i class="fa fa-coffee" aria-hidden="true"></i></a>
+    <a href="/scripts/light.php?scene=chambre/fan/toggle" class="ajax"><i class="fa fa-fan" aria-hidden="true"></i></a>
     <a href="#" data-menu="settings"><i class="fa fa-cog" aria-hidden="true"></i></a>    
     <a href="#" data-action="alert"><i class="fa fa-bell" aria-hidden="true"></i></a>
     <a href="#" data-action="off"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index aeb6ea016b3d713244e66760e97081dfd620d352..7e15a9350ab55e7862415c7ddf5c886f6f44f6d7 100644 (file)
@@ -24,6 +24,7 @@ if (DISPLAYINTERFACE) {
     <a href="#" data-menu="clock"><i class="far fa-alarm-clock" aria-hidden="true"></i></a>
     <a href="#" data-menu="music"><i class="fa fa-music" aria-hidden="true"></i></a>
     <a href="#" data-menu="media"><i class="fa fa-tv-retro" aria-hidden="true"></i></a>
+    <a href="/scripts/light.php?scene=chambre/fan/toggle" class="ajax"><i class="fa fa-fan" aria-hidden="true"></i></a>
     <a href="#" data-menu="settings"><i class="fa fa-cog" aria-hidden="true"></i></a>
     <a href="#" data-action="alert"><i class="fa fa-bell" aria-hidden="true"></i></a>
     <a href="#" data-action="off"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index b08a8bf57148a9f5930867cc17fa6868ff02f713..0315f2e971e9a144b51c8f5fa20dbb97638f14e2 100644 (file)
@@ -26,6 +26,7 @@ if (DISPLAYINTERFACE) {
     <a href="#" data-menu="music"><i class="fa fa-music" aria-hidden="true"></i></a>
     <a href="#" data-menu="media"><i class="fa fa-tv-retro" aria-hidden="true"></i></a>
     <a href="#" data-menu="remote"><i class="fa fa-play" aria-hidden="true"></i></a>
+    <a href="/scripts/light.php?scene=salon/fan/toggle" class="ajax"><i class="fa fa-fan" aria-hidden="true"></i></a>
     <a href="#" data-menu="coffee"><i class="fa fa-coffee" aria-hidden="true"></i></a>
     <a href="#" data-menu="settings"><i class="fa fa-cog" aria-hidden="true"></i></a>
     <a href="#" data-action="alert"><i class="fa fa-bell" aria-hidden="true"></i></a>
index 7ff1e2022f547cf37f6049fe680e8159815fd453..dcf344bc1dc4472f00bacb07f25d12079ae51ca9 100644 (file)
@@ -20,7 +20,13 @@ function domoticzGroup($group, $command)
 
 function domoticzSwitch($device, $cmd, $type = 'light', $priority = false, $delay = 0)
 {
-    return domoticzCmd(['idx' => $device, 'switchcmd' => $cmd ? 'On' : 'Off', 'param' => 'switch' . $type, 'level' => '0', 'delay' => $delay], $priority);
+    if ($cmd === 'Toogle' || $cmd === 'toogle' || $cmd === 'Toggle' || $cmd === 'toggle') {
+        $cmd = 'Toggle';
+    }
+    if ($cmd !== 'Toggle') {
+        $cmd = $cmd ? 'On' : 'Off';
+    }
+    return domoticzCmd(['idx' => $device, 'switchcmd' => $cmd, 'param' => 'switch' . $type, 'level' => '0', 'delay' => $delay], $priority);
 }
 
 function domoticzCmd($command, $priority = false)
@@ -42,7 +48,7 @@ function domoticzCmd($command, $priority = false)
     return true;
 }
 
-function getDomoticzDeviceStatus($device,$force=false)
+function getDomoticzDeviceStatus($device, $force = false)
 {
     $res = runDomoticzCommand(['type' => 'devices', 'rid' => $device]);
     $res = json_decode($res->getBody(), true);
index bd9ae2916ed846dc97d51d327583a65cdb246bb4..47de559f1ac8f9f9239bf30f0bb4bb5f1f4c8c0f 100644 (file)
@@ -31,7 +31,7 @@ $scenes = [
         ['type' => 'hue', 'group' => $chambre, 'scene' => 'dawn', 'delay' => 1],
         ['type' => 'scene', 'scene' => 'chambre/rideaux/open', 'delay' => 31],
         ['type' => 'scene', 'scene' => 'chambre/auto', 'delay' => 35],
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
+        //['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
         ['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
         ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
         ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Matin'],
@@ -43,6 +43,15 @@ $scenes = [
     'chambre/deshumidificateur/off' => [
         ['type' => 'domoticz', 'device' => '1062', 'command' => false],
     ],
+    'chambre/fan/on' => [
+        ['type' => 'domoticz', 'device' => '1062', 'command' => true],
+    ],
+    'chambre/fan/off' => [
+        ['type' => 'domoticz', 'device' => '1062', 'command' => false],
+    ],
+    'chambre/fan/toggle' => [
+        ['type' => 'domoticz', 'device' => '1062', 'command' => 'Toggle'],
+    ],
     'chambre/auto' => [
         ['type' => 'nightmode', 'mode' => '0'],
         ['type' => 'function', 'function' => 'chambreAuto', 'args' => [true]],
@@ -190,6 +199,7 @@ $scenes = [
     'chambre/off' => [
         ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
         ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
+        ['type' => 'scene', 'scene' => 'chambre/fan/off'],
     ],
     'chambre/off/exceptcheminee' => [
         ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
@@ -292,6 +302,7 @@ $scenes = [
         ['type' => 'insteon', 'command' => '0?133=I=0=0'],
         ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
         ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
+        ['type' => 'scene', 'scene' => 'salon/fan/off'],
     ],
     'salon/cinema' => [
         ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
@@ -321,6 +332,16 @@ $scenes = [
     'salon/media/play' => [
         ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ['media']],
     ],
+    'salon/fan/on' => [
+        ['type' => 'domoticz', 'device' => '478', 'command' => true],
+    ],
+    'salon/fan/off' => [
+        ['type' => 'domoticz', 'device' => '478', 'command' => false],
+    ],
+    'salon/fan/toggle' => [
+        ['type' => 'domoticz', 'device' => '478', 'command' => 'Toggle'],
+    ],
+
     'bureau/wakeuppc' => [
         ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
     ],