Migrate baf to use config entry runtime_data (#117081)
This commit is contained in:
parent
20b29242f1
commit
159f0fcce7
9 changed files with 44 additions and 68 deletions
|
@ -8,7 +8,6 @@ from typing import cast
|
|||
|
||||
from aiobafi6 import Device
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
|
@ -24,9 +23,8 @@ from homeassistant.const import (
|
|||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN
|
||||
from . import BAFConfigEntry
|
||||
from .entity import BAFEntity
|
||||
from .models import BAFData
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
|
@ -94,12 +92,11 @@ FAN_SENSORS = (
|
|||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: config_entries.ConfigEntry,
|
||||
entry: BAFConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up BAF fan sensors."""
|
||||
data: BAFData = hass.data[DOMAIN][entry.entry_id]
|
||||
device = data.device
|
||||
device = entry.runtime_data
|
||||
sensors_descriptions: list[BAFSensorDescription] = [
|
||||
description
|
||||
for description in DEFINED_ONLY_SENSORS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue