From d508f1853216f3d58f5de75c3e4181ac8624c05e Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 5 Nov 2020 10:34:16 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 32 +++++++++++++++++-------------- config/salon.php | 2 +- scripts/domoticz_device_event.php | 4 ++-- scripts/lib/lib.php | 10 ++++++++-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ca68431..0837234 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,10 @@ - + + + @@ -1294,12 +1298,12 @@ - + - + @@ -1321,11 +1325,11 @@ - + - + diff --git a/config/salon.php b/config/salon.php index 35af00e..8c100ca 100644 --- a/config/salon.php +++ b/config/salon.php @@ -4,7 +4,7 @@ config('ROOM', 'salon'); config('SQUEEZEBOX_PLAYER', 'Salon'); config('VIDEOPLAYER', 'shield'); config('TVPLAYER', 'shield'); -config('VOLUME_DEVICE', 'shield'); +config('VOLUME_DEVICE', 'harmony'); config('VIDEOPLAYER_DEVICE', 'salon'); config('HIDEMASK_TIMEOUT', 250); diff --git a/scripts/domoticz_device_event.php b/scripts/domoticz_device_event.php index a7209f7..2e214d6 100644 --- a/scripts/domoticz_device_event.php +++ b/scripts/domoticz_device_event.php @@ -38,10 +38,10 @@ if ($_GET['device'] == 480) { } break; case 'Clock_Wise': - volume(1,'+'); + volume(3,'+'); break; case 'Anti_Clock_Wise': - volume(1,'-'); + volume(3,'-'); break; case 'Tap': if (getCurrentHarmonyActivity() == 'poweroff') { diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index 1f3477d..0ac29ed 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -444,10 +444,16 @@ function volume($volume, $increase = '') case 'squeezebox': return squeezeVolume($volume, $increase, config('SQUEEZEBOX_PLAYER')); case 'harmony': + $lastHarmonyVolume = getState('last_harmony_volume', 0); + $limit = time() - 2; + if ($lastHarmonyVolume > $limit) { + return; + } + setState('last_harmony_volume', time()); if ($increase == '-') { - return harmonyRequest('commands/volume-down', 'POST'); + return harmonyRequest('commands/volume-down?repeat=5', 'POST'); } else { - return harmonyRequest('commands/volume-up', 'POST'); + return harmonyRequest('commands/volume-up?repeat=4', 'POST'); } case 'vlc': return VLCCmd(['command' => 'volume', 'val' => $increase . '20'], $device); -- 2.39.5