mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
fix blocking startup when NAS is busy (#60360)
This commit is contained in:
parent
729394547c
commit
d63e2d1db0
@ -298,6 +298,7 @@ class SynoApi:
|
|||||||
else:
|
else:
|
||||||
self.config_url = f"http://{entry.data[CONF_HOST]}:{entry.data[CONF_PORT]}"
|
self.config_url = f"http://{entry.data[CONF_HOST]}:{entry.data[CONF_PORT]}"
|
||||||
|
|
||||||
|
self.initialized = False
|
||||||
# DSM APIs
|
# DSM APIs
|
||||||
self.dsm: SynologyDSM = None
|
self.dsm: SynologyDSM = None
|
||||||
self.information: SynoDSMInformation = None
|
self.information: SynoDSMInformation = None
|
||||||
@ -347,6 +348,7 @@ class SynoApi:
|
|||||||
|
|
||||||
await self._hass.async_add_executor_job(self._fetch_device_configuration)
|
await self._hass.async_add_executor_job(self._fetch_device_configuration)
|
||||||
await self.async_update()
|
await self.async_update()
|
||||||
|
self.initialized = True
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def subscribe(self, api_key: str, unique_id: str) -> Callable[[], None]:
|
def subscribe(self, api_key: str, unique_id: str) -> Callable[[], None]:
|
||||||
@ -506,6 +508,9 @@ class SynoApi:
|
|||||||
self.dsm.update, self._with_information
|
self.dsm.update, self._with_information
|
||||||
)
|
)
|
||||||
except (SynologyDSMLoginFailedException, SynologyDSMRequestException) as err:
|
except (SynologyDSMLoginFailedException, SynologyDSMRequestException) as err:
|
||||||
|
if not self.initialized:
|
||||||
|
raise err
|
||||||
|
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Connection error during update, fallback by reloading the entry"
|
"Connection error during update, fallback by reloading the entry"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user