diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index d4d15fd5e..8abd88bc2 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -2041,6 +2041,9 @@ 'switch_properties': 'motor_reverse', 'select_properties': 'mode', }, + '*.derh.*': { + 'select_properties': 'fan_level', + }, '*.desk.*': { 'button_properties': 'motor_control,reset', 'switch_properties': 'on', @@ -2096,6 +2099,9 @@ 'switch_properties': 'heater.on,horizontal_swing,alarm.alarm,delay.delay', 'number_properties': 'countdown_time,delay_time', }, + '*.humidifier.*': { + 'select_properties': 'fan_level', + }, '*.ihcooker.*': { 'sensor_properties': 'left_time,working_time', 'switch_properties': 'induction_cooker.on', diff --git a/custom_components/xiaomi_miot/humidifier.py b/custom_components/xiaomi_miot/humidifier.py index 25eeec272..5316ea804 100644 --- a/custom_components/xiaomi_miot/humidifier.py +++ b/custom_components/xiaomi_miot/humidifier.py @@ -100,23 +100,12 @@ async def async_update(self): num = round(num * fac) self._attr_target_humidity = num - add_fans = self._add_entities.get('fan') - for p in self._mode_props: - pnm = p.full_name - if self._prop_mode and pnm == self._prop_mode.full_name: - continue - if pnm in self._subs: - self._subs[pnm].update_from_parent() - elif add_fans: - self._subs[pnm] = MiotModesSubEntity(self, p) - add_fans([self._subs[pnm]], update_before_add=True) - @property def device_class(self): if cls := self.get_device_class(HumidifierDeviceClass): return cls typ = f'{self.model} {self._miot_service.spec.type}' - if HumidifierDeviceClass.DEHUMIDIFIER.value in typ or '.derh.' in typ: + if 'dehumidifier' in typ or '.derh.' in typ: return HumidifierDeviceClass.DEHUMIDIFIER return HumidifierDeviceClass.HUMIDIFIER