mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix kodi log spamming again (#69137)
* Fix kodi log spamming again * use try except else
This commit is contained in:
parent
c3354dcaae
commit
963ed74797
@ -448,7 +448,8 @@ class KodiEntity(MediaPlayerEntity):
|
|||||||
self._connect_error = True
|
self._connect_error = True
|
||||||
_LOGGER.warning("Unable to connect to Kodi via websocket")
|
_LOGGER.warning("Unable to connect to Kodi via websocket")
|
||||||
await self._clear_connection(False)
|
await self._clear_connection(False)
|
||||||
self._connect_error = False
|
else:
|
||||||
|
self._connect_error = False
|
||||||
|
|
||||||
async def _ping(self):
|
async def _ping(self):
|
||||||
try:
|
try:
|
||||||
@ -458,7 +459,8 @@ class KodiEntity(MediaPlayerEntity):
|
|||||||
self._connect_error = True
|
self._connect_error = True
|
||||||
_LOGGER.warning("Unable to ping Kodi via websocket")
|
_LOGGER.warning("Unable to ping Kodi via websocket")
|
||||||
await self._clear_connection()
|
await self._clear_connection()
|
||||||
self._connect_error = False
|
else:
|
||||||
|
self._connect_error = False
|
||||||
|
|
||||||
async def _async_connect_websocket_if_disconnected(self, *_):
|
async def _async_connect_websocket_if_disconnected(self, *_):
|
||||||
"""Reconnect the websocket if it fails."""
|
"""Reconnect the websocket if it fails."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user