INNER CODE UNIT · Python

async_unload_entry

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

async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
    """Unload a config entry."""

    if MODULE_DATA not in hass.data:
        _LOGGER.warning(
            "Module data object for Magic Areas not found, possibly already removed."
        )
        return False

    data = hass.data[MODULE_DATA]

    if config_entry.entry_id not in data:
        _LOGGER.debug(
            "Config entry '%s' not on data dictionary, probably already unloaded. Skipping.",
            config_entry.entry_id,
        )
        return True

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…