cmus remove IO from properties (#6030)

This commit is contained in:
Adam Mills 2017-02-15 22:13:25 -05:00 committed by Paulus Schoutsen
parent 4addcccfac
commit eb9400de4c

View File

@ -90,11 +90,9 @@ class CmusDevice(MediaPlayerDevice):
@property @property
def state(self): def state(self):
"""Return the media state.""" """Return the media state."""
if 'status' not in self.status: if self.status.get('status') == 'playing':
self.update()
if self.status['status'] == 'playing':
return STATE_PLAYING return STATE_PLAYING
elif self.status['status'] == 'paused': elif self.status.get('status') == 'paused':
return STATE_PAUSED return STATE_PAUSED
else: else:
return STATE_OFF return STATE_OFF