1 """Platform for the iZone AC."""
3 import voluptuous
as vol
5 from homeassistant
import config_entries
12 from .const
import DATA_CONFIG, IZONE
13 from .discovery
import async_start_discovery_service, async_stop_discovery_service
15 PLATFORMS = [Platform.CLIMATE]
17 CONFIG_SCHEMA = vol.Schema(
21 vol.Optional(CONF_EXCLUDE, default=[]): vol.All(
22 cv.ensure_list, [cv.string]
27 extra=vol.ALLOW_EXTRA,
31 async
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
32 """Register the iZone component config."""
35 if conf := config.get(IZONE):
36 hass.data[DATA_CONFIG] = conf
39 hass.async_create_task(
40 hass.config_entries.flow.async_init(
41 IZONE, context={
"source": config_entries.SOURCE_IMPORT}
48 async
def shutdown_event(event):
51 hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shutdown_event)
57 """Set up from a config entry."""
58 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
63 """Unload the config entry and stop discovery process."""
64 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
None async_stop_discovery_service(HomeAssistant hass)
AbstractDiscoveryService async_start_discovery_service(HomeAssistant hass)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup(HomeAssistant hass, ConfigType config)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)