37_Spotify: added volume reading
git-svn-id: https://svn.fhem.de/fhem/trunk@14483 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user