From b3e9a113942af17a01ace8c0f98cb152eb84d323 Mon Sep 17 00:00:00 2001 From: sususweet Date: Sat, 11 Oct 2025 11:48:42 +0800 Subject: [PATCH] fix: humidifier entity control mapping. --- custom_components/midea_auto_cloud/humidifier.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_components/midea_auto_cloud/humidifier.py b/custom_components/midea_auto_cloud/humidifier.py index dc1865e..80b2fb9 100644 --- a/custom_components/midea_auto_cloud/humidifier.py +++ b/custom_components/midea_auto_cloud/humidifier.py @@ -62,7 +62,7 @@ class MideaHumidifierEntity(MideaEntity, HumidifierEntity): config=config, ) self._attr_supported_features = HumidifierEntityFeature.MODES - self._attr_available_modes = self._config.get("modes").keys() + self._attr_available_modes = list(self._config.get("modes").keys()) @property def device_class(self): @@ -124,13 +124,14 @@ class MideaHumidifierEntity(MideaEntity, HumidifierEntity): """Turn the humidifier on.""" power_key = self._config.get("power") if power_key: - await self._device.set_attribute(power_key, True) + await self._device.set_attribute(power_key, self._rationale[int(True)]) async def async_turn_off(self, **kwargs): """Turn the humidifier off.""" power_key = self._config.get("power") if power_key: - await self._device.set_attribute(power_key, False) + await self._device.set_attribute(power_key, self._rationale[int(False)]) + await self._device.set_attribute(power_key, self._rationale[int(False)]) async def async_set_humidity(self, humidity: int): """Set the target humidity."""