mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Handle ConnectionClosedException from System Bridge (#89654)
Handle unretrieved ConnectionClosedException from System Bridge
This commit is contained in:
parent
6809bd3029
commit
a99f6f7124
@ -186,6 +186,12 @@ class SystemBridgeDataUpdateCoordinator(
|
|||||||
await self.websocket_client.connect(
|
await self.websocket_client.connect(
|
||||||
session=async_get_clientsession(self.hass),
|
session=async_get_clientsession(self.hass),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.hass.async_create_task(self._listen_for_data())
|
||||||
|
|
||||||
|
await self.websocket_client.register_data_listener(
|
||||||
|
RegisterDataListener(modules=MODULES)
|
||||||
|
)
|
||||||
except AuthenticationException as exception:
|
except AuthenticationException as exception:
|
||||||
self.last_update_success = False
|
self.last_update_success = False
|
||||||
self.logger.error("Authentication failed for %s: %s", self.title, exception)
|
self.logger.error("Authentication failed for %s: %s", self.title, exception)
|
||||||
@ -211,12 +217,6 @@ class SystemBridgeDataUpdateCoordinator(
|
|||||||
self.last_update_success = False
|
self.last_update_success = False
|
||||||
self.async_update_listeners()
|
self.async_update_listeners()
|
||||||
|
|
||||||
self.hass.async_create_task(self._listen_for_data())
|
|
||||||
|
|
||||||
await self.websocket_client.register_data_listener(
|
|
||||||
RegisterDataListener(modules=MODULES)
|
|
||||||
)
|
|
||||||
|
|
||||||
self.last_update_success = True
|
self.last_update_success = True
|
||||||
self.async_update_listeners()
|
self.async_update_listeners()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user