mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Rehlko adjust timeouts for coordinator polls (#144297)
This commit is contained in:
parent
14f967cdd0
commit
0dd21f4c89
@ -29,6 +29,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: RehlkoConfigEntry) -> bo
|
||||
"""Set up Rehlko from a config entry."""
|
||||
websession = async_get_clientsession(hass)
|
||||
rehlko = AioKem(session=websession)
|
||||
# If requests take more than 20 seconds; timeout and let the setup retry.
|
||||
rehlko.set_timeout(20)
|
||||
|
||||
async def async_refresh_token_update(refresh_token: str) -> None:
|
||||
"""Handle refresh token update."""
|
||||
@ -87,6 +89,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: RehlkoConfigEntry) -> bo
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
# Retrys enabled after successful connection to prevent blocking startup
|
||||
rehlko.set_retry_policy(retry_count=3, retry_delays=[5, 10, 20])
|
||||
# Rehlko service can be slow to respond, increase timeout for polls.
|
||||
rehlko.set_timeout(100)
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user