37_Spotify: specify default device by its name

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14446 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
neumann 2017-06-01 21:25:52 +00:00
parent af49ac9313
commit 6aaec593c4
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- feature: 37_Spotify: specify default device by its name
- feature: 98_alarmclock: New feature stop Alarm - feature: 98_alarmclock: New feature stop Alarm
- bugfix: 98_DOIFtools: fixed empty N_timer - bugfix: 98_DOIFtools: fixed empty N_timer
- bugfix: 37_Spotify: fixed offset playContextByURI - bugfix: 37_Spotify: fixed offset playContextByURI

View File

@ -670,7 +670,7 @@ sub Spotify_getTargetDeviceID($$$) { # resolve target device settings
} }
# no specific device given by user for this command # no specific device given by user for this command
return $attr{$name}{defaultPlaybackDeviceID} if(defined $attr{$name}{defaultPlaybackDeviceID} # use default device or active device return Spotify_getTargetDeviceID($hash, $attr{$name}{defaultPlaybackDeviceID}, $newPlayback) if(defined $attr{$name}{defaultPlaybackDeviceID} # use default device or active device
&& ( && (
( (
defined $attr{$name}{alwaysStartOnDefaultDevice} defined $attr{$name}{alwaysStartOnDefaultDevice}
@ -679,6 +679,7 @@ sub Spotify_getTargetDeviceID($$$) { # resolve target device settings
) )
|| !defined $hash->{helper}{device_active}{id} || !defined $hash->{helper}{device_active}{id}
) )
&& $attr{$name}{defaultPlaybackDeviceID} ne $device_id
); );
# no default or active device available # no default or active device available
@ -1113,7 +1114,7 @@ sub Spotify_isDisabled($) {
</li> </li>
<li> <li>
<i>defaultPlaybackDeviceID</i><br> <i>defaultPlaybackDeviceID</i><br>
the prefered device by its id<br> the prefered device by its id or device name<br>
</li> </li>
<li> <li>
<i>disable</i><br> <i>disable</i><br>
@ -1282,7 +1283,7 @@ sub Spotify_isDisabled($) {
</li> </li>
<li> <li>
<i>defaultPlaybackDeviceID</i><br> <i>defaultPlaybackDeviceID</i><br>
das Standard-Gerät nach ID<br> das Standard-Gerät durch Angabe der Geräte-ID oder des Geräte-Namens<br>
</li> </li>
<li> <li>
<i>disable</i><br> <i>disable</i><br>