From: Vincent Date: Thu, 9 Jan 2020 07:57:00 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=702365a71ab2d08107c9b1bd48398d331009bc8c;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b29d71b..e47e6d8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,9 @@ - + + + @@ -1177,12 +1180,12 @@ - + - + @@ -1192,17 +1195,17 @@ - + - - + + - + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index 766a6fd..685583a 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -55,7 +55,7 @@ function cronEcoMode($cronmin) if ($cronmin !== 0) { return; } - $ecomode = (int)getState('ecomode'); + $ecomode = (int)getEcoMode(); $scenes = [0 => 'off', 1 => 'on', 2 => 'super']; execScene('ecomode/' . $scenes[$ecomode]); } diff --git a/scripts/ecomode.php b/scripts/ecomode.php index 82aedc9..b6ea01b 100644 --- a/scripts/ecomode.php +++ b/scripts/ecomode.php @@ -9,7 +9,7 @@ if (isset($_GET['action'])) { } ob_end_clean(); -$res = getState('ecomode'); +$res = getEcoMode(); if (!$res && in_array(config('DEVICE'), ['bureau', 'bureausun'])) { $res = getDomoticzDeviceStatus(391) === 'Closed'; } diff --git a/scripts/lib/ecomode.php b/scripts/lib/ecomode.php index ee0d5ab..3836064 100644 --- a/scripts/lib/ecomode.php +++ b/scripts/lib/ecomode.php @@ -4,6 +4,7 @@ function ecoMode($mode) $currentMode = getState('ecomode', '0'); setState('ecomode', $mode); + $mode = getEcoMode(); if ($mode == '2') { execScene('ecomode/super'); } else if ($mode == '1') { @@ -27,4 +28,13 @@ function disableSuperEcoMode() function nightmode($mode) { setState('night', (!!$mode) ? '1' : '0'); +} + +function getEcoMode() +{ + $res = getState('ecomode'); + if ($res == '0' && getState('night') == '1') { + $res = '1'; + } + return $res; } \ No newline at end of file