Handle Squeezebox issues (#5566)

* Handle Squeezebox issues

* Fix double logging
This commit is contained in:
John Mihalic 2017-01-26 18:30:42 -05:00 committed by Adam Mills
parent 36e47473c5
commit fb49c588e5

View File

@ -182,7 +182,7 @@ class SqueezeBoxDevice(MediaPlayerDevice):
@property
def state(self):
"""Return the state of the device."""
if 'power' in self._status and self._status['power'] == '0':
if 'power' in self._status and self._status['power'] == 0:
return STATE_OFF
if 'mode' in self._status:
if self._status['mode'] == 'pause':
@ -213,8 +213,16 @@ class SqueezeBoxDevice(MediaPlayerDevice):
"status", "-", "1", "tags:{tags}"
.format(tags=tags))
if response is False:
return
self._status = response.copy()
try:
self._status.update(response["playlist_loop"][0])
except KeyError:
pass
try:
self._status = response.copy()
self._status.update(response["remoteMeta"])
except KeyError:
pass