INNER CODE UNIT · Python

async_setup_entry

jseidl/magic-areas · custom_components/magic_areas/__init__.py:34

async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
    """Set up the component."""

    @callback
    async def _async_reload_entry(*args, **kwargs) -> None:
        # Prevent reloads if we're not fully loaded yet
        if not hass.is_running:
            return

        hass.config_entries.async_update_entry(
            config_entry,
            data={**config_entry.data, "entity_ts": datetime.now(UTC)},
        )

    @callback
    async def _async_registry_updated(
        event: (
            Event[EventEntityRegistryUpdatedData]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…