1 """The Lektrico Charging Station integration."""
3 from __future__
import annotations
5 from lektricowifi
import Device
11 from .coordinator
import LektricoDeviceDataUpdateCoordinator
14 CHARGERS_PLATFORMS: list[Platform] = [
15 Platform.BINARY_SENSOR,
23 LB_DEVICES_PLATFORMS: list[Platform] = [
29 type LektricoConfigEntry = ConfigEntry[LektricoDeviceDataUpdateCoordinator]
33 """Set up Lektrico Charging Station from a config entry."""
36 f
"{entry.data[CONF_TYPE]}_{entry.data[ATTR_SERIAL_NUMBER]}",
39 await coordinator.async_config_entry_first_refresh()
41 entry.runtime_data = coordinator
43 await hass.config_entries.async_forward_entry_setups(entry,
_get_platforms(entry))
49 """Unload a config entry."""
51 return await hass.config_entries.async_unload_platforms(
57 """Return the platforms for this type of device."""
58 _device_type: str = entry.data[CONF_TYPE]
59 if _device_type
in (Device.TYPE_1P7K, Device.TYPE_3P22K):
60 return CHARGERS_PLATFORMS
61 return LB_DEVICES_PLATFORMS
bool async_setup_entry(HomeAssistant hass, LektricoConfigEntry entry)
list[Platform] _get_platforms(ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)