1 """The Kostal Plenticore Solar Inverter integration."""
5 from pykoplenti
import ApiException
11 from .const
import DOMAIN
12 from .coordinator
import Plenticore
14 _LOGGER = logging.getLogger(__name__)
16 PLATFORMS = [Platform.NUMBER, Platform.SELECT, Platform.SENSOR, Platform.SWITCH]
20 """Set up Kostal Plenticore Solar Inverter from a config entry."""
21 hass.data.setdefault(DOMAIN, {})
25 if not await plenticore.async_setup():
28 hass.data[DOMAIN][entry.entry_id] = plenticore
30 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
36 """Unload a config entry."""
37 unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
40 plenticore = hass.data[DOMAIN].pop(entry.entry_id)
42 await plenticore.async_unload()
43 except ApiException
as err:
44 _LOGGER.error(
"Error logging out from inverter: %s", err)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)