Skip to content

Commit

Permalink
Start async update only after we are able to connect to device
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronen Gruengras authored and ronengr committed May 24, 2024
1 parent 10785fa commit c7260a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/hass_nuki_bt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
security_pin=int(entry.data.get(CONF_PIN, 0)),
)

entry.async_on_unload(coordinator.async_start())
if not await coordinator.async_wait_ready():
raise ConfigEntryNotReady(f"{address} is not advertising state")

entry.async_on_unload(coordinator.async_start())

# entry.async_on_unload(entry.add_update_listener(_async_update_listener))
# await hass.config_entries.async_forward_entry_setups(
# entry, PLATFORMS_BY_TYPE[sensor_type]
Expand Down

0 comments on commit c7260a1

Please sign in to comment.