From c2d6255e9f7c2663c0df6c534f7c84b3de724909 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 26 Jul 2024 09:25:41 +0200 Subject: [PATCH] . --- .idea/dataSources.local.xml | 2 +- .idea/workspace.xml | 23 ++++++-- config/bureau.php | 14 +++-- config/litvincent.php | 4 +- config/media.php | 75 ++++++++++++------------ config/rooms.php | 111 ++++++++++++++++++++++++------------ config/switch.php | 2 +- config/tv.php | 24 ++++---- scripts/lib/denon.php | 5 +- scripts/lib/lib.php | 7 ++- scripts/lib/shield.php | 19 +++++- scripts/lib/simplemode.php | 6 ++ scripts/shield.php | 2 + 13 files changed, 185 insertions(+), 109 deletions(-) create mode 100644 scripts/lib/simplemode.php diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index a7db01c..f0de5c5 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9d7ba8e..0ada1b8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,19 @@ - + + + + + + + + + + + + diff --git a/config/bureau.php b/config/bureau.php index 198881a..93e88fc 100644 --- a/config/bureau.php +++ b/config/bureau.php @@ -19,11 +19,15 @@ config('THEME', '#051039'); if (DISPLAYINTERFACE) { $c = bureau(); $shortcuts['lights'] = $c['all']; - $favoriteslights = [ - ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => ''], - ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => ''], - ]; - $favoriteslights = array_merge($favoriteslights, $c['favorites']); + if (!isSimpleMode()) { + $favoriteslights = [ + ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => ''], + ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => ''], + ]; + $favoriteslights = array_merge($favoriteslights, $c['favorites']); + } else { + $favoriteslights = $c['favorites']; + } include_once "remote.php"; include "default.php"; diff --git a/config/litvincent.php b/config/litvincent.php index 2ea7a46..4fd3172 100644 --- a/config/litvincent.php +++ b/config/litvincent.php @@ -14,9 +14,7 @@ config('THEME', '#a62634'); if (DISPLAYINTERFACE) { $additionnalfavorites = [ - ['type' => 'separator', 'label' => 'Réveil'], - ['type' => 'phone', 'phone' => 'vincent', 'task' => 'Réveil 0715', 'label' => 'Réveil 0715', 'screenoff' => 1], - ['type' => 'phone', 'phone' => 'vincent', 'task' => 'Réveil 0815', 'label' => 'Réveil 0815', 'screenoff' => 1] + ]; include "lit.php"; diff --git a/config/media.php b/config/media.php index a8cf654..095f869 100644 --- a/config/media.php +++ b/config/media.php @@ -4,53 +4,50 @@ include 'tv.php'; $media = connectRedis()->igbget('medialibrary'); $device = config('DEVICE'); -$shortcuts['media'] = [['label' => 'TV', 'type' => 'sub', 'sub' => 'tv'], ['label' => 'Ajoutés récemment', 'type' => 'sub', 'sub' => 'mediarecent']]; -$shortcuts['media'][] = ['label' => 'Séries TV', 'type' => 'sub', 'sub' => 'seriestv']; -$shortcuts['media'][] = ['label' => 'Films', 'type' => 'sub', 'sub' => 'movies']; +$shortcuts['media'] = [['label' => 'TV', 'type' => 'sub', 'sub' => 'tv']/*, ['label' => 'Ajoutés récemment', 'type' => 'sub', 'sub' => 'mediarecent']*/]; +//$shortcuts['media'][] = ['label' => 'Séries TV', 'type' => 'sub', 'sub' => 'seriestv']; +//$shortcuts['media'][] = ['label' => 'Films', 'type' => 'sub', 'sub' => 'movies']; if ($device == 'salon' || $device == 'bureau' || $device == 'bureausun') { $shortcuts['media'][] = array('type' => 'netflix', 'url' => 'scripts/netflix.php?id=home', 'label' => ''); $shortcuts['media'][] = array('type' => 'amazonprime', 'url' => 'scripts/shield.php?amazonprime=home', 'label' => ''); - $shortcuts['media'][] = array('type' => 'nintendoswitch', 'url' => 'scripts/switch.php', 'label' => ''); - $shortcuts['media'][] = ['label' => 'Vidéo web', 'type' => 'raspberrycast']; -} -if ($device == 'bureau' || $device == 'bureausun') { - $shortcuts['media'][] = ['label' => '', 'type' => 'ajax', 'url' => '/scripts/switch.php']; + //$shortcuts['media'][] = array('type' => 'nintendoswitch', 'url' => 'scripts/switch.php', 'label' => ''); + //$shortcuts['media'][] = ['label' => 'Vidéo web', 'type' => 'raspberrycast']; } -$tvshows = getTVShows(); -if (is_array($tvshows)) { - $shortcuts['sub-seriestv'] = $tvshows['shortcuts']; - $shortcuts = array_merge($shortcuts, $tvshows['subs']); - profile('Got TV Shows', __FILE__, __LINE__); -} +//$tvshows = getTVShows(); +//if (is_array($tvshows)) { +// $shortcuts['sub-seriestv'] = $tvshows['shortcuts']; +// $shortcuts = array_merge($shortcuts, $tvshows['subs']); +// profile('Got TV Shows', __FILE__, __LINE__); +//} +// +//$movies = getMovies(); +//if (is_array($movies)) { +// $shortcuts['sub-movies'] = $movies['shortcuts']; +// $shortcuts = array_merge($shortcuts, $movies['subs']); +// profile('Got movies', __FILE__, __LINE__); +//} +// +//$recent = getMediaRecentAdded(); +//if (is_array($recent)) { +// $shortcuts['sub-mediarecent'] = $recent['shortcuts']; +// $shortcuts = array_merge($shortcuts, $recent['subs']); +// profile('Got recents', __FILE__, __LINE__); +//} -$movies = getMovies(); -if (is_array($movies)) { - $shortcuts['sub-movies'] = $movies['shortcuts']; - $shortcuts = array_merge($shortcuts, $movies['subs']); - profile('Got movies', __FILE__, __LINE__); -} - -$recent = getMediaRecentAdded(); -if (is_array($recent)) { - $shortcuts['sub-mediarecent'] = $recent['shortcuts']; - $shortcuts = array_merge($shortcuts, $recent['subs']); - profile('Got recents', __FILE__, __LINE__); -} - -if (is_array($media)) { - foreach ($media as $id => $mediagroup) { - if ($id == 'x' && (!isset($_GET['x']) || $_GET['x'] != 'x')) { - continue; - } - $parentId = 'media-' . $id; - $shortcuts['media'][] = array('label' => $mediagroup['name'], 'type' => 'sub', 'sub' => $parentId); - $shortcuts = array_merge($shortcuts, getMediaFolderShortcuts($mediagroup, $parentId)); - } -} +//if (is_array($media)) { +// foreach ($media as $id => $mediagroup) { +// if ($id == 'x' && (!isset($_GET['x']) || $_GET['x'] != 'x')) { +// continue; +// } +// $parentId = 'media-' . $id; +// $shortcuts['media'][] = array('label' => $mediagroup['name'], 'type' => 'sub', 'sub' => $parentId); +// $shortcuts = array_merge($shortcuts, getMediaFolderShortcuts($mediagroup, $parentId)); +// } +//} -$shortcuts['media'][] = ['label' => 'Recharger', 'type' => 'url', 'href' => '/scripts/tmdb.php']; +//$shortcuts['media'][] = ['label' => 'Recharger', 'type' => 'url', 'href' => '/scripts/tmdb.php']; function getMediaFolderShortcuts($mediagroup, $parentId) { diff --git a/config/rooms.php b/config/rooms.php index 030095a..b1e2f30 100644 --- a/config/rooms.php +++ b/config/rooms.php @@ -4,17 +4,24 @@ $rooms = array('home' => 'Maison', 'salon' => 'Salon', 'chambre' => 'Chambre', ' function chambre($additionnalfavorites = array()) { - $favorites = [ - ['type' => 'light', 'scene' => 'home/aulit', 'label' => 'Au lit ☽'], - ['type' => 'light', 'scene' => 'chambre/matin', 'label' => 'Matin ★'], - ['type' => 'light', 'scene' => 'home/aulitoff', 'label' => 'Eteindre ☽'], - ['type' => 'light', 'scene' => 'chambre/bed', 'label' => 'Au lit'], - ['type' => 'light', 'scene' => 'chambre/sleep', 'label' => 'Nuit'], - ['type' => 'light', 'scene' => 'chambre/moon', 'label' => 'Clair de lune'], - ['type' => 'light', 'scene' => 'chambre/full', 'label' => 'Plein feu'], - ['type' => 'light', 'scene' => 'chambre/reading', 'label' => 'Lecture'], - ['type' => 'light', 'scene' => 'chambre/off', 'label' => 'Off'], - ]; + if (isSimpleMode()) { + $favorites = [ + ['type' => 'light', 'scene' => 'chambre/matin', 'label' => 'Matin ★'], + ['type' => 'light', 'scene' => 'chambre/bedoff', 'label' => 'Au lit ☽'], + ]; + } else { + $favorites = [ + ['type' => 'light', 'scene' => 'home/aulit', 'label' => 'Au lit ☽'], + ['type' => 'light', 'scene' => 'chambre/matin', 'label' => 'Matin ★'], + ['type' => 'light', 'scene' => 'home/aulitoff', 'label' => 'Eteindre ☽'], + ['type' => 'light', 'scene' => 'chambre/bed', 'label' => 'Au lit'], + ['type' => 'light', 'scene' => 'chambre/sleep', 'label' => 'Nuit'], + ['type' => 'light', 'scene' => 'chambre/moon', 'label' => 'Clair de lune'], + ['type' => 'light', 'scene' => 'chambre/full', 'label' => 'Plein feu'], + ['type' => 'light', 'scene' => 'chambre/reading', 'label' => 'Lecture'], + ['type' => 'light', 'scene' => 'chambre/off', 'label' => 'Off'], + ]; + } $all = array_merge($favorites, [ ['type' => 'light', 'scene' => 'chambre/boreal', 'label' => 'Matin boréal'], @@ -45,6 +52,18 @@ function lit($additionnalfavorites = array()) function home() { + if (isSimpleMode()) { + $favorites = [ + ['type' => 'light', 'scene' => 'home/welcome', 'label' => 'Bienvenue'], + ['type' => 'light', 'scene' => 'home/off', 'label' => 'éteindre'], + ]; + } else { + $favorites = [ + ['type' => 'light', 'scene' => 'home/welcome/eco', 'label' => 'Bienvenue ðŸŒ¿', 'confirm' => ['message' => 'Quelqu\'un dort peut-être. Veuillez confirmer votre action.', 'conditions' => ['night' => '1']]], + ['type' => 'light', 'scene' => 'home/off', 'label' => 'éteindre'], + ['type' => 'light', 'scene' => 'home/welcome', 'label' => 'Bienvenue â˜…', 'confirm' => ['message' => 'Quelqu\'un dort peut-être. Veuillez confirmer votre action.', 'conditions' => ['night' => '1']]], + ]; + } $favorites = [ ['type' => 'light', 'scene' => 'home/welcome/eco', 'label' => 'Bienvenue ðŸŒ¿', 'confirm' => ['message' => 'Quelqu\'un dort peut-être. Veuillez confirmer votre action.', 'conditions' => ['night' => '1']]], ['type' => 'light', 'scene' => 'home/off', 'label' => 'éteindre'], @@ -58,19 +77,24 @@ function home() function salon() { + $favorites = [ ['type' => 'light', 'scene' => 'salon/auto', 'label' => 'Allumer'], ['type' => 'light', 'scene' => 'salon/off', 'label' => 'éteindre'], - ['type' => 'light', 'scene' => 'salon/day', 'label' => 'journée'], - ['type' => 'light', 'scene' => 'salon/lumineux', 'label' => 'lumineux'], ['type' => 'light', 'scene' => 'salon/cinema', 'label' => 'cinéma'], - ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'], - ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'], - ['type' => 'light', 'scene' => 'salon/lecturenocture', 'label' => 'Lecture nocturne'], - ['type' => 'light', 'scene' => 'salon/cheminee', 'label' => 'Cheminée'], - ['type' => 'light', 'scene' => 'salon/theatre', 'label' => 'Théâtre'], - ['type' => 'light', 'scene' => 'salon/bar/toggle', 'label' => 'Bar'], ]; + + if (!isSimpleMode()) { + $favorites = array_merge($favorites, ['type' => 'light', 'scene' => 'salon/day', 'label' => 'journée'], + ['type' => 'light', 'scene' => 'salon/lumineux', 'label' => 'lumineux'], + ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'], + ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'], + ['type' => 'light', 'scene' => 'salon/lecturenocture', 'label' => 'Lecture nocturne'], + ['type' => 'light', 'scene' => 'salon/cheminee', 'label' => 'Cheminée'], + ['type' => 'light', 'scene' => 'salon/theatre', 'label' => 'Théâtre'], + ['type' => 'light', 'scene' => 'salon/bar/toggle', 'label' => 'Bar'],); + } + $all = array_merge($favorites, [['type' => 'separator', 'label' => 'Projecteur'], ['type' => 'light', 'scene' => 'salon/projector/on', 'label' => 'Allumer'], ['type' => 'light', 'scene' => 'salon/projector/off', 'label' => 'éteindre']]); @@ -83,12 +107,15 @@ function bureau() ['type' => 'light', 'scene' => 'bureau/auto', 'label' => 'Allumer'], ['type' => 'light', 'scene' => 'bureau/off', 'label' => 'éteindre'], ['type' => 'light', 'scene' => 'bureau/cinema', 'label' => 'Cinéma'], - ['type' => 'light', 'scene' => 'bureau/lumineux', 'label' => 'Lumineux'], - ['type' => 'light', 'scene' => 'bureau/lounge', 'label' => 'Lounge'], - ['type' => 'light', 'scene' => 'bureau/tamise', 'label' => 'Tamise'], - ['type' => 'light', 'scene' => 'bureau/veilleuse', 'label' => 'Veilleuse'], ]; + if (!isSimpleMode()) { + $favorites = array_merge($favorites, ['type' => 'light', 'scene' => 'bureau/lumineux', 'label' => 'Lumineux'], + ['type' => 'light', 'scene' => 'bureau/lounge', 'label' => 'Lounge'], + ['type' => 'light', 'scene' => 'bureau/tamise', 'label' => 'Tamise'], + ['type' => 'light', 'scene' => 'bureau/veilleuse', 'label' => 'Veilleuse']); + } + $all = array_merge($favorites, [ ['type' => 'light', 'scene' => 'bureau/boreal', 'label' => 'Aurore boréale'], ['type' => 'light', 'scene' => 'bureau/tchernobyl', 'label' => 'Чорнобиль'], @@ -131,11 +158,14 @@ function cuisine() function sdb() { $favorites = [ - ['type' => 'light', 'scene' => 'sdb/on', 'label' => 'Allumer'], - ['type' => 'light', 'scene' => 'sdb/off', 'label' => 'éteindre'], - ['type' => 'light', 'scene' => 'sdb/spa', 'label' => 'spa'], - ['type' => 'light', 'scene' => 'sdb/nuit', 'label' => 'nuit'], + ]; + if (!isSimpleMode()) { + $favorites = array_merge($favorites, ['type' => 'light', 'scene' => 'sdb/on', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'sdb/off', 'label' => 'éteindre'], + ['type' => 'light', 'scene' => 'sdb/spa', 'label' => 'spa'], + ['type' => 'light', 'scene' => 'sdb/nuit', 'label' => 'nuit'],); + } $all = array_merge($favorites, [ ]); @@ -172,17 +202,22 @@ function wc() function cour() { - $favorites = [ - ['type' => 'light', 'scene' => 'cour/auto', 'label' => 'Allumer'], - ['type' => 'light', 'scene' => 'cour/off', 'label' => 'éteindre'], - ['type' => 'light', 'scene' => 'cour/lumineux', 'label' => 'lumineux'], - ['type' => 'light', 'scene' => 'cour/daylight', 'label' => 'jour'], - ['type' => 'light', 'scene' => 'cour/grow', 'label' => 'croissance'], - ['type' => 'light', 'scene' => 'cour/tropical', 'label' => 'crépuscule tropical'], - ['type' => 'separator', 'label' => 'Projecteurs'], - ['type' => 'light', 'scene' => 'cour/projecteurs/on', 'label' => 'Allumer'], - ['type' => 'light', 'scene' => 'cour/projecteurs/off', 'label' => 'éteindre'], - ]; + $favorites = []; + if (!isSimpleMode()) { + $favorites = [ + ['type' => 'light', 'scene' => 'cour/auto', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'cour/off', 'label' => 'éteindre'], + ['type' => 'light', 'scene' => 'cour/lumineux', 'label' => 'lumineux'], + ['type' => 'light', 'scene' => 'cour/daylight', 'label' => 'jour'], + ['type' => 'light', 'scene' => 'cour/grow', 'label' => 'croissance'], + ['type' => 'light', 'scene' => 'cour/tropical', 'label' => 'crépuscule tropical'], + ['type' => 'separator', 'label' => 'Projecteurs'], + ['type' => 'light', 'scene' => 'cour/projecteurs/on', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'cour/projecteurs/off', 'label' => 'éteindre'], + ]; + } + + $all = array_merge($favorites, [ ]); diff --git a/config/switch.php b/config/switch.php index ffa3738..edee839 100644 --- a/config/switch.php +++ b/config/switch.php @@ -2,7 +2,7 @@ $shortcuts['switch'] = []; $shortcuts['switchshare'] = []; $share = ['salon', 'bureau', 'sdb', 'cuisine', 'chambre']; -$rooms = ['salon' => 'Salon', 'bureau' => 'Bureau', 'entree' => 'Entrée', 'cuisine' => 'Cuisine', 'chambre' => 'Chambre', 'litvincent' => 'Lit Vincent', 'litjerome' => 'Lit Jérôme', 'sdb' => 'Salle de bain', 'cour' => 'Cour', 'balcon' => 'Balcon', 'wc' => 'WC']; +$rooms = ['salon' => 'Salon', 'bureau' => 'Bureau', 'entree' => 'Entrée', 'cuisine' => 'Cuisine', 'chambre' => 'Chambre', 'litvincent' => 'Lit Droite', 'litjerome' => 'Lit Gauche', 'sdb' => 'Salle de bain', 'wc' => 'WC']; foreach ($rooms as $room => $label) { if (config('DEVICE') === $room) { continue; diff --git a/config/tv.php b/config/tv.php index caec7dd..2659870 100644 --- a/config/tv.php +++ b/config/tv.php @@ -46,17 +46,10 @@ foreach ($replays as $name => $replay) { } $tv = array( - 'Connexion MyCanal' => array('freebox' => 'replay', 'shield' => 'mycanal:connect:home'), + //'Connexion MyCanal' => array('freebox' => 'replay', 'shield' => 'mycanal:connect:home'), 'Replay' => array('freebox' => 'replay', 'shield' => 'mycanal:replay:home'), 'Netflix' => array('freebox' => 'netflix', 'shield' => 'netflix:home'), 'Amazon Prime' => array('shield' => 'amazonprime:home'), - 'Infos', - 'France Info' => array('stream' => 'tvheadend:franceinfo:', 'channel' => 27, 'shield' => 'mycanal:live:670', 'logo' => '41072782'), - 'Cnews' => array('stream' => 'tvheadend:CNEWS', 'channel' => 16, 'shield' => 'mycanal:live:480', 'logo' => '64698936'), - 'BFM TV' => array('stream' => 'tvheadend:BFM TV', 'channel' => 15, 'shield' => 'mycanal:live:633', 'logo' => '34766177'), - 'BFM Business' => array('stream' => 'tvheadend:BFM Paris', 'channel' => 347, 'shield' => 'mycanal:live:645', 'logo' => '54239635'), - 'LCI' => array('stream' => 'tvheadend:LCI', 'channel' => 26, 'shield' => 'mycanal:live:553', 'logo' => '66747521'), - 'Euronews' => array('stream' => 'fbx:205:sd', 'channel' => 345, 'shield' => 'mycanal:live:324', 'logo' => '36581437'), 'Généralistes', 'TF1' => array('stream' => 'tvheadend:TF1', 'channel' => 1, 'shield' => 'mycanal:live:312', 'logo' => '66746746'), 'France 2' => array('stream' => 'tvheadend:France 2', 'channel' => 2, 'shield' => 'mycanal:live:26', 'logo' => '67032119'), @@ -82,6 +75,13 @@ $tv = array( 'TV Breizh' => array('shield' => 'mycanal:live:586', 'logo' => '93561480'), '6ter' => array('stream' => 'tvheadend:6ter', 'channel' => 22, 'shield' => 'mycanal:live:521', 'logo' => '16598429'), 'TF1 Séries Films' => array('stream' => 'tvheadend:TF1 Séries Films', 'channel' => 20, 'shield' => 'mycanal:live:526', 'logo' => '66747478'), + 'Infos', + 'France Info' => array('stream' => 'tvheadend:franceinfo:', 'channel' => 27, 'shield' => 'mycanal:live:670', 'logo' => '41072782'), + 'Cnews' => array('stream' => 'tvheadend:CNEWS', 'channel' => 16, 'shield' => 'mycanal:live:480', 'logo' => '64698936'), + 'BFM TV' => array('stream' => 'tvheadend:BFM TV', 'channel' => 15, 'shield' => 'mycanal:live:633', 'logo' => '34766177'), + 'BFM Business' => array('stream' => 'tvheadend:BFM Paris', 'channel' => 347, 'shield' => 'mycanal:live:645', 'logo' => '54239635'), + 'LCI' => array('stream' => 'tvheadend:LCI', 'channel' => 26, 'shield' => 'mycanal:live:553', 'logo' => '66747521'), + 'Euronews' => array('stream' => 'fbx:205:sd', 'channel' => 345, 'shield' => 'mycanal:live:324', 'logo' => '36581437'), 'Monde', 'TV5 Monde' => array('stream' => 'fbx:206:sd', 'channel' => 1, 'shield' => 'mycanal:live:520', 'logo' => '14279265'), 'France 24' => array('stream' => 'tvheadend:France 24', 'channel' => 340, 'shield' => 'mycanal:live:310', 'logo' => '18810794'), @@ -100,7 +100,7 @@ foreach ($tv as $name => $service) { $name = ''; } elseif ($name === 'Netflix') { $name = ''; - }else if($name==='Amazon Prime'){ + } else if ($name === 'Amazon Prime') { $name = ''; } @@ -108,11 +108,13 @@ foreach ($tv as $name => $service) { $shortcuts['sub-tv'][] = array('type' => 'separator', 'label' => $service); } else { if ($tvplayer === 'shield') { - if (isset($service['shield'])) { + if (isset($service['channel'])) { + $shortcuts['sub-tv'][] = array('type' => 'shield', 'url' => 'scripts/shield.php?oqee=' . $service['channel'], 'label' => $name); + } else if (isset($service['shield'])) { $e = explode(':', $service['shield'], 2); if ($name === 'netflix') { $name = ''; - } else if($name==='amazonprime'){ + } else if ($name === 'amazonprime') { $name = ''; } $shortcuts['sub-tv'][] = array('type' => 'shield', 'url' => 'scripts/shield.php?' . $e[0] . '=' . $e[1], 'label' => $name); diff --git a/scripts/lib/denon.php b/scripts/lib/denon.php index b87dca6..5e804c7 100644 --- a/scripts/lib/denon.php +++ b/scripts/lib/denon.php @@ -34,10 +34,13 @@ function denonAVRVolume($volume, $increase = '') function denonAVROn($input = 'Media Player', $force = false) { + $setVolume = false; if ($force || !denonAVRGetPowerState()) { + $setVolume = true; _denonTelnet('ZMON'); } - denonAVRInput($input, true); + + denonAVRInput($input, $setVolume); } function denonAVRInput($input, $setvolume = false) diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index fba0d84..792cd70 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -6,6 +6,7 @@ $endQueue = []; require_once ROOT . '/vendor/autoload.php'; require_once ROOT . "/config/global.php"; require_once ROOT . '/config/rooms.php'; +require_once ROOT . '/scripts/lib/simplemode.php'; require_once ROOT . '/scripts/lib/automodes.php'; require_once ROOT . '/scripts/lib/homeassistant.php'; require_once ROOT . '/scripts/lib/redis.php'; @@ -301,12 +302,12 @@ function shortcut($s, $hash)
de bouchons
'; - } else if($s['type']==='lock'){ + } else if ($s['type'] === 'lock') { $attrs['class'] = $s['type'] . ' info'; $attrs['data-init'] = "0"; $attrs['data-init-function'] = "updateLocks"; - $s['label']='
'; - }elseif ($s['type'] == 'velib') { + $s['label'] = '
'; + } elseif ($s['type'] == 'velib') { $attrs['class'] = $s['type'] . ' info'; $attrs['data-init'] = "0"; $attrs['data-init-function'] = "updateVelib"; diff --git a/scripts/lib/shield.php b/scripts/lib/shield.php index 63dfc8f..aeb2f36 100644 --- a/scripts/lib/shield.php +++ b/scripts/lib/shield.php @@ -155,6 +155,11 @@ function shieldAmazonPrime($id = null, $device = null) shieldLaunchApp('com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity', $device); } +function shieldOqee($channel, $device = null) +{ + shieldLaunchApp('oqee', $device); +} + function shieldRemoteCommand($cmd, $device = null) { shieldKey([$cmd], $device); @@ -189,6 +194,7 @@ function shieldLaunchApp($activity, $device = null) function shieldMyCanalConnect($device = null, $force = false) { + return; $d = getDevice($device); $state = 'mycanallastconnect_' . $d['id']; $limit = time() - 3600 * 24 * 16; @@ -239,8 +245,8 @@ function shieldMyCanal($channel = false, $type = 'live', $device = null) } setPlaying('mycanal', $device); - shieldKill('mycanal', $device); - shieldHome($device); + //shieldKill('mycanal', $device); + //shieldHome($device); return shieldCommand('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.mycanal.legacy.DeepLinkActivity', $device); } @@ -253,6 +259,14 @@ function shieldKodi($file, $device = null) shieldCommand('shell am start', '-a android.intent.action.VIEW -d \'"' . $url . '"\' -n org.xbmc.kodi/.Splash', $device); } +function shielOqee($channel, $device = null) +{ + $url = shieldNormalizeURL('https://oq.ee/channel/' . $channel . '/play'); + shieldRunActivity($device); + shieldKill('oqee', $device); + shieldCommand('shell am start', '-a android.intent.action.VIEW -d \'"' . $url . '"\' -n net.oqee.androidtv.store/net.oqee.androidtv.ui.player.LivePlayerActivity', $device); +} + function shieldNormalizeURL($input) { if (strpos($input, '/nas') === 0) { @@ -315,6 +329,7 @@ function shieldGetApps() 'squeezeplayer' => 'de.bluegaspode.squeezeplayer', 'tortuga' => 'fr.enhydra.tortuga.home', 'amazonprime' => 'com.amazon.amazonvideo.livingroom', + 'oqee' => 'net.oqee.androidtv.store', ]; } diff --git a/scripts/lib/simplemode.php b/scripts/lib/simplemode.php new file mode 100644 index 0000000..2d8444a --- /dev/null +++ b/scripts/lib/simplemode.php @@ -0,0 +1,6 @@ +'; \ No newline at end of file -- 2.39.5