Fix sensor setup during dynamic addition of Miele devices (#144551)
Fix sensors when dynamic addition of devicespull/144579/head
parent
2940cb0fa0
commit
85f1c89808
|
@ -455,7 +455,10 @@ async def async_setup_entry(
|
|||
|
||||
for device_id, device in coordinator.data.devices.items():
|
||||
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:
|
||||
case "state_status":
|
||||
entity_class = MieleStatusSensor
|
||||
|
@ -466,8 +469,7 @@ async def async_setup_entry(
|
|||
case _:
|
||||
entity_class = MieleSensor
|
||||
if (
|
||||
device_id in new_devices_set
|
||||
and definition.description.device_class
|
||||
definition.description.device_class
|
||||
== SensorDeviceClass.TEMPERATURE
|
||||
and definition.description.value_fn(device)
|
||||
== DISABLED_TEMPERATURE / 100
|
||||
|
|
Loading…
Reference in New Issue