-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
29 lines (19 loc) · 934 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Support for Infometric AB Panorama website datasource as an Energy Meter."""
from homeassistant.core import _LOGGER, HomeAssistant
from homeassistant.helpers.typing import ConfigType
from homeassistant.config_entries import ConfigEntry
from .const import DOMAIN
PLATFORMS = ["sensor"]
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Setup the component."""
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Infometric from a config entry."""
hass.data.setdefault(DOMAIN, {})
hass_data = dict(entry.data)
hass.data[DOMAIN][entry.entry_id] = hass_data
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)