From a5d2b431bad6a751b3881ddc598a9cd00b70c81b Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 30 Dec 2020 23:44:38 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 41 +++++++++++++++++++------------------ scripts/lib/flowerpower.php | 5 +---- scripts/lib/squeezebox.php | 1 - servers/logcat.php | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e1288fa..6b47c14 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,11 +3,9 @@ - - + - - + diff --git a/scripts/lib/flowerpower.php b/scripts/lib/flowerpower.php index 719dd8c..e13e8e1 100644 --- a/scripts/lib/flowerpower.php +++ b/scripts/lib/flowerpower.php @@ -2,11 +2,8 @@ function updateFlowerPower() { $device = getState('device_bureausun_awake') ? 'bureausun' : 'cerveau'; - echo $device . "\n"; - $res = sshRunCommand('/usr/local/bin/flowerpower', $device, true, true); - print_r($res); + $res = sshRunCommand('timeout -k 10 1m /usr/local/bin/flowerpower', $device, true, true); $fp = explode("\n", $res['output']); - print_r($fp); $map = [1 => 1467, 0 => 1468]; foreach ($map as $k => $v) { $newValue = $fp[$k]; diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index 4fbdcde..fb7b1f6 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -201,7 +201,6 @@ function getSqueezeFavorites($root = 0, $app = 'favorites', $level = 0) if (is_array($loop)) { if ($app == 'podcasts' && $level != 0 && count(explode('.', $loop[0]['id'])) <= 2) { - echo "Lost root \n"; return getSqueezeFavorites(0, $app, 0); } diff --git a/servers/logcat.php b/servers/logcat.php index 90344a0..f61b5dd 100644 --- a/servers/logcat.php +++ b/servers/logcat.php @@ -26,7 +26,7 @@ $cases = [ if (getState($state, '0') == '1') { setState($state, '0'); } else { - if (getSqueezePlayerStatus($squeezePlayer) === 0) { + if (getSqueezePlayerStatus($squeezePlayer) <= 0) { shieldRunActivity($device); } else { execScene('bureau/sound/on'); -- 2.39.5