mirror of
https://github.com/home-assistant/core
synced 2024-08-31 05:57:13 +02:00
Fix mpd shuffle/random status (#19308)
* Fix shuffle/random status MPD always shows true for shuffle. For some reason casting the 0 or 1 as a boolean does not work. Now returns 'true' or 'false' based on the value of 'random'. * Update homeassistant/components/media_player/mpd.py Change to correct way of returning shuffle boolean. 'random' needs to be cast as an integer before being cast as a boolean. Co-Authored-By: apetrycki <34962392+apetrycki@users.noreply.github.com> * Remove incorrect string code Original fix method returns a string instead of a boolean. Removed in favor of MartinHjelmare's method.
This commit is contained in:
parent
22acc03fb8
commit
cd0da4ed0e
@ -319,7 +319,7 @@ class MpdDevice(MediaPlayerDevice):
|
||||
@property
|
||||
def shuffle(self):
|
||||
"""Boolean if shuffle is enabled."""
|
||||
return bool(self._status['random'])
|
||||
return bool(int(self._status['random']))
|
||||
|
||||
def set_shuffle(self, shuffle):
|
||||
"""Enable/disable shuffle mode."""
|
||||
|
Loading…
Reference in New Issue
Block a user