Convert config entry subscriptions to callback (#110900)
This commit is contained in:
parent
af6b24d9bd
commit
aab21105da
1 changed files with 4 additions and 3 deletions
|
@ -26,8 +26,8 @@ from homeassistant.loader import (
|
||||||
Integration,
|
Integration,
|
||||||
IntegrationNotFound,
|
IntegrationNotFound,
|
||||||
async_get_config_flows,
|
async_get_config_flows,
|
||||||
async_get_integration,
|
|
||||||
async_get_integrations,
|
async_get_integrations,
|
||||||
|
async_get_loaded_integration,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -479,12 +479,13 @@ async def config_entries_subscribe(
|
||||||
"""Subscribe to config entry updates."""
|
"""Subscribe to config entry updates."""
|
||||||
type_filter = msg.get("type_filter")
|
type_filter = msg.get("type_filter")
|
||||||
|
|
||||||
async def async_forward_config_entry_changes(
|
@callback
|
||||||
|
def async_forward_config_entry_changes(
|
||||||
change: config_entries.ConfigEntryChange, entry: config_entries.ConfigEntry
|
change: config_entries.ConfigEntryChange, entry: config_entries.ConfigEntry
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Forward config entry state events to websocket."""
|
"""Forward config entry state events to websocket."""
|
||||||
if type_filter:
|
if type_filter:
|
||||||
integration = await async_get_integration(hass, entry.domain)
|
integration = async_get_loaded_integration(hass, entry.domain)
|
||||||
if integration.integration_type not in type_filter:
|
if integration.integration_type not in type_filter:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue