From: Vincent Vanwaelscappel Date: Mon, 23 Oct 2023 05:11:07 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b22ba51ed21a2c9ab9154efb68954bf796ac7586;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b6f6bb3..cb46bb8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,11 +5,11 @@ - - - - + + + + diff --git a/config/global.php b/config/global.php index 3eff0d1..7c348bd 100644 --- a/config/global.php +++ b/config/global.php @@ -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 index 7879a0b..0000000 --- a/scripts/backyard.php +++ /dev/null @@ -1,5 +0,0 @@ -= 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); }