]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 15 Aug 2019 16:06:29 +0000 (18:06 +0200)
committerVincent <vincent@enhydra.fr>
Thu, 15 Aug 2019 16:06:29 +0000 (18:06 +0200)
14 files changed:
.idea/workspace.xml
config/coffee.php [new file with mode: 0644]
config/cuisine.php
config/default.php
config/entree.php
config/salon.php
config/sdb.php
js/home.js
scripts/ifttt.php [new file with mode: 0644]
scripts/lib/ifttt.php [new file with mode: 0644]
scripts/lib/lib.php
scripts/lib/scenes.php
style/style.css
style/style.less

index f80dce17f167f1bb93b4f81f9e74220988071a3f..697054a4560cb89ff82dda322f87c9d86e39217a 100644 (file)
@@ -2,12 +2,20 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+      <change afterPath="$PROJECT_DIR$/config/coffee.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/scripts/ifttt.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/scripts/lib/ifttt.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/hue.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/cuisine.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cuisine.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/default.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/default.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/entree.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/entree.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.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/light.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/light.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.css" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/style.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.less" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1565597022811" duration="1470000" />
       <workItem from="1565598552133" duration="873000" />
       <workItem from="1565857750276" duration="198000" />
-      <workItem from="1565857963461" duration="6119000" />
-    </task>
-    <task id="LOCAL-00153" summary=".">
-      <created>1550561360205</created>
-      <option name="number" value="00153" />
-      <option name="presentableId" value="LOCAL-00153" />
-      <option name="project" value="LOCAL" />
-      <updated>1550561360205</updated>
+      <workItem from="1565857963461" duration="9853000" />
     </task>
     <task id="LOCAL-00154" summary=".">
       <created>1550698148331</created>
       <option name="project" value="LOCAL" />
       <updated>1565598575548</updated>
     </task>
-    <option name="localTasksCounter" value="202" />
+    <task id="LOCAL-00202" summary=".">
+      <created>1565865380451</created>
+      <option name="number" value="00202" />
+      <option name="presentableId" value="LOCAL-00202" />
+      <option name="project" value="LOCAL" />
+      <updated>1565865380452</updated>
+    </task>
+    <option name="localTasksCounter" value="203" />
     <servers />
   </component>
   <component name="TodoView">
diff --git a/config/coffee.php b/config/coffee.php
new file mode 100644 (file)
index 0000000..4965ce9
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+$shortcuts['coffee'] = [
+    ['type' => 'ifttt', 'event' => 'coffee_on', 'label' => 'Allumer'],
+    ['type' => 'ifttt', 'event' => 'coffee_off', 'label' => 'éteindre'],
+    ['type' => 'separator', 'label' => 'Cafés'],
+    ['type' => 'ifttt', 'event' => 'coffee_vincent', 'label' => 'Vincent'],
+    ['type' => 'ifttt', 'event' => 'coffee_jerome', 'label' => 'Jérôme'],
+    ['type' => 'ifttt', 'event' => 'coffee_expresso', 'label' => 'Expresso'],
+    ['type' => 'ifttt', 'event' => 'coffee_americano', 'label' => 'Americano'],
+];
\ No newline at end of file
index ae721754ae696c767221ffdb1c320cb392258904..3f29093a435e40a64d0df72e36fae86fb40bfd90 100644 (file)
@@ -2,23 +2,24 @@
 config('ROOM_NAME', 'Cuisine');
 config('ROOM', 'cuisine');
 config('SQUEEZEBOX_PLAYER', 'Cuisine');
-config('HIDEMASK_TIMEOUT',250);
+config('HIDEMASK_TIMEOUT', 250);
 
 if (DISPLAYINTERFACE) {
-       $c = cuisine();
+    $c = cuisine();
 
-       $favoriteslights = [
-               ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
-               ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
-       ];
-       $favoriteslights = array_merge($favoriteslights, $c['favorites']);
+    $favoriteslights = [
+        ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+        ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+    ];
+    $favoriteslights = array_merge($favoriteslights, $c['favorites']);
 
-       include "default.php";
+    include "default.php";
 
-       $nav = '<a href="#" data-menu="home"><i class="fa fa-home" aria-hidden="true"></i></a>
+    $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="#" data-menu="remote"><i class="fa fa-play" 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>
     <a href="#" data-action="off"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index 3345396d7e21ec7d85db3c87ede8f2cf859706dd..859ac41cb9ba90f024e30be6a7023a9bbc43de3d 100644 (file)
@@ -24,6 +24,7 @@ $shortcuts['home'] = array_merge([
 ], $favoriteslights, $roomshome);
 
 include ROOT . '/config/settings.php';
+include ROOT . '/config/coffee.php';
 profile('Set settings', __FILE__, __LINE__);
 
 if (hasConfig('SQUEEZEBOX_PLAYER')) {
index 1c5959e641aafec137e3bef9734c3d831b074407..d29cfd04e21f43f92478e84bbe752acae31a7d54 100644 (file)
@@ -22,6 +22,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="#" 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>
     <a href="#" data-action="off"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index 69409935f3ab459742a18e435d822ff5954d94ae..b08a8bf57148a9f5930867cc17fa6868ff02f713 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="#" 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>
     <a href="scripts/off.php" class="ajax"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index e21e0fbd509c024a33398d7025d325a4fb6236e6..431ed3d41ee3b865ccd1522c7d5d83b8e61e35cd 100644 (file)
@@ -20,6 +20,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="#" 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>
     <a href="#" data-action="off"><i class="fa fa-power-off" aria-hidden="true"></i></a>';
index 96f7d04edae77bce2e792126d65b53ac734ee057..9dfa37ec7c3ed8118bb68cffc33cb8182e9b891f 100644 (file)
@@ -4,7 +4,7 @@ if (!raspberry && !iOS) {
     CONFIG.SLEEPTYPE = 'off';
 }
 var defaultSleepTime = CONFIG.SLEEPSCREEN;
-var hideMaskTimeout=parseInt(CONFIG.HIDEMASK_TIMEOUT);
+var hideMaskTimeout = parseInt(CONFIG.HIDEMASK_TIMEOUT);
 var defaultVolume = parseInt(CONFIG.VOLUME);
 if (isNaN(defaultVolume)) {
     defaultVolume = 0;
@@ -97,6 +97,11 @@ $(function () {
         return true;
     });
 
+    $(document).on(clickevent, '.ifttt', function () {
+        $.get('scripts/ifttt.php?event=' + $(this).data('event'));
+        return false;
+    });
+
     $(document).on(clicktouchevent, 'a[data-menu]', function () {
         $("#iframeHolder").hide();
         window.location.hash = "#/section/" + $(this).data('menu');
diff --git a/scripts/ifttt.php b/scripts/ifttt.php
new file mode 100644 (file)
index 0000000..5aceb41
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+require_once "import.php";
+ifttt($_GET['event']);
\ No newline at end of file
diff --git a/scripts/lib/ifttt.php b/scripts/lib/ifttt.php
new file mode 100644 (file)
index 0000000..9117f9f
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+function ifttt($event)
+{
+    httpRequest('https://maker.ifttt.com/trigger/' . $event . '/with/key/5KxVqNj_tXibHw27u7uja');
+}
\ No newline at end of file
index 9e79b5151e9bf5275a3cb53c29ceb6e690ba615f..e58cc6ac12f72187487aa558d18cde77aa1306d8 100644 (file)
@@ -40,6 +40,7 @@ require_once ROOT . '/scripts/lib/medialibrary.php';
 require_once ROOT . '/scripts/lib/heartbeats.php';
 require_once ROOT . '/scripts/lib/ssh.php';
 require_once ROOT . '/scripts/lib/cachemedia.php';
+require_once ROOT . '/scripts/lib/ifttt.php';
 
 
 profile('Loaded libraries', __FILE__, __LINE__);
@@ -292,6 +293,9 @@ function shortcut($s, $hash)
     } else if ($s['type'] == 'harmonyactivity') {
         $attrs['class'] = 'harmonyactivity';
         $attrs['data-activity'] = $s['activity'];
+    } else if ($s['type'] == 'ifttt') {
+        $attrs['class'] = 'ifttt';
+        $attrs['data-event'] = $s['event'];
     }
 
     if (isset($s['seen']) && $s['seen']) {
index dc2436fc96616343271ddfc4a4226414baf7b7c6..0b9e89344bded5cdd2bcb5b647b5f6c8015258f9 100644 (file)
@@ -37,6 +37,7 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
         ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
         ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Matin'],
+        ['type' => 'ifttt', 'event' => 'coffee_on'],
     ],
     'chambre/deshumidificateur/on' => [
         // ['type' => 'insteon', 'command' => '0?1138=I=0=0'],
@@ -466,6 +467,8 @@ $scenes = [
         ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Stop All Sounds'],
         ['type' => 'scene', 'scene' => 'salon/freebox/off'],
         ['type' => 'scene', 'scene' => 'sdb/ampli/off'],
+        ['type' => 'ifttt', 'event' => 'coffee_off'],
+        ['type' => 'ifttt', 'event' => 'oven_off'],
     ],
     'home/welcome' => [
         ['type' => 'ecomode', 'mode' => '0'],
@@ -628,6 +631,8 @@ function execScene($name, $fromUserAction = false, $transitionTime = null)
             domoticzSwitch($action['device'], $action['command'], isset($action['switchtype']) ? $action['switchtype'] : 'light', isset($action['priority']) && $action['priority']);
         } else if ($action['type'] == 'ir') {
             irsend($action['room'], $action['device'], $action['command']);
+        } else if ($action['type'] == 'ifttt') {
+            ifttt($action['event']);
         }
     }
 }
index 88e475acf76a7948977b4bb499041f1f3732ab29..c3768fe50caa5ed8d7d1f9be7149debfb7ed5222 100644 (file)
@@ -63,6 +63,12 @@ header a .fa-tv {
   -webkit-transform-origin: 0 0;
   transform-origin: 0 0;
 }
+header a .fa-coffee {
+  -webkit-transform: scaleX(0.85);
+  transform: scaleX(0.85);
+  -webkit-transform-origin: 0 0;
+  transform-origin: 0 0;
+}
 .fit {
   transform-origin: 0 0;
   -webkit-transform-origin: 0 0;
index 7fff694b27777d060844cab48251f62f43d7b7eb..5039b2d59b5b55732f277e0c89080acb1d30e247 100644 (file)
@@ -74,6 +74,14 @@ header {
       -webkit-transform-origin: 0 0;
       transform-origin: 0 0;
     }
+
+    .fa-coffee {
+      -webkit-transform: scaleX(0.85);
+      transform: scaleX(0.85);
+
+      -webkit-transform-origin: 0 0;
+      transform-origin: 0 0;
+    }
   }
 }