]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Oct 2023 05:11:07 +0000 (07:11 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Oct 2023 05:11:07 +0000 (07:11 +0200)
.idea/workspace.xml
config/global.php
scripts/backyard.php [deleted file]
scripts/cron/cron.php
scripts/lib/automodes.php

index b6f6bb3fe984eb4217db71ffe6d2e38dc211b8e9..cb46bb8c6f72b1ad1918b6a8f649740edc9e6369 100644 (file)
@@ -5,11 +5,11 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change beforePath="$PROJECT_DIR$/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.local.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/homeassistant.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/homeassistant.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/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/backyard.php" beforeDir="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/automodes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/automodes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1696066442667" duration="1663000" />
       <workItem from="1696084066464" duration="645000" />
       <workItem from="1696152670454" duration="699000" />
-      <workItem from="1697390209410" duration="1520000" />
+      <workItem from="1697390209410" duration="2209000" />
+      <workItem from="1697741970447" duration="2021000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="597" />
+    <option name="localTasksCounter" value="598" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 3eff0d1c09cdc6dce9a99ba982f13140879492da..7c348bd87b346eecc0cd383ee44924be8b82da5d 100644 (file)
@@ -76,7 +76,7 @@ $devices = [
     'entree' => ['id' => 'entree', 'host' => '192.168.13.64', 'user' => 'pi', 'password' => 'atacama'],
     'jarvis' => ['id' => 'jarvis', 'host' => '192.168.13.60', 'user' => 'jarvis', 'password' => 'atacama'],
     'chambre' => ['id' => 'chambre', 'host' => '192.168.13.65', 'user' => 'pi', 'password' => 'atacama'],
-    'salon' => ['id' => 'salon', 'host' => '192.168.13.6', 'shield' => '192.168.13.40', 'user' => 'pi', 'password' => 'atacama'],
+    'salon' => ['id' => 'salon', 'host' => '192.168.13.66', 'shield' => '192.168.13.40', 'user' => 'pi', 'password' => 'atacama'],
     'bureau' => ['id' => 'bureau', 'shield' => '192.168.13.41'],
     'wc' => ['id' => 'wc', 'host' => '192.168.13.67', 'user' => 'pi', 'password' => 'raspberry'],
     'cuisine' => ['id' => 'cuisine', 'host' => '192.168.13.68', 'shield' => '192.168.13.31', 'user' => 'pi', 'password' => 'atacama'],
diff --git a/scripts/backyard.php b/scripts/backyard.php
deleted file mode 100644 (file)
index 7879a0b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-require_once "import.php";
-
-$day=isDay();
-domoticzSwitch(679, $day); // Projecteurs cour
\ No newline at end of file
index 7e547138a3ad41338db0b7e5cb86839588d84247..71b0f0eb7cd31a2ea12463c1705435601394f3e1 100644 (file)
@@ -11,18 +11,24 @@ function cronOneLoop($cronmin) {
        cronHotWater($cronmin);
        cronRooms($cronmin);
        cronWeather($cronmin);
-       cronMagnet($cronmin);
 
-       if ($cronmin % 5 == 0) {
+    if ($cronmin % 10 == 0) {
+        cronSqueezeFavorites($cronmin);
+    }
+    if ($cronmin % 15 == 0) {
+        cronXPlanet($cronmin);
+        cronPodcasts($cronmin);
+        cronMediaLibrary($cronmin);
+        cronTmdb($cronmin);
+    }
 
+       if ($cronmin % 5 == 0) {
                cronTraffic($cronmin, false);
                cronVelib($cronmin);
                cronGuest($cronmin);
                cronShield($cronmin);
        }
-       if ($cronmin % 10 == 0) {
-               cronSqueezeFavorites($cronmin);
-       }
+
        if ($cronmin % 20 == 0) {
                cronBackyard($cronmin);
                cronSqueezeCheckPlayers($cronmin);
@@ -31,20 +37,11 @@ function cronOneLoop($cronmin) {
        if ($cronmin % 2 == 0) {
                cronPing($cronmin);
        }
-       if ($cronmin % 15 == 0) {
-               cronXPlanet($cronmin);
-               cronPodcasts($cronmin);
-               cronMediaLibrary($cronmin);
-               cronTmdb($cronmin);
-       }
+
        cronHarmony($cronmin);
        cronInterface($cronmin);
 
-
        cronEcoMode($cronmin);
-       if ($cronmin % 5 == 0) {
-               cronTranscode($cronmin);
-       }
        if ($cronmin % 15 == 0) {
                cronKodi($cronmin);
        }
@@ -57,10 +54,6 @@ function cronHotWater($cronmin) {
        hotwaterCheckMode();
 }
 
-function cronMagnet($cronmin) {
-       //_logSection('Magnet links');
-       //file_get_contents("https://entree.home.tortuga.enhydra.fr/scripts/freeboxapi.php?action=magnets");
-}
 
 function cronXPlanet($cronmin) {
        _logSection('XPlanet');
@@ -72,10 +65,9 @@ function cronXPlanet($cronmin) {
 }
 
 
-function cronBackyard($cronmin) {
-       _logSection('Backyard');
-       $device = 6898;
-       domoticzSwitch($device, getDomoticzDeviceStatus($device) === 'On');
+function cronBackyard($cronmin)
+{
+    _logSection('Backyard');
 }
 
 function cronShield($cronmin) {
@@ -99,11 +91,6 @@ function cronEcoMode($cronmin) {
        ecoMode(null, $cronmin % 15 === 0);
 }
 
-function cronTranscode($cronmin) {
-       _logSection('Transcode');
-       httpRequest('https://salon.home.tortuga.enhydra.fr/scripts/transcode.php', 'get', [], null, 10, true);
-}
-
 function _logSection($t) {
        echo '------' . $t . ' :: ' . date('Y-m-d H:i:s') . "\n";
 }
@@ -196,7 +183,7 @@ function cronSqueezeCheckPlayers($cronmin) {
        _logSection('Check squeezebox players');
 }
 
-function cronWeather($cronmin) {
+function FGcronWeather($cronmin) {
        _logSection('Weather');
        getWeather();
 }
index 381313270070cec6653534a117fc4bd243aadefe..116578c832c8d99d015ba45d3c63a78111dadd2c 100644 (file)
 <?php
 
-function disableAutoModes($duration) {
-       setState('disable_auto_modes', time() + $duration);
+function disableAutoModes($duration)
+{
+    setState('disable_auto_modes', time() + $duration);
 }
 
-function enableAutoModes() {
-       setState('disable_auto_modes', 0);
+function enableAutoModes()
+{
+    setState('disable_auto_modes', 0);
 }
 
-function isAutoModeEnabled() {
-       return getState('disable_auto_modes', 0) < time();
+function isAutoModeEnabled()
+{
+    return getState('disable_auto_modes', 0) < time();
 }
 
 
-function autoRooms() {
-       if (isAutoModeEnabled()) {
-               if (getState('bureauAutoMode') == '1') {
-                       updateBureauAuto();
-               }
-               if (getState('chambreAutoMode') == '1') {
-                       updateChambreAuto();
-               }
-               if (getState('courAutoMode') == '1') {
-                       updateCourAuto();
-               }
-               if (getState('salonAutoMode') == '1') {
-                       updateSalonAuto();
-               }
-               updateCuisine();
-       }
-       checkPlanetarium();
-       checkWCVMC();
+function autoRooms()
+{
+    if (isAutoModeEnabled()) {
+        if (getState('bureauAutoMode') == '1') {
+            updateBureauAuto();
+        }
+        if (getState('chambreAutoMode') == '1') {
+            updateChambreAuto();
+        }
+        if (getState('courAutoMode') == '1') {
+            updateCourAuto();
+        }
+        if (getState('salonAutoMode') == '1') {
+            updateSalonAuto();
+        }
+        updateCuisine();
+    }
+    checkPlanetarium();
+    checkWCVMC();
 }
 
-function updateBureauAuto() {
-       if(!isAutoModeEnabled()){
-               return;
-       }
-       if (getState('bureauOff') == '1') {
-               execScene('bureau/off');
-               return;
-       }
-       if (getState('bureauAutoMode') != '1') {
-               return;
-       }
-       $hours = intval(date('H'));
-       if ($hours <= 4) {
-               $scene = 'outrun';
-       } else if ($hours <= 9) {
-               $scene = 'boreal';
-       } else if ($hours <= 11) {
-               $scene = 'tonic';
-       } else if ($hours <= 14) {
-               $scene = 'flowers';
-       } else if ($hours <= 18) {
-               $scene = 'beach';
-       } else if ($hours <= 22) {
-               $scene = 'tropical';
-       } else {
-               $scene = 'outrun';
-       }
-       execScene('bureau/' . $scene);
+function updateBureauAuto()
+{
+    if (!isAutoModeEnabled()) {
+        return;
+    }
+    if (getState('bureauOff') == '1') {
+        execScene('bureau/off');
+        return;
+    }
+    if (getState('bureauAutoMode') != '1') {
+        return;
+    }
+    $hours = intval(date('H'));
+    if ($hours <= 4) {
+        $scene = 'outrun';
+    } else if ($hours <= 9) {
+        $scene = 'boreal';
+    } else if ($hours <= 11) {
+        $scene = 'tonic';
+    } else if ($hours <= 14) {
+        $scene = 'flowers';
+    } else if ($hours <= 18) {
+        $scene = 'beach';
+    } else if ($hours <= 22) {
+        $scene = 'tropical';
+    } else {
+        $scene = 'outrun';
+    }
+    execScene('bureau/' . $scene);
 }
 
-function updateCuisine() {
-       if(!isAutoModeEnabled()){
-               return;
-       }
-       $salon = getState('salon', 'off');
-       if ($salon === 'day' || $salon === 'on' || $salon === 'off' || $salon === 'tamise') {
-               execScene('cuisine/base/on');
-       } else if ($salon == 'cinema') {
-               execScene('cuisine/tamise');
-       }
+function updateCuisine()
+{
+    if (!isAutoModeEnabled()) {
+        return;
+    }
+    $salon = getState('salon', 'off');
+    if ($salon === 'day' || $salon === 'on' || $salon === 'off' || $salon === 'tamise') {
+        execScene('cuisine/base/on');
+    } else if ($salon == 'cinema') {
+        execScene('cuisine/tamise');
+    }
 }
 
-function updateCourAuto() {
-       if(!isAutoModeEnabled()){
-               return;
-       }
-       $h = date('H');
-       if ($h >= 7) {
-               execScene('cour/projecteurs/off');
-       } else {
-               execScene('cour/projecteurs/on');
-       }
-       if (getState('courOff') == '1') {
-               execScene('cour/off');
-               return;
-       }
-       if (getState('courAutoMode') != '1') {
-               return;
-       }
-       if (isDay()) {
-               $scene = 'daylight';
-       } else {
-               $scene = 'lumineux';
-       }
-       execScene('cour/' . $scene);
+function updateCourAuto()
+{
+    if (!isAutoModeEnabled()) {
+        return;
+    }
+    $h = date('H');
+    if ($h >= 7 && $h <= 22) {
+        execScene('cour/projecteurs/off');
+    } else {
+        execScene('cour/projecteurs/on');
+    }
+    if (getState('courOff') == '1') {
+        execScene('cour/off');
+        return;
+    }
+    if (getState('courAutoMode') != '1') {
+        return;
+    }
+    if (isDay()) {
+        $scene = 'daylight';
+    } else {
+        $scene = 'lumineux';
+    }
+    execScene('cour/' . $scene);
 }
 
-function salonAuto($on = true) {
-       if ($on) {
-               setState('salonOff', '0');
-               setState('salonAutoMode', '1');
-               updateSalonAuto();
-       } else if (getState('salonAutoMode') === '1') {
-               setState('salonAutoMode', '0');
-       }
+function salonAuto($on = true)
+{
+    if ($on) {
+        setState('salonOff', '0');
+        setState('salonAutoMode', '1');
+        updateSalonAuto();
+    } else if (getState('salonAutoMode') === '1') {
+        setState('salonAutoMode', '0');
+    }
 }
 
-function chambreAuto($on = true, $transitionTime = null) {
-       if ($on) {
-               ecoMode(0);
-               setState('chambreAutoMode', '1');
-               updateChambreAuto($transitionTime);
-       } else if (getState('chambreAutoMode') === '1') {
-               setState('chambreAutoMode', '0');
-       }
+function chambreAuto($on = true, $transitionTime = null)
+{
+    if ($on) {
+        ecoMode(0);
+        setState('chambreAutoMode', '1');
+        updateChambreAuto($transitionTime);
+    } else if (getState('chambreAutoMode') === '1') {
+        setState('chambreAutoMode', '0');
+    }
 }
 
-function bureauAuto($on = true) {
-       if ($on) {
-               setState('bureauAutoMode', '1');
-               updateBureauAuto();
-       } else {
-               setState('bureauAutoMode', '0');
-       }
+function bureauAuto($on = true)
+{
+    if ($on) {
+        setState('bureauAutoMode', '1');
+        updateBureauAuto();
+    } else {
+        setState('bureauAutoMode', '0');
+    }
 }
 
-function courAuto($on = true) {
-       if ($on) {
-               setState('courAutoMode', '1');
-               updateCourAuto();
-       } else {
-               setState('courAutoMode', '0');
-       }
+function courAuto($on = true)
+{
+    if ($on) {
+        setState('courAutoMode', '1');
+        updateCourAuto();
+    } else {
+        setState('courAutoMode', '0');
+    }
 }
 
-function updateSalonAuto() {
-       if(!isAutoModeEnabled()){
-               return;
-       }
-       if (getState('salonOff') == '1') {
-               execScene('salon/off');
-               return;
-       }
-       if (getState('salonAutoMode') != '1') {
-               return;
-       }
-       $d = date('w');
-       $hours = intval(date('H'));
-       if ($d < 5) {
-               if ($hours <= 9) {
-                       $scene = 'tamise';
-               } else if ($hours <= 22) {
-                       $scene = 'day';
-               } else {
-                       $scene = 'tamise';
-               }
-       } else {
-               if ($hours <= 9) {
-                       $scene = 'tamise';
-               } else {
-                       $scene = 'day';
-               }
-       }
-       execScene('salon/' . $scene, false);
+function updateSalonAuto()
+{
+    if (!isAutoModeEnabled()) {
+        return;
+    }
+    if (getState('salonOff') == '1') {
+        execScene('salon/off');
+        return;
+    }
+    if (getState('salonAutoMode') != '1') {
+        return;
+    }
+    $d = date('w');
+    $hours = intval(date('H'));
+    if ($d < 5) {
+        if ($hours <= 9) {
+            $scene = 'tamise';
+        } else if ($hours <= 22) {
+            $scene = 'day';
+        } else {
+            $scene = 'tamise';
+        }
+    } else {
+        if ($hours <= 9) {
+            $scene = 'tamise';
+        } else {
+            $scene = 'day';
+        }
+    }
+    execScene('salon/' . $scene, false);
 }
 
-function updateChambreAuto($transitionTime = null) {
-       if(!isAutoModeEnabled()){
-               return;
-       }
-       if (getState('chambreOff') == '1') {
-               execScene('chambre/off');
-               return;
-       }
-       if (getState('chambreAutoMode') != '1') {
-               return;
-       }
-       $hours = intval(date('H'));
-       if ($hours <= 4) {
-               $scene = 'party';
-       } else if ($hours <= 9) {
-               $scene = 'boreal';
-       } else if ($hours <= 11) {
-               $scene = 'tonic';
-       } else if ($hours <= 14) {
-               $scene = 'flowers';
-       } else if ($hours <= 18) {
-               $scene = 'beach';
-       } else if ($hours <= 22) {
-               $scene = 'tropical';
-       } else {
-               $scene = 'party';
-       }
-       execScene('chambre/' . $scene, false, $transitionTime);
+function updateChambreAuto($transitionTime = null)
+{
+    if (!isAutoModeEnabled()) {
+        return;
+    }
+    if (getState('chambreOff') == '1') {
+        execScene('chambre/off');
+        return;
+    }
+    if (getState('chambreAutoMode') != '1') {
+        return;
+    }
+    $hours = intval(date('H'));
+    if ($hours <= 4) {
+        $scene = 'party';
+    } else if ($hours <= 9) {
+        $scene = 'boreal';
+    } else if ($hours <= 11) {
+        $scene = 'tonic';
+    } else if ($hours <= 14) {
+        $scene = 'flowers';
+    } else if ($hours <= 18) {
+        $scene = 'beach';
+    } else if ($hours <= 22) {
+        $scene = 'tropical';
+    } else {
+        $scene = 'party';
+    }
+    execScene('chambre/' . $scene, false, $transitionTime);
 }