Skip to content

Commit

Permalink
Correctly call on_update function with hass.add_job so it runs on the…
Browse files Browse the repository at this point in the history
… correct thread
  • Loading branch information
niekschoemaker committed Jan 16, 2025
1 parent 6ffb7a4 commit 3325bb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/hon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
coordinator: DataUpdateCoordinator[dict[str, Any]] = DataUpdateCoordinator(
hass, _LOGGER, name=DOMAIN
)
hon.subscribe_updates(coordinator.async_set_updated_data)
hon.subscribe_updates(lambda data: hass.add_job(coordinator.async_set_updated_data, data))

hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.unique_id] = {"hon": hon, "coordinator": coordinator}
Expand Down

0 comments on commit 3325bb2

Please sign in to comment.