From 93b76ba019c48520a5789257a84f178e057ab281 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 22 Jan 2022 15:15:05 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 28 ++++++++++++++++++---------- config/cuisine.php | 3 ++- config/sdb.php | 3 ++- config/water.php | 8 ++++++++ scripts/hotwater.php | 5 +++++ scripts/lib/lib.php | 3 ++- scripts/lib/profile.php | 7 ++++++- scripts/lib/scenes.php | 18 ++++++++++++++---- scripts/lib/switchbot.php | 33 +++++++++++++++++++++++---------- scripts/lib/tmdb.php | 2 ++ 10 files changed, 82 insertions(+), 28 deletions(-) create mode 100644 config/water.php create mode 100644 scripts/hotwater.php diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5b83614..bcbaa9a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,16 @@ - + + + + + + + + diff --git a/config/cuisine.php b/config/cuisine.php index 4018be0..84a5ca2 100644 --- a/config/cuisine.php +++ b/config/cuisine.php @@ -21,6 +21,7 @@ if (DISPLAYINTERFACE) { $favoriteslights = array_merge($favoriteslights, $c['favorites']); include "default.php"; + include "water.php"; - $nav=['home','lights','music','remote','coffee','switch','settings','alert','off']; + $nav=['home','lights','water','music','remote','coffee','switch','settings','alert','off']; } \ No newline at end of file diff --git a/config/sdb.php b/config/sdb.php index 2de3cce..37139fe 100644 --- a/config/sdb.php +++ b/config/sdb.php @@ -17,7 +17,7 @@ config('THEME', '#92475c'); if (DISPLAYINTERFACE) { $c = sdb(); $shortcuts['lights'] = $c['all']; - $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off']; + $nav = ['home', 'lights','water', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off']; include_once ROOT . '/config/music.php'; @@ -27,6 +27,7 @@ if (DISPLAYINTERFACE) { ]; $favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50)); $favoriteslights = array_merge($favoriteslights, $c['favorites']); + include "water.php"; include "media.php"; include "default.php"; } \ No newline at end of file diff --git a/config/water.php b/config/water.php new file mode 100644 index 0000000..e1f1761 --- /dev/null +++ b/config/water.php @@ -0,0 +1,8 @@ + 'light', 'scene' => 'sdb/hotwater/eco', 'label' => 'Eco'], + ['type' => 'light', 'scene' => 'sdb/hotwater/max', 'label' => 'Max'], + ['type' => 'light', 'scene' => 'sdb/hotwater/off', 'label' => 'Off'], + +]; \ No newline at end of file diff --git a/scripts/hotwater.php b/scripts/hotwater.php new file mode 100644 index 0000000..58667ea --- /dev/null +++ b/scripts/hotwater.php @@ -0,0 +1,5 @@ + '
Musique & Radio
', 'media' => '
Medias & TV
', 'coffee' => '
Cuisine / Café
', + 'water' => '
Eau chaude
', 'fan' => 'Ventilateur', 'remote' => '
Télécommande
', 'switch' => '
Changer de pièce
', diff --git a/scripts/lib/profile.php b/scripts/lib/profile.php index d1084dd..bccbf10 100644 --- a/scripts/lib/profile.php +++ b/scripts/lib/profile.php @@ -1,4 +1,9 @@ [ ['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true], ], + 'sdb/hotwater/eco' => [ + ['type' => 'function', 'function' => 'hotwater', 'args' => ['1']], + ], + 'sdb/hotwater/max' => [ + ['type' => 'function', 'function' => 'hotwater', 'args' => ['2']], + ], + 'sdb/hotwater/off' => [ + ['type' => 'function', 'function' => 'hotwater', 'args' => ['0']], + ], 'sdb/off' => [ ['type' => 'state', 'key' => 'sdb', 'value' => 0], ['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true], @@ -1185,11 +1194,12 @@ function updateBureauAuto() execScene('bureau/' . $scene); } -function updateCuisine(){ - $salon=getState('salon','off'); - if($salon==='on' || $salon==='off' || $salon==='tamise'){ +function updateCuisine() +{ + $salon = getState('salon', 'off'); + if ($salon === 'on' || $salon === 'off' || $salon === 'tamise') { execScene('cuisine/on'); - }else if($salon=='cinema'){ + } else if ($salon == 'cinema') { execScene('cuisine/tamise'); } } diff --git a/scripts/lib/switchbot.php b/scripts/lib/switchbot.php index 0a4bdba..34e61e2 100644 --- a/scripts/lib/switchbot.php +++ b/scripts/lib/switchbot.php @@ -1,22 +1,35 @@ $tvShow['data']['name'], 'type' => 'netflix', 'url' => '/scripts/netflix.php?id=' . $e[1], 'poster' => $this->_poster($tvShow['data']['poster_path'])]; -- 2.39.5