mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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:
parent
c1832018e3
commit
1bc8fb37a1
@ -807,6 +807,7 @@ sub Spotify_dispatch($$$) {
|
|||||||
|
|
||||||
if($device->{is_active}) {
|
if($device->{is_active}) {
|
||||||
Spotify_saveDevice($hash, $device, "device_active", 0);
|
Spotify_saveDevice($hash, $device, "device_active", 0);
|
||||||
|
readingsBulkUpdateIfChanged($hash, 'volume', $device->{volume_percent});
|
||||||
$hash->{helper}{device_active} = $device; # found active device
|
$hash->{helper}{device_active} = $device; # found active device
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,6 +856,7 @@ sub Spotify_dispatch($$$) {
|
|||||||
if($hash->{helper}{is_active}) {
|
if($hash->{helper}{is_active}) {
|
||||||
my $device = $json->{device};
|
my $device = $json->{device};
|
||||||
$hash->{helper}{device_active} = $device;
|
$hash->{helper}{device_active} = $device;
|
||||||
|
readingsBulkUpdateIfChanged($hash, 'volume', $device->{volume_percent});
|
||||||
Spotify_saveDevice($hash, $device, "device_active", 0);
|
Spotify_saveDevice($hash, $device, "device_active", 0);
|
||||||
} else {
|
} else {
|
||||||
delete $hash->{helper}{device_active};
|
delete $hash->{helper}{device_active};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user