Migrate screenlogic to use entry.runtime_data (#121644)
This commit is contained in:
parent
6f15352eda
commit
fb758bd8b6
10 changed files with 50 additions and 67 deletions
|
@ -18,12 +18,10 @@ from homeassistant.components.sensor import (
|
|||
SensorEntityDescription,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN as SL_DOMAIN
|
||||
from .coordinator import ScreenlogicDataUpdateCoordinator
|
||||
from .entity import (
|
||||
ScreenLogicEntity,
|
||||
|
@ -31,6 +29,7 @@ from .entity import (
|
|||
ScreenLogicPushEntity,
|
||||
ScreenLogicPushEntityDescription,
|
||||
)
|
||||
from .types import ScreenLogicConfigEntry
|
||||
from .util import cleanup_excluded_entity, get_ha_unit
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -227,13 +226,11 @@ SUPPORTED_SCG_SENSORS = [
|
|||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
config_entry: ScreenLogicConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up entry."""
|
||||
coordinator: ScreenlogicDataUpdateCoordinator = hass.data[SL_DOMAIN][
|
||||
config_entry.entry_id
|
||||
]
|
||||
coordinator = config_entry.runtime_data
|
||||
gateway = coordinator.gateway
|
||||
|
||||
entities: list[ScreenLogicSensor] = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue