1 """The WiLight integration."""
8 from .const
import DOMAIN
9 from .parent_device
import WiLightParent
12 PLATFORMS = [Platform.COVER, Platform.FAN, Platform.LIGHT, Platform.SWITCH]
16 """Set up a wilight config entry."""
20 if not await parent.async_setup():
21 raise ConfigEntryNotReady
23 hass.data.setdefault(DOMAIN, {})
24 hass.data[DOMAIN][entry.entry_id] = parent
27 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
33 """Unload WiLight config entry."""
36 unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
39 parent = hass.data[DOMAIN][entry.entry_id]
40 await parent.async_reset()
41 del hass.data[DOMAIN][entry.entry_id]
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)