This commit is contained in:
Home Assistant Version Control
2026-09-28 14:45:59 +00:00
parent ae38d6b234
commit cd65be7a07
35 changed files with 5212 additions and 133 deletions
+6 -8
View File
@@ -159,14 +159,12 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # ruff:
item = None
if dev_ := MIDEA_DEVICES.get(dev.device_type):
item = cast("dict", dev_["entities"]).get(attr)
if (
item
and (item.get("type") in EXTRA_SWITCH)
or (
dev.device_type == DeviceType.AC
and attr == "fan_speed"
and value in range(103)
)
if item is not None and item.get("type") in EXTRA_SWITCH:
dev.set_attribute(attr=item.get("attribute", attr), value=value)
elif (
dev.device_type == DeviceType.AC
and attr == "fan_speed"
and value in range(103)
):
dev.set_attribute(attr=attr, value=value)
else: