Use state variable from mpchc (#59341)

This commit is contained in:
infeeeee 2021-12-04 14:47:49 +01:00 committed by GitHub
parent b79b35abb5
commit c44eaca533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,13 +106,13 @@ class MpcHcDevice(MediaPlayerEntity):
@property @property
def state(self): def state(self):
"""Return the state of the device.""" """Return the state of the device."""
state = self._player_variables.get("statestring", None) state = self._player_variables.get("state", None)
if state is None: if state is None:
return STATE_OFF return STATE_OFF
if state == "playing": if state == "2":
return STATE_PLAYING return STATE_PLAYING
if state == "paused": if state == "1":
return STATE_PAUSED return STATE_PAUSED
return STATE_IDLE return STATE_IDLE