mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Tweak Meater typing and variable naming (#71333)
This commit is contained in:
parent
e145d3c65b
commit
22d2587593
@ -136,9 +136,9 @@ async def async_setup_entry(
|
|||||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the entry."""
|
"""Set up the entry."""
|
||||||
coordinator: DataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
coordinator: DataUpdateCoordinator[dict[str, MeaterProbe]] = hass.data[DOMAIN][
|
||||||
"coordinator"
|
entry.entry_id
|
||||||
]
|
]["coordinator"]
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_update_data():
|
def async_update_data():
|
||||||
@ -146,22 +146,22 @@ async def async_setup_entry(
|
|||||||
if not coordinator.last_update_success:
|
if not coordinator.last_update_success:
|
||||||
return
|
return
|
||||||
|
|
||||||
devices: dict[str, MeaterProbe] = coordinator.data
|
devices = coordinator.data
|
||||||
entities = []
|
entities = []
|
||||||
known_probes: set = hass.data[DOMAIN]["known_probes"]
|
known_probes: set = hass.data[DOMAIN]["known_probes"]
|
||||||
|
|
||||||
# Add entities for temperature probes which we've not yet seen
|
# Add entities for temperature probes which we've not yet seen
|
||||||
for dev in devices:
|
for device_id in devices:
|
||||||
if dev in known_probes:
|
if device_id in known_probes:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
entities.extend(
|
entities.extend(
|
||||||
[
|
[
|
||||||
MeaterProbeTemperature(coordinator, dev, sensor_description)
|
MeaterProbeTemperature(coordinator, device_id, sensor_description)
|
||||||
for sensor_description in SENSOR_TYPES
|
for sensor_description in SENSOR_TYPES
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
known_probes.add(dev)
|
known_probes.add(device_id)
|
||||||
|
|
||||||
async_add_entities(entities)
|
async_add_entities(entities)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user