mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Handle Squeezebox issues (#5566)
* Handle Squeezebox issues * Fix double logging
This commit is contained in:
parent
36e47473c5
commit
fb49c588e5
@ -182,7 +182,7 @@ class SqueezeBoxDevice(MediaPlayerDevice):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state of the device."""
|
"""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
|
return STATE_OFF
|
||||||
if 'mode' in self._status:
|
if 'mode' in self._status:
|
||||||
if self._status['mode'] == 'pause':
|
if self._status['mode'] == 'pause':
|
||||||
@ -213,8 +213,16 @@ class SqueezeBoxDevice(MediaPlayerDevice):
|
|||||||
"status", "-", "1", "tags:{tags}"
|
"status", "-", "1", "tags:{tags}"
|
||||||
.format(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:
|
try:
|
||||||
self._status = response.copy()
|
|
||||||
self._status.update(response["remoteMeta"])
|
self._status.update(response["remoteMeta"])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user