mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix sensor setup during dynamic addition of Miele devices (#144551)
Fix sensors when dynamic addition of devices
This commit is contained in:
parent
2940cb0fa0
commit
85f1c89808
@ -455,7 +455,10 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
for device_id, device in coordinator.data.devices.items():
|
for device_id, device in coordinator.data.devices.items():
|
||||||
for definition in SENSOR_TYPES:
|
for definition in SENSOR_TYPES:
|
||||||
if device.device_type in definition.types:
|
if (
|
||||||
|
device_id in new_devices_set
|
||||||
|
and device.device_type in definition.types
|
||||||
|
):
|
||||||
match definition.description.key:
|
match definition.description.key:
|
||||||
case "state_status":
|
case "state_status":
|
||||||
entity_class = MieleStatusSensor
|
entity_class = MieleStatusSensor
|
||||||
@ -466,8 +469,7 @@ async def async_setup_entry(
|
|||||||
case _:
|
case _:
|
||||||
entity_class = MieleSensor
|
entity_class = MieleSensor
|
||||||
if (
|
if (
|
||||||
device_id in new_devices_set
|
definition.description.device_class
|
||||||
and definition.description.device_class
|
|
||||||
== SensorDeviceClass.TEMPERATURE
|
== SensorDeviceClass.TEMPERATURE
|
||||||
and definition.description.value_fn(device)
|
and definition.description.value_fn(device)
|
||||||
== DISABLED_TEMPERATURE / 100
|
== DISABLED_TEMPERATURE / 100
|
||||||
|
Loading…
x
Reference in New Issue
Block a user