Fix kodi log spamming again (#69137)

* Fix kodi log spamming again

* use try except else
This commit is contained in:
Raman Gupta 2022-04-02 13:26:50 -04:00 committed by GitHub
parent c3354dcaae
commit 963ed74797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -448,6 +448,7 @@ 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)
else:
self._connect_error = False self._connect_error = False
async def _ping(self): async def _ping(self):
@ -458,6 +459,7 @@ 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()
else:
self._connect_error = False self._connect_error = False
async def _async_connect_websocket_if_disconnected(self, *_): async def _async_connect_websocket_if_disconnected(self, *_):