From 9753500f5eaff7354b218a405d34a43edc904c4e Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Thu, 22 Jul 2021 08:57:29 +0200 Subject: [PATCH] Disable speeds for first gen Xiaomi_miio air purifiers (#52772) * Disable speeds for first gen air purifiers * Remove test code line * remove OPERATION_MODES_AIRPURIFIER list --- homeassistant/components/xiaomi_miio/fan.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/xiaomi_miio/fan.py b/homeassistant/components/xiaomi_miio/fan.py index c1dde7ec38d..bdef9517cca 100644 --- a/homeassistant/components/xiaomi_miio/fan.py +++ b/homeassistant/components/xiaomi_miio/fan.py @@ -336,7 +336,6 @@ AVAILABLE_ATTRIBUTES_AIRFRESH = { ATTR_EXTRA_FEATURES: "extra_features", } -OPERATION_MODES_AIRPURIFIER = ["Auto", "Silent", "Favorite", "Idle"] PRESET_MODES_AIRPURIFIER = ["Auto", "Silent", "Favorite", "Idle"] OPERATION_MODES_AIRPURIFIER_PRO = ["Auto", "Silent", "Favorite"] PRESET_MODES_AIRPURIFIER_PRO = ["Auto", "Silent", "Favorite"] @@ -903,10 +902,10 @@ class XiaomiAirPurifier(XiaomiGenericDevice): self._device_features = FEATURE_FLAGS_AIRPURIFIER self._available_attributes = AVAILABLE_ATTRIBUTES_AIRPURIFIER self._preset_modes = PRESET_MODES_AIRPURIFIER - self._supported_features = SUPPORT_SET_SPEED | SUPPORT_PRESET_MODE - self._speed_count = 4 + self._supported_features = SUPPORT_PRESET_MODE + self._speed_count = 1 # the speed_list attribute is deprecated, support will end with release 2021.7 - self._speed_list = OPERATION_MODES_AIRPURIFIER + self._speed_list = [] self._state_attrs.update( {attribute: None for attribute in self._available_attributes}