From 1ebe66fd2707b8ded5f7d528fcc7e824d5550472 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 30 Dec 2020 23:48:13 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 21 ++++++++++----------- scripts/lib/lib.php | 4 ++-- servers/logcat.php | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6b47c14..e57d132 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,7 @@ - - + diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index cb9fb41..37d0b7e 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -434,9 +434,9 @@ function ping($ip, $timeout = 5, $port = 1817) return $res; } -function volume($volume, $increase = '') +function volume($volume, $increase = '', $device = null) { - $d = config('VOLUME_DEVICE'); + $d = $device === null ? config('VOLUME_DEVICE') : $device; if ($increase == ' ') { $increase = '+'; diff --git a/servers/logcat.php b/servers/logcat.php index f61b5dd..1fd6428 100644 --- a/servers/logcat.php +++ b/servers/logcat.php @@ -36,13 +36,13 @@ $cases = [ 'WindowManager: handleComboKeys keyCode: 25, keyAction: 1' => function () use ($device) { if ($device === 'salon') { echo 'volume-down' . "\n"; - harmonyRequest('commands/volume-down?repeat=5', 'POST'); + volume('3', '-', 'harmony'); } }, 'WindowManager: handleComboKeys keyCode: 24, keyAction: 1' => function () use ($device) { if ($device === 'salon') { echo 'volume-up' . "\n"; - harmonyRequest('commands/volume-up?repeat=4', 'POST'); + volume('3', '+', 'harmony'); } } ]; -- 2.39.5