This repository has been archived on 2025-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
2023-09-23 18:59:01 -03:00

27 lines
665 B
Python

import logging
from homeassistant import config_entries, core
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: core.HomeAssistant, entry: config_entries.ConfigEntry
) -> bool:
"""Set up platform from a ConfigEntry."""
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = entry.data
# Forward the setup to the sensor platform.
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor")
)
return True
async def async_setup(hass: core.HomeAssistant, config: dict) -> bool:
hass.data.setdefault(DOMAIN, {})
return True