fix: humidifier entity control mapping.

This commit is contained in:
sususweet
2025-10-11 11:48:42 +08:00
parent d49eab91c9
commit b3e9a11394

View File

@@ -62,7 +62,7 @@ class MideaHumidifierEntity(MideaEntity, HumidifierEntity):
config=config, config=config,
) )
self._attr_supported_features = HumidifierEntityFeature.MODES 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 @property
def device_class(self): def device_class(self):
@@ -124,13 +124,14 @@ class MideaHumidifierEntity(MideaEntity, HumidifierEntity):
"""Turn the humidifier on.""" """Turn the humidifier on."""
power_key = self._config.get("power") power_key = self._config.get("power")
if power_key: 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): async def async_turn_off(self, **kwargs):
"""Turn the humidifier off.""" """Turn the humidifier off."""
power_key = self._config.get("power") power_key = self._config.get("power")
if power_key: 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): async def async_set_humidity(self, humidity: int):
"""Set the target humidity.""" """Set the target humidity."""