]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Thu, 12 Mar 2020 08:33:19 +0000 (09:33 +0100)
committerVincent <vincent@enhydra.fr>
Thu, 12 Mar 2020 08:33:19 +0000 (09:33 +0100)
.idea/workspace.xml
config/media.php
js/home.js
scripts/cron/cron.php

index adc8bbeac823709a13d7595fc391208af2531f44..112c468b613db565ecace9a287bf13223821d93b 100644 (file)
@@ -3,8 +3,9 @@
   <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/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$/config/media.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/media.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/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1583062693000" duration="3344000" />
       <workItem from="1583265992507" duration="1990000" />
       <workItem from="1583403852883" duration="5927000" />
-      <workItem from="1583566881341" duration="2690000" />
-    </task>
-    <task id="LOCAL-00264" summary=".">
-      <created>1578040654852</created>
-      <option name="number" value="00264" />
-      <option name="presentableId" value="LOCAL-00264" />
-      <option name="project" value="LOCAL" />
-      <updated>1578040654852</updated>
+      <workItem from="1583566881341" duration="3483000" />
+      <workItem from="1583911211830" duration="1508000" />
+      <workItem from="1584000517438" duration="1448000" />
     </task>
     <task id="LOCAL-00265" summary=".">
       <created>1578040991600</created>
       <option name="project" value="LOCAL" />
       <updated>1583567632871</updated>
     </task>
-    <option name="localTasksCounter" value="313" />
+    <task id="LOCAL-00313" summary=".">
+      <created>1583689851384</created>
+      <option name="number" value="00313" />
+      <option name="presentableId" value="LOCAL-00313" />
+      <option name="project" value="LOCAL" />
+      <updated>1583689851384</updated>
+    </task>
+    <option name="localTasksCounter" value="314" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     </state>
     <state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
     <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1583062669525" />
-    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1583567625532">
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1584001971846">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
     <state x="701" y="127" width="1170" height="972" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1582220569877" />
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1583567625532" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1584001971846" />
     <state x="92" y="92" width="2376" height="856" key="DiffContextDialog" timestamp="1580377344165">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     </state>
     <state x="836" y="443" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577363498855" />
     <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1578038647334" />
-    <state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1582798634411">
+    <state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1583689982170">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1582798634411" />
-    <state x="980" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1583566899074">
+    <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1583689982170" />
+    <state x="980" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1584000517418">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
     <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1582201881167" />
-    <state x="980" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1583566899074" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1583567783060">
+    <state x="980" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1584000517418" />
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1583911655372">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
     <state x="733" y="287" width="607" height="598" key="find.popup/0.0.1920.1160@0.0.1920.1160" timestamp="1582125776502" />
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1583567783060" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1583911655372" />
     <state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index c7f5e513b1c2cd1aa4e3a77860ee5765fe0d0073..59b75bb2fc7c827e934707621e2ece47e4fb7033 100644 (file)
@@ -39,7 +39,7 @@ if (is_array($recent)) {
 
 if (is_array($media)) {
     foreach ($media as $id => $mediagroup) {
-        if ($id == 'x' && !isset($_GET['x'])) {
+        if ($id == 'x' && (!isset($_GET['x']) || $_GET['x'] != 'x')) {
             continue;
         }
         $parentId = 'media-' . $id;
index 02b361b45c7a626bca2f6369083aedd256f0cb44..d377fc915f2c4c109a878374890cb24deffdde62 100644 (file)
@@ -158,7 +158,7 @@ $(function () {
     });
 
     $(document).on(clickevent, '.info.time', function () {
-        window.location.reload(true);
+        window.location = '/';
         return false;
     });
 
@@ -287,6 +287,21 @@ $(function () {
 
     });
 
+    mc.on('press', function (e) {
+        var target;
+        if ($(e.target).is('.time.info')) {
+            target = $(e.target);
+        } else if ($(e.target).find('.time.info').length > 0) {
+            target = $(e.target).find('.time.info');
+        } else if ($(e.target).closest('.time.info').length > 0) {
+            target = $(e.target).closest('.time.info');
+        } else {
+            return true;
+        }
+        window.location = '/?x=x';
+    });
+
+
     $(document).on('click', '*', function () {
         if ($(this).data('masknextclick') === true) {
             $(this).data('masknextclick', false);
index e5047a98661a3bd6cf566bd28b9c287c7ce63227..657fdd3d6a01e1edf6b6e4b0f7d0d70e503f08f5 100644 (file)
@@ -31,6 +31,7 @@ function cronOneLoop($cronmin)
     if ($cronmin % 15 == 0) {
         cronXPlanet($cronmin);
         cronPodcasts($cronmin);
+        cronFlowerPower($cronmin);
     }
     if ($cronmin == 0) {
         cronEcoMode($cronmin);
@@ -88,6 +89,15 @@ function cronBackyard($cronmin)
     domoticzSwitch(679, isDay()); // Projecteurs cour
 }
 
+function cronFlowerPower($cronmin)
+{
+    $fp = explode("\n", trim(`sudo /usr/local/bin/flowerpower`));
+    $map = [2 => 1467, 0 => 1468];
+    foreach ($map as $k => $v) {
+        domoticzCmd(['param' => 'udevice', 'idx' => $v, 'nvalue' => 0, 'svalue' => $fp[$k]]);
+    }
+}
+
 function cronMediaLibrary($cronmin)
 {
     global $directories;
@@ -167,14 +177,11 @@ function cronWeather($cronmin)
         copy('http://dataservice.accuweather.com/currentconditions/v1/' . $place . '?apikey=' . $apikey . '&language=fr-FR&details=true', $cache);
     }
 
-    $fp = explode("\n", trim(file_get_contents(ROOT . '/cache/flowerpower.txt')));
-    $outdoortemp = $fp[2];
-
     $res = [];
     $weather = json_decode(file_get_contents($cache), true);
     $weather = $weather[0];
     $res['temp'] = round(($weather['Temperature']['Metric']['Value']/* + getState('airtemperature')*/));
-    $res['outdoor_temp'] = toNumber($outdoortemp, 1);
+    $res['outdoor_temp'] = toNumber(getDomoticzDeviceStatus(1467), 1);
     $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true);
     $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true);
     $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(1025), 1);
@@ -349,7 +356,7 @@ function cronHeartbeat($cronmin)
     if ($cronmin % 5 != 0) {
         return;
     }
-    $devices = ['entree', 'sdb', 'litvincent', 'litjerome', 'bureausun','chambre'];
+    $devices = ['entree', 'sdb', 'litvincent', 'litjerome', 'bureausun', 'chambre'];
     foreach ($devices as $device) {
         if (isAlive($device) === 0) {
             sshCommand('/bin/echo "/usr/local/bin/tortugahome" | /usr/bin/at now', $device, false);