From 4427b6a9cdcdd926cdbcb3ed953f7d3ded64f41c Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 24 Aug 2019 01:40:09 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 25 +++++++++++++------------ index.php | 6 ++++-- scripts/lib/scenes.php | 4 +++- scripts/lib/squeezebox.php | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 397d972..8065092 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,9 +3,9 @@ - - - + + + diff --git a/index.php b/index.php index 2fc4769..c03df47 100644 --- a/index.php +++ b/index.php @@ -8,8 +8,10 @@ require_once "scripts/import.php"; init(); profile('init index', __FILE__, __LINE__); -$raspberry = $_SERVER['HTTP_USER_AGENT'] == 'Tortuga Raspberry'; -$android = !!stristr($_SERVER['HTTP_USER_AGENT'], 'android'); +$ua = $_SERVER['HTTP_USER_AGENT'] ?? 'CLI'; + +$raspberry = $ua == 'Tortuga Raspberry'; +$android = !!stristr($ua, 'android'); function relativePath($p) { diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 0b9e893..070c1f9 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -736,7 +736,9 @@ function killCheminee($room) { // Kill current animation $kill = "/bin/kill $(ps aux | grep '[c]heminee_running/" . $room . "' | awk '{print $2}')"; - return `$kill`; + $res = `$kill`; + echo 'Kill cheminée ' . $room . ' :: ' . $res; + return $res; } function chemineeLight($lightId, $room, $program = 'fire', $brightness = 1) diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index 537fe71..83273dc 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -29,7 +29,7 @@ function stopSqueezebox($player) } } -function squeezeRequest($params, $player) +function squeezeRequest($params, $player = '') { $redis = connectRedis(); $queue_name = 'squeezebox_queue'; -- 2.39.5