From 27bbd9707429e4e77690a853deda998995032935 Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 15 Apr 2022 12:40:03 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 22 +++++++++------------- scripts/lib/scenes.php | 17 ++++++++--------- scripts/lib/velib.php | 2 +- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d6a18af..c738bef 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,10 +3,6 @@ - - - - @@ -1067,14 +1063,7 @@ - - - - 1619641979806 - 1619777485542 @@ -1412,7 +1401,14 @@ - diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 0477645..bcb9665 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -231,7 +231,7 @@ $scenes = [ 'chambre/off/exceptcheminee' => [ ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], ['type' => 'state', 'key' => 'chambre', 'value' => 0], - ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false, 'brightness' => 0)], + ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false)], // ['type' => 'insteon', 'command' => '0?1332=I=0=0'], ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true], ], @@ -595,8 +595,8 @@ $scenes = [ ['type' => 'domoticz', 'scene' => 42, 'command' => false, 'priority' => true], ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'], - ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false, 'brightness' => 0)], - ['type' => 'hue', 'light' => 23, 'scene' => array('on' => false, 'brightness' => 0)], + ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false)], + ['type' => 'hue', 'light' => 23, 'scene' => array('on' => false)], ], 'bureau/off' => [ ['type' => 'scene', 'scene' => 'bureau/base/off'], @@ -684,7 +684,7 @@ $scenes = [ ['type' => 'ecomode', 'mode' => '0'], ], 'home/hueoff' => [ - ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'brightness' => 0, 'effect' => 'none']], + ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'effect' => 'none']], ], 'wc/on' => [ ['type' => 'function', 'function' => 'wcOn'], @@ -714,7 +714,7 @@ $scenes = [ ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nuit d\'été', $squeezeboxPlayers['WC'], 100, false]], ], 'wc/off' => [ - ['type' => 'hue', 'group' => $wc, 'scene' => ['on' => false, 'brightness' => 0, 'effect' => 'none']], + ['type' => 'hue', 'group' => $wc, 'scene' => ['on' => false, 'effect' => 'none']], ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['WC'], false]], ['type' => 'state', 'key' => 'wc', 'value' => 0], ['type' => 'function', 'function' => 'wcVMCOff'], @@ -797,7 +797,7 @@ $scenes = [ ], 'cuisine/off' => [ ['type' => 'scene', 'scene' => 'cuisine/hotte/off'], - //['type' => 'hue', 'group' => $cuisine, 'scene' => array('on' => false, 'brightness' => 0)] + //['type' => 'hue', 'group' => $cuisine, 'scene' => array('on' => false)] ], 'cuisine/toaster/toggle' => [ ['type' => 'domoticz', 'device' => '1453', 'command' => 'Toggle', 'priority' => true], @@ -895,11 +895,10 @@ function execScene($name, $fromUserAction = false, $transitionTime = null) $autoRooms = ['bureau', 'chambre', 'salon', 'cour']; - if (in_array($e[0], $autoRooms)) { + if (in_array($e[0], $autoRooms) && count($e) == 2) { setState($e[0] . 'Off', $e[1] === 'off' ? '1' : '0'); - if ($fromUserAction && $e[1] !== 'auto' && count($e) == 2) { + if ($fromUserAction && $e[1] !== 'auto') { call_user_func($e[0] . 'Auto', false); - } } diff --git a/scripts/lib/velib.php b/scripts/lib/velib.php index ecf66ba..8d1d41d 100644 --- a/scripts/lib/velib.php +++ b/scripts/lib/velib.php @@ -5,7 +5,7 @@ function velibStations() `curl 'https://www.velib-metropole.fr/webapi/map/details?gpsTopLatitude=51&gpsTopLongitude=4&gpsBotLatitude=48&gpsBotLongitude=1&zoomLevel=11' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0' --output $cache`; $alldata = json_decode(file_get_contents($cache), true); - $stations = ['Cadet' => 9101, 'Bleue' => 9113, 'Folies bergères' => 9011, 9009, 'Le Pelletier' => 9014]; + $stations = ['Cadet' => '9101', 'Bleue' => '9113', 'Folies bergères' => '9011', '9009', 'Le Pelletier' => '9014']; $res = array(); foreach ($alldata as $n => $s) { if (!in_array($s['station']['code'], $stations)) { -- 2.39.5