From 1bc8fb37a1070fe65a0963f35b078923d8d28f7a Mon Sep 17 00:00:00 2001 From: neumann <> Date: Fri, 9 Jun 2017 05:22:09 +0000 Subject: [PATCH] 37_Spotify: added volume reading git-svn-id: https://svn.fhem.de/fhem/trunk@14483 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/37_Spotify.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fhem/FHEM/37_Spotify.pm b/fhem/FHEM/37_Spotify.pm index be3a84f6a..a687319fe 100644 --- a/fhem/FHEM/37_Spotify.pm +++ b/fhem/FHEM/37_Spotify.pm @@ -807,6 +807,7 @@ sub Spotify_dispatch($$$) { if($device->{is_active}) { Spotify_saveDevice($hash, $device, "device_active", 0); + readingsBulkUpdateIfChanged($hash, 'volume', $device->{volume_percent}); $hash->{helper}{device_active} = $device; # found active device } @@ -855,6 +856,7 @@ sub Spotify_dispatch($$$) { if($hash->{helper}{is_active}) { my $device = $json->{device}; $hash->{helper}{device_active} = $device; + readingsBulkUpdateIfChanged($hash, 'volume', $device->{volume_percent}); Spotify_saveDevice($hash, $device, "device_active", 0); } else { delete $hash->{helper}{device_active};