from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from .const import DOMAIN async def async_setup(hass: HomeAssistant, config: dict): """Set up the Cloudflare Tunnel component.""" return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): """Set up Cloudflare Tunnel from a config entry.""" hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN][entry.entry_id] = entry.data await hass.config_entries.async_forward_entry_setups(entry, ["sensor"]) return True async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): """Unload a config entry.""" unload_ok = await hass.config_entries.async_forward_entry_unload(entry, "sensor") if unload_ok: hass.data[DOMAIN].pop(entry.entry_id) else: _LOGGER.error("Failed to unload entry: %s", entry.entry_id) return unload_ok