mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix unhandled exception which creates many useless logs (#17508)
* Fix unhandled exception which creates many useless logs * recover old component logic, sorry * remove inline conditional
This commit is contained in:
parent
9c52a3ce22
commit
764ea06795
@ -92,9 +92,12 @@ class HorizonDevice(MediaPlayerDevice):
|
||||
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
|
||||
def update(self):
|
||||
"""Update State using the media server running on the Horizon."""
|
||||
if self._client.is_powered_on():
|
||||
self._state = STATE_PLAYING
|
||||
else:
|
||||
try:
|
||||
if self._client.is_powered_on():
|
||||
self._state = STATE_PLAYING
|
||||
else:
|
||||
self._state = STATE_OFF
|
||||
except OSError:
|
||||
self._state = STATE_OFF
|
||||
|
||||
def turn_on(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user