]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sat, 6 Jun 2020 10:02:36 +0000 (12:02 +0200)
committerVincent <vincent@enhydra.fr>
Sat, 6 Jun 2020 10:02:36 +0000 (12:02 +0200)
.idea/workspace.xml
config/sdb.php
scripts/cron/cron.php
scripts/lib/domoticz.php
scripts/lib/flowerpower.php
scripts/lib/lib.php
scripts/lib/weatherstation.php
style/weatherstation.css
style/weatherstation.less

index c3508db15057ef1b4b580e42bbeec823043daa01..8d706cc37ab93c3d80deaa6ea92d98ca35115c4f 100644 (file)
@@ -3,7 +3,14 @@
   <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$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.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/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/flowerpower.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/flowerpower.php" 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/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/weatherstation.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.css" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/weatherstation.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.less" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1553247665857" />
     <property name="dumpAutoload T:/Drive/Works/home/composer.json" value="--no-interaction --ansi --verbose --optimize" />
     <property name="editor.config.ad.shown" value="true" />
-    <property name="last_opened_file_path" value="$USER_HOME$/Works/home2" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../redbr" />
     <property name="list.type.of.created.stylesheet" value="Less" />
     <property name="nodejs_package_manager_path" value="npm" />
     <property name="project.structure.last.edited" value="Problems" />
       <workItem from="1586849664844" duration="183000" />
       <workItem from="1587198086476" duration="111000" />
       <workItem from="1587628693502" duration="622000" />
-      <workItem from="1590315129913" duration="1124000" />
-    </task>
-    <task id="LOCAL-00272" summary=".">
-      <created>1578476755038</created>
-      <option name="number" value="00272" />
-      <option name="presentableId" value="LOCAL-00272" />
-      <option name="project" value="LOCAL" />
-      <updated>1578476755038</updated>
+      <workItem from="1590315129913" duration="3707000" />
+      <workItem from="1590912219927" duration="2795000" />
+      <workItem from="1591437119712" duration="23000" />
+      <workItem from="1591437163856" duration="499000" />
     </task>
     <task id="LOCAL-00273" summary=".">
       <created>1578556621586</created>
       <option name="project" value="LOCAL" />
       <updated>1586519228613</updated>
     </task>
-    <option name="localTasksCounter" value="321" />
+    <task id="LOCAL-00321" summary=".">
+      <created>1590317532388</created>
+      <option name="number" value="00321" />
+      <option name="presentableId" value="LOCAL-00321" />
+      <option name="project" value="LOCAL" />
+      <updated>1590317532388</updated>
+    </task>
+    <option name="localTasksCounter" value="322" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="1511" y="161" key="#Plugins/0.0.2560.1040@0.0.2560.1040" timestamp="1586722473970" />
-    <state x="1019" y="324" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1581415995312">
-      <screen x="0" y="0" width="2560" height="1040" />
-    </state>
-    <state x="1019" y="324" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1040@0.0.2560.1040" timestamp="1581415995312" />
     <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1585852940968">
       <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="1586519189652">
-      <screen x="0" y="0" width="2560" height="1040" />
-    </state>
-    <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="1586519189652" />
-    <state x="92" y="92" width="2376" height="856" key="DiffContextDialog" timestamp="1580377344165">
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1590317522596">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="92" y="92" width="2376" height="856" key="DiffContextDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1580377344165" />
-    <state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1586090325738">
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1590317522596" />
+    <state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="1060" y="275" key="FileChooserDialogImpl/0.0.2560.1040@0.0.2560.1040" timestamp="1586090325738" />
+    <state x="1060" y="275" key="FileChooserDialogImpl/0.0.2560.1040@0.0.2560.1040" timestamp="1590912263817" />
     <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1584290302981">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="1456" y="240" key="com.intellij.ide.util.TipDialog" timestamp="1586418523328">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1582201881167" />
     <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="1587628717476">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <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="1587628717476" />
     <state x="943" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1584289936754">
       <screen x="0" y="0" width="2560" height="1040" />
index 505f20a05763db53ff5a4cf88687dd7782b69ff5..2b7416ef0f6ee0d67d53e65cc99cf9e0027a7d9d 100644 (file)
@@ -9,7 +9,7 @@ config('SCREENSAVER','weatherstation');
 config('VIDEOPLAYER', 'mediarasp-small');
 config('TVPLAYER', 'mediarasp-small');
 config('VOLUME', 60);
-config('VOLUME_DEVICE', 'RaspberryPi');
+config('VOLUME_DEVICE', 'Squeezebox');
 config('HIDEMASK_TIMEOUT',250);
 
 if (DISPLAYINTERFACE) {
index fa6509331ed34cc4c020d21d91f194b26ad51068..e3d4420e20e1621b729870478d3b66d654628b50 100644 (file)
@@ -179,8 +179,12 @@ function cronWeather($cronmin)
     $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true);
     $res['livingroom_temp'] = toNumber(getDomoticzDeviceStatus(1351), 1);
     $res['livingroom_humidity'] = toNumber(getDomoticzDeviceStatus(1352), true);
-    $res['kitchen_temp'] = toNumber(getDomoticzDeviceStatus(1030), 1);
-    $res['kitchen_humidity'] = toNumber(getDomoticzDeviceStatus(1031), true);
+    $res['kitchen_temp'] = toNumber(getDomoticzDeviceStatus(1506), 1);
+    $res['kitchen_humidity'] = toNumber(getDomoticzDeviceStatus(1507), true);
+    $res['wc_temp'] = toNumber(getDomoticzDeviceStatus(1501), 1);
+    $res['wc_humidity'] = toNumber(getDomoticzDeviceStatus(1502), true);
+    $res['office_temp'] = toNumber(getDomoticzDeviceStatus(1496), 1);
+    $res['office_humidity'] = toNumber(getDomoticzDeviceStatus(1497), true);
     $res['pressure'] = round($weather['Pressure']['Metric']['Value']);
     $res['pressureTendency'] = $weather['PressureTendency']['Code'];
     $res['precipitations24'] = round($weather['PrecipitationSummary']['Past24Hours']['Metric']['Value']);
index c3ec15e9b7d6463b96d394ff0bb7fd2e0ee499f8..7ff1e2022f547cf37f6049fe680e8159815fd453 100644 (file)
@@ -42,14 +42,14 @@ function domoticzCmd($command, $priority = false)
     return true;
 }
 
-function getDomoticzDeviceStatus($device)
+function getDomoticzDeviceStatus($device,$force=false)
 {
     $res = runDomoticzCommand(['type' => 'devices', 'rid' => $device]);
     $res = json_decode($res->getBody(), true);
     try {
         $update = new DateTime($res['result'][0]['LastUpdate']);
         $now = new DateTime();
-        if ($update->diff($now)->days > 0) {
+        if (!$force && $update->diff($now)->days > 0) {
             return false;
         }
     } catch (Exception $e) {
index 59ee32cf4739893a074e1d412475d10834994630..a786917c45d6e90a659905b5bb2cba5cf4799c7c 100644 (file)
@@ -8,7 +8,7 @@ function updateFlowerPower()
         $newValue = $fp[$k];
         if ($v === 1467) {
             $newValue = (float)$newValue;
-            $currentValue = toNumber(getDomoticzDeviceStatus(1467), false);
+            $currentValue = toNumber(getDomoticzDeviceStatus(1467, true), false);
             if (abs($currentValue - $newValue) > 30 || $newValue == 0 || $newValue > 60 || $newValue < -50) {
                 echo 'Out of bounds';
                 return;
index 2eb3ef357ff9a542e6fc37bb3b736ce70231bb28..87e291c29d0047318eb458d7072d9d6a5af3a88b 100644 (file)
@@ -432,6 +432,7 @@ function volume($volume, $increase = '')
             $cmd = 'amixer -c 0 -M -- sset PCM playback ' . round(max(0, min(100, $volume))) . '%' . $increase;
             return sshCommand($cmd, $device);
         case 'SqueezeboxPlayer':
+        case 'Squeezebox':
             return squeezeVolume($volume, $increase, config('SQUEEZEBOX_PLAYER'));
         case 'Harmony':
             if ($increase == '-') {
index 4a5b51300c39f3824496fc4e54fff9df94bafa8e..ac74c4c68a056810288cbef5debdea990f104bdc 100644 (file)
@@ -22,11 +22,13 @@ function weatherStationScreenSaver()
     $res .= '<div class="pp">';
     $res .= '<i class="fas fa-cloud-rain"></i> ' . $weather['precipitations24'] . ' mm | <i class="fas fa-tachometer-alt"></i> ' . $pressure . ' hPa <i class="fa fa-arrow-circle-' . $pressureTendency . '"></i> | <i class="fa fa-tint"></i> ' . $weather['outdoor_humidity'] . '%';
     $res .= '<table class="house">';
-    $res .= '<tr class="backyard"><td class="hicon"><i class="fa fa-flower-tulip"></i></td><td>' . $weather['backyard_temp'] . ' °C</td><td class="hicon hum"><i class="fa fa-tint"></i></td><td class="hum">' . $weather['backyard_humidity'] . '%</td></tr>';
-    $res .= '<tr class="livingroom"><td class="hicon"><i class="fa fa-cocktail"></i></td><td>' . $weather['livingroom_temp'] . ' °C</td><td class="hicon hum"><i class="fa fa-tint"></i></td><td class="hum">' . $weather['livingroom_humidity'] . '%</td></tr>';
-    $res .= '<tr class="kitchen"><td class="hicon"><i class="fa fa-knife-kitchen"></i></td><td>' . $weather['kitchen_temp'] . ' °C</td><td class="hicon hum"><i class="fa fa-tint"></i></td><td class="hum">' . $weather['kitchen_humidity'] . '%</td></tr>';
-    $res .= '<tr class="bedroom"><td class="hicon"><i class="fa fa-bed"></i></td><td>' . $weather['bedroom_temp'] . ' °C</td><td class="hicon hum"><i class="fa fa-tint"></i></td><td class="hum">' . $weather['bedroom_humidity'] . '%</td></tr>';
-    $res .= '<tr class="bathroom"><td class="hicon"><i class="fa fa-bath"></i></td><td>' . $weather['bathroom_temp'] . ' °C</td><td class="hicon hum"><i class="fa fa-tint"></i></td><td class="hum">' . $weather['bathroom_humidity'] . '%</td></tr>';
+    $res .= '<tr><td class="hicon backyard"><i class="fa fa-flower-tulip"></i></td><td class="backyard">' . $weather['backyard_temp'] . ' °C</td><td class="hicon hum backyard"><i class="fa fa-tint"></i></td><td class="hum backyard">' . $weather['backyard_humidity'] . '%</td>';
+    $res .= '<td class="sep"></td><td class="hicon kitchen"><i class="fa fa-knife-kitchen"></i></td><td class="kitchen">' . $weather['kitchen_temp'] . ' °C</td><td class="hicon hum kitchen"><i class="fa fa-tint"></i></td><td class="hum kitchen">' . $weather['kitchen_humidity'] . '%</td></tr>';
+    $res .= '<tr><td class="hicon livingroom"><i class="fa fa-cocktail"></i></td><td class="livingroom">' . $weather['livingroom_temp'] . ' °C</td><td class="hicon hum livingroom"><i class="fa fa-tint"></i></td><td class="hum livingroom">' . $weather['livingroom_humidity'] . '%</td>';
+    $res .= '<td class="sep"></td><td class="hicon office"><i class="fa fa-plane"></i></td><td class="office">' . $weather['office_temp'] . ' °C</td><td class="hicon hum office"><i class="fa fa-tint"></i></td><td class="hum office">' . $weather['office_humidity'] . '%</td></tr>';
+    $res .= '<tr><td class="hicon wc"><i class="fa fa-toilet"></i></td><td class="wc">' . $weather['wc_temp'] . ' °C</td><td class="hicon hum wc"><i class="fa fa-tint"></i></td><td class="hum wc">' . $weather['wc_humidity'] . '%</td>';
+    $res .= '<td class="sep"></td><td class="hicon bedroom"><i class="fa fa-bed"></i></td><td class="bedroom">' . $weather['bedroom_temp'] . ' °C</td><td class="hicon hum bedroom"><i class="fa fa-tint"></i></td><td class="hum bedroom">' . $weather['bedroom_humidity'] . '%</td></tr>';
+    $res .= '<tr><td class="hicon bathroom"><i class="fa fa-bath"></i></td><td class="bathroom">' . $weather['bathroom_temp'] . ' °C</td><td class="hicon hum bathroom"><i class="fa fa-tint"></i></td><td class="hum bathroom">' . $weather['bathroom_humidity'] . '%</td></tr>';
     $res .= '</table>';
     $res .= '</div>';
     $res .= '</div>';
index 0a4409c12fd39824082a9a7c603a12d05c77c418..4fd0572c537602802adea05d8a7e1045fc8a1d48 100644 (file)
   display: none;
 }
 #weatherstation .house {
-  width: 40%;
-  margin: 15px auto;
+  width: 60%;
+  margin: 40px auto;
+}
+#weatherstation .house .sep {
+  min-width: 25px;
 }
 #weatherstation .house .backyard {
   color: #009d60;
   color: orangered;
 }
 #weatherstation .house .bathroom {
-  color: #4c9bd2;
+  color: #d03bee;
 }
 #weatherstation .house .kitchen {
   color: #ccc;
 }
+#weatherstation .house .wc {
+  color: #2472aa;
+}
+#weatherstation .house .office {
+  color: #051234;
+}
 #weatherstation .house td {
   vertical-align: bottom;
   text-align: left;
 #weatherstation .house td.hicon {
   width: 0;
   padding-right: 5px;
+  padding-left: 10px;
 }
 #weatherstation .house td.hum {
   font-size: 80%;
+  padding-bottom: 2px;
 }
index eb68907ba4ad27bf544e730017a2ff7d26e099e8..942a72a68e24a80a734cf27826db2808cbe768c0 100644 (file)
   }
 
   .house {
-    width: 40%;
-    margin: 15px auto;
+    width: 60%;
+    margin: 40px auto;
+
+    .sep {
+      min-width: 25px;
+    }
 
     .backyard {
       color: #009d60;
     }
 
     .bathroom {
-      color: #4c9bd2;
+      color: #d03bee;
     }
 
     .kitchen {
       color: #ccc;
     }
 
+    .wc {
+      color: #2472aa;
+    }
+
+    .office {
+      color: #051234;
+    }
+
     td {
       vertical-align: bottom;
       text-align: left;
       &.hicon {
         width: 0;
         padding-right: 5px;
+        padding-left: 10px;
       }
 
       &.hum {
         font-size: 80%;
+        padding-bottom: 2px;
       }
     }
   }