From: Vincent Date: Wed, 11 Nov 2020 11:26:05 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=41430b13b9362e61b7c373aacd7fd300c1f14efc;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 88d979b..eb44c63 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,86 +2,20 @@ - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1375,12 +1309,12 @@ - - + + - + diff --git a/config/balcon.php b/config/balcon.php index 9baf5c3..2f0f066 100644 --- a/config/balcon.php +++ b/config/balcon.php @@ -4,17 +4,12 @@ config('ROOM', 'balcon'); config('SQUEEZEBOX_PLAYER', 'Salon'); config('VOLUME', 60); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); -config('HIDEMASK_TIMEOUT',250); +config('HIDEMASK_TIMEOUT', 250); if (DISPLAYINTERFACE) { $c = balcon(); $shortcuts['lights'] = $c['all']; - $nav = ' - - - - - '; + $nav = ['home', 'lights', 'switch', 'settings', 'alert', 'off']; $favoriteslights = [ diff --git a/config/bureau.php b/config/bureau.php index 2d73465..7c4ed5d 100644 --- a/config/bureau.php +++ b/config/bureau.php @@ -28,13 +28,5 @@ if (DISPLAYINTERFACE) { include "default.php"; include ROOT . "/config/media.php"; - $nav = ' - - - - - - - - '; + $nav=['home','lights','music','media','remote','switch','settings','alert','off']; } diff --git a/config/chambre.php b/config/chambre.php index c5f7d60..3979316 100644 --- a/config/chambre.php +++ b/config/chambre.php @@ -1,15 +1,15 @@ - - - - - - - - '; + $nav = ['home', 'lights', 'music', 'fan', 'remote', 'coffee', 'switch', 'settings', 'alert', 'off']; } \ No newline at end of file diff --git a/config/cour.php b/config/cour.php index b9126d8..a8500e7 100644 --- a/config/cour.php +++ b/config/cour.php @@ -4,17 +4,12 @@ config('ROOM', 'cour'); config('SQUEEZEBOX_PLAYER', 'Cuisine'); config('VOLUME', 60); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); -config('HIDEMASK_TIMEOUT',250); +config('HIDEMASK_TIMEOUT', 250); if (DISPLAYINTERFACE) { $c = cour(); $shortcuts['lights'] = $c['all']; - $nav = ' - - - - - '; + $nav = ['home', 'lights', 'switch', 'settings', 'alert', 'off']; $favoriteslights = [ ]; diff --git a/config/cuisine.php b/config/cuisine.php index 8cb9cff..fbf095a 100644 --- a/config/cuisine.php +++ b/config/cuisine.php @@ -16,13 +16,5 @@ if (DISPLAYINTERFACE) { include "default.php"; - $nav = ' - - - - - - - - '; + $nav=['home','lights','music','remote','coffee','switch','settings','alert','off']; } \ No newline at end of file diff --git a/config/entree.php b/config/entree.php index d505cec..ac769c4 100644 --- a/config/entree.php +++ b/config/entree.php @@ -19,14 +19,7 @@ if (DISPLAYINTERFACE) { $favoriteslights = $c['favorites']; array_splice($favoriteslights, 2, 0, [['type' => 'velib'], ['type' => 'traffic']]); - $nav = ' - - - - - - - '; + $nav=['home','lights','music','coffee','switch','settings','alert','off']; include "default.php"; } diff --git a/config/lit.php b/config/lit.php index e4dbc53..ddad250 100644 --- a/config/lit.php +++ b/config/lit.php @@ -14,16 +14,7 @@ if (DISPLAYINTERFACE) { $shortcuts['lights'] = $c['all']; $favoriteslights = $c['favorites']; - $nav = ' - - - - - - - - - '; + $nav=['home','lights','music','media','coffee','switch','settings','alert','off']; include "media.php"; include "default.php"; diff --git a/config/litvincent.php b/config/litvincent.php index fe2cfe2..d78278f 100644 --- a/config/litvincent.php +++ b/config/litvincent.php @@ -19,16 +19,7 @@ if (DISPLAYINTERFACE) { include "lit.php"; - $nav = ' - - - - - - - - - '; + $nav = ['home', 'lights', 'clock', 'music', 'switch', 'settings', 'alert', 'off']; $shortcuts['clock'] = [ ['type' => 'phone', 'phone' => 'vincent', 'task' => 'Va Au Lit', 'label' => 'Lit'], diff --git a/config/salon.php b/config/salon.php index e079e85..a9f8a78 100644 --- a/config/salon.php +++ b/config/salon.php @@ -21,15 +21,5 @@ if (DISPLAYINTERFACE) { include "default.php"; include ROOT . "/config/media.php"; - $nav = ' - - - - - - - - - - '; + $nav=['home','lights','music','media','remote','switch','settings','alert','off']; } diff --git a/config/sdb.php b/config/sdb.php index 4fd0ba2..6380330 100644 --- a/config/sdb.php +++ b/config/sdb.php @@ -15,16 +15,7 @@ config('HIDEMASK_TIMEOUT',250); if (DISPLAYINTERFACE) { $c = sdb(); $shortcuts['lights'] = $c['all']; - $nav = ' - - - - - - - - - '; + $nav=['home','lights','music','media','remote','coffee','switch','settings','alert','off']; include_once ROOT . '/config/music.php'; diff --git a/config/wc.php b/config/wc.php index eb7522c..7f21df8 100644 --- a/config/wc.php +++ b/config/wc.php @@ -9,14 +9,7 @@ config('HIDEMASK_TIMEOUT',250); if (DISPLAYINTERFACE) { $c = wc(); $shortcuts['lights'] = $c['all']; - $nav = ' - - - - - - - '; + $nav=['home','lights','music','remote','switch','settings','alert','off']; include_once ROOT . '/config/music.php'; diff --git a/index.php b/index.php index b71fbe3..ff6719f 100644 --- a/index.php +++ b/index.php @@ -72,7 +72,7 @@ function relativePath($p)
- +
diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index 9086e89..ff46a1b 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -560,4 +560,34 @@ function toNumber($val, $round = false) $val = round($val, $round === true ? 0 : $round); } return $val; -} \ No newline at end of file +} + +function makeNav($nav) +{ + if (is_string($nav)) { + return $nav; + } + + $map = [ + 'home' => '', + 'lights' => '', + 'music' => '', + 'media' => '', + 'coffee' => '', + 'fan' => '', + 'remote' => '', + 'switch' => '', + 'clock' => '', + 'settings' => '', + 'alert' => '', + 'off' => '', + ]; + + $res = ''; + foreach ($nav as $item) { + if (isset($map[$item])) { + $res .= $map[$item]; + } + } + return $res; +}