]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 9 Nov 2022 16:59:04 +0000 (17:59 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 9 Nov 2022 16:59:04 +0000 (17:59 +0100)
.idea/workspace.xml
config/rooms.php
scripts/domoticz_device_event.php
scripts/lib/scenes.php
scripts/lib/switchbot.php

index 09aa7a6955382bcb5e69912c1e6fdbeea851741f..044a998308be3306afb078a196a7d5c01bbbfef1 100644 (file)
@@ -3,7 +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/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.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/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.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/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1666856719410" duration="668000" />
       <workItem from="1666880430659" duration="1177000" />
       <workItem from="1667037570905" duration="1563000" />
-      <workItem from="1667739527547" duration="1278000" />
-    </task>
-    <task id="LOCAL-00491" summary=".">
-      <created>1639181242353</created>
-      <option name="number" value="00491" />
-      <option name="presentableId" value="LOCAL-00491" />
-      <option name="project" value="LOCAL" />
-      <updated>1639181242355</updated>
+      <workItem from="1667739527547" duration="1293000" />
+      <workItem from="1668006276656" duration="977000" />
     </task>
     <task id="LOCAL-00492" summary=".">
       <created>1639205467698</created>
       <option name="project" value="LOCAL" />
       <updated>1667037724618</updated>
     </task>
-    <option name="localTasksCounter" value="540" />
+    <task id="LOCAL-00540" summary=".">
+      <created>1667752233866</created>
+      <option name="number" value="00540" />
+      <option name="presentableId" value="LOCAL-00540" />
+      <option name="project" value="LOCAL" />
+      <updated>1667752233866</updated>
+    </task>
+    <option name="localTasksCounter" value="541" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 460c7bf95594dd5ddd074ef0a673a3932f6980ff..d0f21dc79613b3d1ecb48a89207e1a09ee222991 100644 (file)
@@ -67,6 +67,7 @@ function salon()
         ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'],
         ['type' => 'light', 'scene' => 'salon/lecturenocture', 'label' => 'Lecture nocturne'],
         ['type' => 'light', 'scene' => 'salon/cheminee', 'label' => 'Cheminée'],
+        ['type' => 'light', 'scene' => 'salon/theatre', 'label' => 'Théâtre'],
         ['type' => 'light', 'scene' => 'salon/bar/toggle', 'label' => 'Bar'],
     ];
     $all = array_merge($favorites, [['type' => 'separator', 'label' => 'Projecteur'],
index 50cbfb381af0772b80a6eb778eda0d62e5e80ec3..c7af3427f78075db82c7bc470a3c5c31f33dc24a 100644 (file)
@@ -27,7 +27,6 @@ if (in_array($device, $cubesalon)) {
 require_once "import.php";
 
 
-
 if ($device === 6894) {
     domoticzCmd(6898, 'Toggle');
 } elseif ($device == 6895) {
@@ -80,7 +79,11 @@ if ($device === 6894) {
             setState('wc', 1);
             break;
         case 'Long_Click':
-            execScene('home/alert', true);
+            if (isJerome(false) && isVincent()) {
+                execScene('home/alert', true);
+            } else {
+                wcToggle();
+            }
             break;
         case 'Click':
         default:
index f6d5d2a622a82a2496f672e74fa6b25db5fa366e..3aa03da715e28a3bf031b355e6c6f8cf1cfd6502 100644 (file)
@@ -406,6 +406,15 @@ $scenes = [
         ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
         ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
     ],
+    'salon/theatre' => [
+        ['type' => 'ecomode', 'mode' => '0'],
+        ['type' => 'domoticz', 'scene' => 53, 'command' => true, 'priority' => true],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'xWNIeznSzek8dKS', 'repeat' => 2],
+        ['type' => 'state', 'key' => 'salon', 'value' => 'theatre'],
+        // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
+        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
+        ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
+    ],
     'salon/lecturenocture' => [
         ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
         ['type' => 'domoticz', 'scene' => 49, 'command' => true, 'priority' => true],
index 2a4ddc4a4e23951ed0ef5a0e43398281a3b98dc5..6879c7538d31b49abc4ba7081bcf64082698350d 100644 (file)
@@ -113,14 +113,16 @@ function _isVincent()
     return true;
 }
 
-function isJerome()
+function isJerome($strict = true)
 {
-    return remember('jerome_in_paris', 3600, function () {
-        return _isJerome();
+    $key = 'jerome_in_paris' . ($strict ? '' : '_1');
+
+    return remember($key, 3600, function () use ($strict) {
+        return _isJerome($strict);
     }, true);
 }
 
-function _isJerome()
+function _isJerome($strict = true)
 {
     $today = new DateTime('now');
     $yesterday = new DateTime('now');
@@ -128,7 +130,7 @@ function _isJerome()
     $tomorrow = new DateTime('now');
     $tomorrow->add(new DateInterval('P1D'));
 
-    $dates = [$yesterday, $today, $tomorrow];
+    $dates = $strict ? [$yesterday, $today, $tomorrow] : [$today];
 
     foreach ($dates as $date) {
         $events = searchIcalEventDay('dplacements-jrme', $date);