Wait for initial scan to finish before setting up platforms (#122360)

pull/122766/head
Rami Mosleh 2024-07-29 13:52:01 +03:00 committed by GitHub
parent 075550b7ba
commit 0de75aeee1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
gree_discovery = DiscoveryService(hass)
hass.data[DATA_DISCOVERY_SERVICE] = gree_discovery
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
async def _async_scan_update(_=None):
bcast_addr = list(await async_get_ipv4_broadcast_addresses(hass))
await gree_discovery.discovery.scan(0, bcast_ifaces=bcast_addr)
@ -44,6 +42,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True