Correct retrieval of spotify shuffle state (#7505)
Returned on the current playback response itself, not the devicepull/7514/head
parent
5cb3382425
commit
b34c58386c
|
@ -176,6 +176,7 @@ class SpotifyMediaPlayer(MediaPlayerDevice):
|
||||||
self._state = STATE_PAUSED
|
self._state = STATE_PAUSED
|
||||||
if current.get('is_playing'):
|
if current.get('is_playing'):
|
||||||
self._state = STATE_PLAYING
|
self._state = STATE_PLAYING
|
||||||
|
self._shuffle = current.get('shuffle_state')
|
||||||
device = current.get('device')
|
device = current.get('device')
|
||||||
if device is None:
|
if device is None:
|
||||||
self._state = STATE_IDLE
|
self._state = STATE_IDLE
|
||||||
|
@ -184,8 +185,6 @@ class SpotifyMediaPlayer(MediaPlayerDevice):
|
||||||
self._volume = device.get('volume_percent') / 100
|
self._volume = device.get('volume_percent') / 100
|
||||||
if device.get('name'):
|
if device.get('name'):
|
||||||
self._current_device = device.get('name')
|
self._current_device = device.get('name')
|
||||||
if device.get('shuffle_state'):
|
|
||||||
self._shuffle = device.get('shuffle_state')
|
|
||||||
|
|
||||||
def set_volume_level(self, volume):
|
def set_volume_level(self, volume):
|
||||||
"""Set the volume level."""
|
"""Set the volume level."""
|
||||||
|
|
Loading…
Reference in New Issue