1 """Support for LaMetric time."""
11 from .const
import DOMAIN, PLATFORMS
12 from .coordinator
import LaMetricDataUpdateCoordinator
13 from .services
import async_setup_services
15 CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
18 async
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
19 """Set up the LaMetric integration."""
21 hass.data[DOMAIN] = {
"hass_config": config}
26 """Set up LaMetric from a config entry."""
28 await coordinator.async_config_entry_first_refresh()
30 hass.data[DOMAIN][entry.entry_id] = coordinator
31 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
35 hass.async_create_task(
36 discovery.async_load_platform(
40 {CONF_NAME: coordinator.data.name,
"entry_id": entry.entry_id},
41 hass.data[DOMAIN][
"hass_config"],
48 """Unload LaMetric config entry."""
49 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
50 del hass.data[DOMAIN][entry.entry_id]
51 await hass_notify.async_reload(hass, DOMAIN)
None async_setup_services(HomeAssistant hass)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup(HomeAssistant hass, ConfigType config)