]> _ Git - tortuga-home.git/commitdiff
.
authorvincent <vincent@enhydra.fr>
Sun, 9 Jan 2022 11:15:46 +0000 (12:15 +0100)
committervincent <vincent@enhydra.fr>
Sun, 9 Jan 2022 11:15:46 +0000 (12:15 +0100)
.idea/workspace.xml
install.md
scripts/ecomode.php
scripts/lib/ecomode.php
tools/xplanet/xplanet-earth
tools/xplanet/xplanet-suncurve

index f3c0c15415245928288aa7c30e71f3b36313b2b5..dba61a5a69070c0ed4a770189c85cc5192ad3570 100644 (file)
@@ -3,12 +3,11 @@
   <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/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.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/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.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/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/servers/logcat.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcat.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/install.md" beforeDir="false" afterPath="$PROJECT_DIR$/install.md" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/ecomode.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/ecomode.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tools/xplanet/xplanet-earth" beforeDir="false" afterPath="$PROJECT_DIR$/tools/xplanet/xplanet-earth" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tools/xplanet/xplanet-suncurve" beforeDir="false" afterPath="$PROJECT_DIR$/tools/xplanet/xplanet-suncurve" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1640778900839" duration="879000" />
       <workItem from="1640787196827" duration="2522000" />
       <workItem from="1641573994164" duration="2000" />
-      <workItem from="1641574032847" duration="1662000" />
-    </task>
-    <task id="LOCAL-00452" summary=".">
-      <created>1613738341286</created>
-      <option name="number" value="00452" />
-      <option name="presentableId" value="LOCAL-00452" />
-      <option name="project" value="LOCAL" />
-      <updated>1613738341287</updated>
+      <workItem from="1641574032847" duration="3254000" />
     </task>
     <task id="LOCAL-00453" summary=".">
       <created>1613816554456</created>
       <option name="project" value="LOCAL" />
       <updated>1640788248690</updated>
     </task>
-    <option name="localTasksCounter" value="501" />
+    <task id="LOCAL-00501" summary=".">
+      <created>1641578230504</created>
+      <option name="number" value="00501" />
+      <option name="presentableId" value="LOCAL-00501" />
+      <option name="project" value="LOCAL" />
+      <updated>1641578230506</updated>
+    </task>
+    <option name="localTasksCounter" value="502" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index dd8c8167d90c3cfaae04f71d1e84e33cf71215ce..aaf2cbf97cc68902201ce74bafa37186367c4b3e 100644 (file)
@@ -1,6 +1,6 @@
 `sudo add-apt-repository ppa:ondrej/php;sudo add-apt-repository ppa:ondrej/apache2;sudo apt-get update`
 
-`apt update;apt install composer python3-certbot-apache wakeonlan adb lynx at redis php7.4-fpm php7.4-opcache php7.4-json php7.4-xml php7.4-curl php7.4-redis php7.4-igbinary php7.4-ssh2 php7.4-soap php7.4-sockets php7.4-mysql php7.4-gd php7.4-exif php7.4-imap php7.4-mbstring `
+`apt update;apt install composer python3-certbot-apache wakeonlan adb lynx at redis php7.4-fpm php7.4-opcache php7.4-json php7.4-xml php7.4-curl php7.4-redis php7.4-igbinary php7.4-ssh2 php7.4-soap php7.4-sockets php7.4-mysql php7.4-gd php7.4-exif php7.4-imap php7.4-mbstring xplanet`
 
 `useradd --gid www-data --shell /bin/bash tortugahome`
 `mkdir -p /var/log/tortugahome/profiles/;chown -R tortugahome:www-data /var/log/tortugahome`
index ead63bf5e816218cde4b80a670c635a132acaeeb..7719e7189fcbad79882e3b25773dcf32f43ef949 100644 (file)
@@ -15,8 +15,6 @@ ob_end_clean();
 
 $res = getEcoMode();
 
-if (!$res && in_array(config('DEVICE'), ['bureau', 'bureausun'])) {
-    $res = getDomoticzDeviceStatus(391) === 'Closed' ? '1' : '0';
-}
+
 
 die($res);
index a6fa4837bcd082e6684129a1cc4cc5b959d1a5b4..cf914dcb92a5b84251af2c06a6a42f5aeddeb68e 100644 (file)
@@ -10,7 +10,7 @@ function ecoMode($mode = null, $force = false)
     if (!$force && $mode == $currentMode) {
         return;
     }
-    echo 'switch eco mode :: force ('.$force.') :: (' . $mode . ') :: former (' . $currentMode . ')' . "\n";
+    echo 'switch eco mode :: force (' . $force . ') :: (' . $mode . ') :: former (' . $currentMode . ')' . "\n";
     setState('triggeredEcomode', $mode);
 
     $scenes = [0 => 'off', 1 => 'on', 2 => 'super'];
@@ -32,18 +32,43 @@ function nightmode($mode)
 
 function getNightMode()
 {
-    if(config('DEVICE')==='sdb'){
-        $h=date('G');
-        if($h>6 && $h<21){
+    $device = config('DEVICE');
+    if ($device === 'sdb') {
+        $h = date('G');
+        if ($h > 6 && $h < 21) {
             return false;
         }
     }
+    if ($device === 'salon') {
+        if (getState('salon') !== 'off') {
+            return false;
+        }
+    }
+    if ($device === 'bureau' || $device === 'bureausun') {
+        if (getDomoticzDeviceStatus(391) === 'Closed') {
+            return true;
+        }
+        if (getState('bureau_gradient') !== 'off') {
+            return false;
+        }
+    }
+    if ($device === 'entree' || $device === 'cuisine') {
+        $lights = [15, 18, 1, 58, 59, 57, 56, 55, 37];
+        $hueLights = getHueInstance()->getLights();
+        foreach ($lights as $l) {
+            $light = $hueLights[$l];
+            if ($light->isReachable() && $light->isOn()) {
+                return false;
+            }
+        }
+
+    }
     return getState('night') == '1';
 }
 
 function getEcoMode()
 {
-    $res = getState('ecomode','0');
+    $res = getState('ecomode', '0');
     if ($res == '0' && getNightMode()) {
         $res = '1';
     }
index 6c3928451732aeb99d21a72863c63e2ce424c4d8..a731fb24a228fdfc3c04026eb24c557b1b642e13 100644 (file)
@@ -1,4 +1,4 @@
 #!/bin/sh
 month=$(date +%m)
-ln -sf "/var/www/home/tools/xplanet/world.topo.bathy.2004$month.3x5400x2700.png" "/var/www/home/tools/xplanet/earth.png"
-xplanet -config /var/www/home/tools/xplanet/config -longitude 2.3343236 -latitude 36 -geometry 300x300 -num_times 1 -output /var/www/home/images/earth.png
\ No newline at end of file
+ln -sf "/home/tortugahome/www/tools/xplanet/world.topo.bathy.2004$month.3x5400x2700.png" "/home/tortugahome/www/tools/xplanet/earth.png"
+xplanet -config /home/tortugahome/www/tools/xplanet/config -longitude 2.3343236 -latitude 36 -geometry 300x300 -num_times 1 -output /home/tortugahome/www/images/earth.png
\ No newline at end of file
index 2661e43b43f866271fad877817247d5cf790ae39..0241cb3e8185ee723ffa34486c58338c881a2cd5 100644 (file)
@@ -1,4 +1,4 @@
 #!/bin/sh
 month=$(date +%m)
-ln -sf "/var/www/home/tools/xplanet/world.topo.bathy.2004$month.3x5400x2700.png" "/var/www/home/tools/xplanet/earth.png"
-xplanet -config /var/www/home/tools/xplanet/config -longitude 2.3343236 -geometry 1600x1200 -projection rectangular -num_times 1 -output /var/www/home/images/suncurve.png
\ No newline at end of file
+ln -sf "/home/tortugahome/www/tools/xplanet/world.topo.bathy.2004$month.3x5400x2700.png" "/home/tortugahome/www/tools/xplanet/earth.png"
+xplanet -config /home/tortugahome/www/tools/xplanet/config -longitude 2.3343236 -geometry 1600x1200 -projection rectangular -num_times 1 -output /home/tortugahome/www/images/suncurve.png
\ No newline at end of file