Mark Yamaha media player as unavailable when unresponsive (#85018)

This commit is contained in:
Anders 2023-01-06 13:03:02 +01:00 committed by GitHub
parent d9be9fe6d5
commit 4b178e88a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,8 +217,10 @@ class YamahaDevice(MediaPlayerEntity):
self._play_status = self.receiver.play_status()
except requests.exceptions.ConnectionError:
_LOGGER.info("Receiver is offline: %s", self._name)
self._attr_available = False
return
self._attr_available = True
if self.receiver.on:
if self._play_status is None:
self._attr_state = MediaPlayerState.ON