1 """The easyEnergy integration."""
3 from __future__
import annotations
12 from .const
import DOMAIN
13 from .coordinator
import EasyEnergyDataUpdateCoordinator
14 from .services
import async_setup_services
16 PLATFORMS = [Platform.SENSOR]
17 CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
20 async
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
21 """Set up the easyEnergy services."""
29 """Set up easyEnergy from a config entry."""
33 await coordinator.async_config_entry_first_refresh()
34 except ConfigEntryNotReady:
35 await coordinator.easyenergy.close()
38 hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
40 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
46 """Unload easyEnergy config entry."""
47 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
48 hass.data[DOMAIN].pop(entry.entry_id)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup(HomeAssistant hass, ConfigType config)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
None async_setup_services(HomeAssistant hass)