From 45affc4a40ed6d84d01f06c2ef7b2f9f3dbb313a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Mind=C3=AAllo=20de=20Andrade?= Date: Fri, 9 Oct 2026 11:13:02 -0300 Subject: [PATCH] Add Midea washing and drying machines sensors (#184331) Co-authored-by: Norbert Rittel --- homeassistant/components/midea/icons.json | 24 + homeassistant/components/midea/sensor.py | 336 +++- homeassistant/components/midea/strings.json | 237 +++ .../midea/snapshots/test_sensor.ambr | 1384 ++++++++++++++++- tests/components/midea/test_sensor.py | 68 +- 5 files changed, 2042 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/midea/icons.json b/homeassistant/components/midea/icons.json index 4301f38bd48f..d9be1f3a26bb 100644 --- a/homeassistant/components/midea/icons.json +++ b/homeassistant/components/midea/icons.json @@ -44,6 +44,18 @@ } }, "sensor": { + "dehydration_level": { + "default": "mdi:tumble-dryer" + }, + "dehydration_speed": { + "default": "mdi:speedometer" + }, + "detergent": { + "default": "mdi:bottle-tonic" + }, + "dry_program": { + "default": "mdi:tumble-dryer" + }, "filter_life": { "default": "mdi:air-filter" }, @@ -76,6 +88,18 @@ }, "time_remaining": { "default": "mdi:progress-clock" + }, + "wash_program": { + "default": "mdi:washing-machine" + }, + "wash_progress": { + "default": "mdi:rotate-360" + }, + "wash_strength": { + "default": "mdi:network-strength-4-cog" + }, + "water_level": { + "default": "mdi:cup-water" } }, "switch": { diff --git a/homeassistant/components/midea/sensor.py b/homeassistant/components/midea/sensor.py index ec9ff2f6221d..1df1df32d97a 100644 --- a/homeassistant/components/midea/sensor.py +++ b/homeassistant/components/midea/sensor.py @@ -43,6 +43,7 @@ PARALLEL_UPDATES = 0 class MideaSensorEntityDescription(SensorEntityDescription): """Describes Midea sensor entity.""" + attribute: str | None = None models: list[DeviceType] | None = None @@ -704,6 +705,313 @@ SENSOR_ENTITIES: list[MideaSensorEntityDescription] = [ native_unit_of_measurement=UnitOfVolume.LITERS, state_class=SensorStateClass.MEASUREMENT, ), + MideaSensorEntityDescription( + key="progress", + translation_key="wash_progress", + device_class=SensorDeviceClass.ENUM, + options=[ + "idle", + "spin", + "rinse", + "wash", + "weight", + "dry", + "soak", + ], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="program", + translation_key="wash_program", + device_class=SensorDeviceClass.ENUM, + options=[ + "standard", + "fast", + "blanket", + "wool", + "embathe", + "memory", + "child", + "down_jacket", + "stir", + "mute", + "bucket_self_clean", + "air_dry", + ], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="dehydration_level", + attribute="dehydration_speed", + translation_key="dehydration_level", + device_class=SensorDeviceClass.ENUM, + options=["none", "low", "medium", "high"], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="detergent", + translation_key="detergent", + device_class=SensorDeviceClass.ENUM, + options=[ + "no", + "less", + "medium", + "more", + "4", + "5", + "6", + "7", + "8", + "insufficient", + ], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="softener", + translation_key="softener", + device_class=SensorDeviceClass.ENUM, + options=[ + "no", + "intelligent", + "programed", # codespell:ignore + "3", + "4", + "5", + "6", + "7", + "8", + "insufficient", + ], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="wash_strength", + translation_key="wash_strength", + device_class=SensorDeviceClass.ENUM, + options=["none", "weak", "medium", "strong"], + models=[DeviceType.DA], + ), + MideaSensorEntityDescription( + key="status", + translation_key="status", + device_class=SensorDeviceClass.ENUM, + options=[ + "idle", + "standby", + "start", + "pause", + "end", + "fault", + "delay", + ], + models=[DeviceType.DB], + ), + MideaSensorEntityDescription( + key="dehydration_speed", + translation_key="dehydration_speed", + native_unit_of_measurement=REVOLUTIONS_PER_MINUTE, + state_class=SensorStateClass.MEASUREMENT, + models=[DeviceType.DB], + ), + MideaSensorEntityDescription( + key="water_level", + translation_key="water_level", + device_class=SensorDeviceClass.ENUM, + options=[ + "low", + "mid", + "high", + "4", + "auto", + ], + models=[DeviceType.DB], + ), + MideaSensorEntityDescription( + key="program", + translation_key="wash_program", + device_class=SensorDeviceClass.ENUM, + options=[ + "cotton", + "eco", + "fast_wash", + "mixed_wash", + "fiber", + "wool", + "enzyme", + "ssp", + "sport_clothes", + "single_dehytration", + "rinsing_dehydration", + "big", + "baby_clothes", + "outdoor", + "air_wash", + "down_jacket", + "color", + "intelligent", + "quick_wash", + "kids", + "water_cotton", + "single_drying", + "fast_wash_30", + "fast_wash_60", + "water_intelligent", + "water_steep", + "water_fast_wash_30", + "shirt", + "steep", + "new_water_cotton", + "water_mixed_wash", + "water_fiber", + "water_kids", + "water_underwear", + "specialist", + "water_eco", + "wash_drying_60", + "self_wash_5", + "fast_wash_min", + "mixed_wash_min", + "dehydration_min", + "self_wash_min", + "baby_clothes_min", + "prevent_allergy", + "cold_wash", + "soft_wash", + "remove_mite_wash", + "water_intense_wash", + "fast_dry", + "water_outdoor", + "spring_autumn_wash", + "summer_wash", + "winter_wash", + "jean", + "new_clothes_wash", + "silk", + "insight_wash", + "fitness_clothes", + "mink", + "fresh_air", + "bucket_dry", + "jacket", + "bath_towel", + "night_fresh_wash", + "diy0", + "diy2", + "heart_wash", + "water_cold_wash", + "water_prevent_allergy", + "water_remove_mite_wash", + "water_ssp", + "silk_wash", + "standard", + "green_wool", + "cook_wash", + "fresh_remove_wrinkle", + "steam_sterilize_wash", + "aromatherapy", + "eco_40_60", + "steam_care", + "allergy_care", + "sterilize_wash", + "wash_and_dry", + "time_dry", + "bulky", + "love", + ], + models=[DeviceType.DB], + ), + MideaSensorEntityDescription( + key="progress", + translation_key="wash_progress", + device_class=SensorDeviceClass.ENUM, + options=[ + "idle", + "spin", + "rinse", + "wash", + "pre_wash", + "dry", + "weight", + "hi_speed_spin", + ], + models=[DeviceType.DB], + ), + MideaSensorEntityDescription( + key="status", + translation_key="status", + device_class=SensorDeviceClass.ENUM, + options=[ + "idle", + "standby", + "start", + "pause", + "end", + "prevent_wrinkle_end", + "delay_choosing", + "fault", + "delay", + "delay_pause", + ], + models=[DeviceType.DC], + ), + MideaSensorEntityDescription( + key="program", + translation_key="dry_program", + device_class=SensorDeviceClass.ENUM, + options=[ + "cotton", + "fiber", + "mixed_wash", + "jean", + "bedsheet", + "outdoor", + "down_jacket", + "plush", + "wool", + "dehumidify", + "cold_air_fresh_air", + "hot_air_dry", + "sport_clothes", + "underwear", + "baby_clothes", + "shirt", + "standard", + "quick_dry", + "fresh_air", + "low_temp_dry", + "eco_dry", + "quick_dry_30", + "towel", + "intelligent_dry", + "steam_care", + "big", + "fixed_time_dry", + "night_dry", + "bracket_dry", + "western_trouser", + "dehumidification", + "smart_dry", + "four_piece_suit", + "warm_clothes", + "quick_dry_20", + "steam_sterilize", + "enzyme", + "big_60", + "steam_no_iron", + "air_wash", + "bed_clothes", + "little_fast_dry", + "small_piece_dry", + "big_dry", + "wool_nurse", + "sun_quilt", + "fresh_remove_smell", + "bucket_self_clean", + "silk", + "sterilize", + ], + models=[DeviceType.DC], + ), ] @@ -718,7 +1026,7 @@ async def async_setup_entry( sensors: list[MideaSensor] = [ MideaSensor(device, description) for description in SENSOR_ENTITIES - if device.attributes.get(description.key) is not None + if device.attributes.get(description.attribute or description.key) is not None and (not description.models or device.device_type in description.models) ] @@ -732,10 +1040,32 @@ class MideaSensor(MideaEntity, SensorEntity): @override def native_value(self) -> StateType | datetime: """Native value of the sensor.""" - value = self._device.get_attribute(self.entity_description.key) + description = cast(MideaSensorEntityDescription, self.entity_description) + value = self._device.get_attribute(description.attribute or description.key) if value == "unknown": return None - if self.entity_description.device_class == SensorDeviceClass.TIMESTAMP: + if ( + description.key + in ( + "dehydration_level", + "softener", + "detergent", + "temperature", + "water_level", + "program", + ) + and value == "default" + ): + return None + if isinstance(value, str) and ( + description.translation_key == "dehydration_speed" + or description.key == "temperature" + ): + try: + return cast("StateType", float(value)) + except ValueError: + return None + if description.device_class == SensorDeviceClass.TIMESTAMP: if not isinstance(value, (int, float)) or value <= 0: return None # round to the closest minute diff --git a/homeassistant/components/midea/strings.json b/homeassistant/components/midea/strings.json index 6a8ba527704e..66d9b9f47871 100644 --- a/homeassistant/components/midea/strings.json +++ b/homeassistant/components/midea/strings.json @@ -385,12 +385,94 @@ "current_energy_consumption": { "name": "Current energy consumption" }, + "dehydration_level": { + "name": "Dehydration level", + "state": { + "high": "[%key:common::state::high%]", + "low": "[%key:common::state::low%]", + "medium": "[%key:common::state::medium%]", + "none": "None" + } + }, + "dehydration_speed": { + "name": "Dehydration speed" + }, "dehydration_time": { "name": "Dehydration time" }, + "detergent": { + "name": "Detergent", + "state": { + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "insufficient": "Insufficient", + "less": "Less", + "medium": "[%key:common::state::medium%]", + "more": "More", + "no": "None" + } + }, "discharge_pipe_temperature": { "name": "Discharge pipe temperature" }, + "dry_program": { + "name": "Dry program", + "state": { + "air_wash": "Air wash", + "baby_clothes": "Baby clothes", + "bed_clothes": "Bed clothes", + "bedsheet": "Bedsheet", + "big": "Big", + "big_60": "Big 60", + "big_dry": "Big dry", + "bracket_dry": "Bracket dry", + "bucket_self_clean": "Bucket self clean", + "cold_air_fresh_air": "Cold air fresh air", + "cotton": "Cotton", + "dehumidification": "Dehumidification", + "dehumidify": "Dehumidify", + "down_jacket": "Down jacket", + "eco_dry": "Eco dry", + "enzyme": "Enzyme", + "fiber": "Fiber", + "fixed_time_dry": "Fixed time dry", + "four_piece_suit": "Four piece suit", + "fresh_air": "Fresh air", + "fresh_remove_smell": "Fresh remove smell", + "hot_air_dry": "Hot air dry", + "intelligent_dry": "Intelligent dry", + "jean": "Jeans", + "little_fast_dry": "Little fast dry", + "low_temp_dry": "Low temperature dry", + "mixed_wash": "Mixed wash", + "night_dry": "Night dry", + "outdoor": "Outdoor", + "plush": "Plush", + "quick_dry": "Quick dry", + "quick_dry_20": "Quick dry 20", + "quick_dry_30": "Quick dry 30", + "shirt": "Shirt", + "silk": "Silk", + "small_piece_dry": "Small piece dry", + "smart_dry": "Smart dry", + "sport_clothes": "Sport clothes", + "standard": "Standard", + "steam_care": "Steam care", + "steam_no_iron": "Steam no iron", + "steam_sterilize": "Steam sterilize", + "sterilize": "Sterilize", + "sun_quilt": "Sun quilt", + "towel": "Towel", + "underwear": "Underwear", + "warm_clothes": "Warm clothes", + "western_trouser": "Western trouser", + "wool": "Wool", + "wool_nurse": "Wool nurse" + } + }, "dry_temperature": { "name": "Dry temperature" }, @@ -602,6 +684,21 @@ "soak_time": { "name": "Soak time" }, + "softener": { + "name": "Softener", + "state": { + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "insufficient": "Insufficient", + "intelligent": "Intelligent", + "no": "None", + "programed": "Programmed" + } + }, "softwater_available": { "name": "Soft water available" }, @@ -609,10 +706,17 @@ "name": "Status", "state": { "delay": "Delayed", + "delay_choosing": "Delay choosing", + "delay_pause": "Delay paused", + "end": "End", + "fault": "[%key:common::state::fault%]", "finished": "Finished", "idle": "[%key:common::state::idle%]", + "pause": "[%key:common::state::paused%]", "paused": "[%key:common::state::paused%]", + "prevent_wrinkle_end": "Prevent wrinkle end", "standby": "[%key:common::state::standby%]", + "start": "Start", "working": "Working" } }, @@ -677,6 +781,129 @@ "zero_fresh": "Zero fresh" } }, + "wash_program": { + "name": "Wash program", + "state": { + "air_dry": "Air dry", + "air_wash": "Air wash", + "allergy_care": "Allergy care", + "aromatherapy": "Aromatherapy", + "baby_clothes": "Baby clothes", + "baby_clothes_min": "Baby clothes min", + "bath_towel": "Bath towel", + "big": "Big", + "blanket": "Blanket", + "bucket_dry": "Bucket dry", + "bucket_self_clean": "Bucket self clean", + "bulky": "Bulky", + "child": "Child", + "cold_wash": "Cold wash", + "color": "Color", + "cook_wash": "Cook wash", + "cotton": "Cotton", + "dehydration_min": "Dehydration min", + "diy0": "DIY 0", + "diy2": "DIY 2", + "down_jacket": "Down jacket", + "eco": "Eco", + "eco_40_60": "Eco 40-60", + "embathe": "Embathe", + "enzyme": "Enzyme", + "fast": "Fast", + "fast_dry": "Fast dry", + "fast_wash": "Fast wash", + "fast_wash_30": "Fast wash 30", + "fast_wash_60": "Fast wash 60", + "fast_wash_min": "Fast wash min", + "fiber": "Fiber", + "fitness_clothes": "Fitness clothes", + "fresh_air": "Fresh air", + "fresh_remove_wrinkle": "Fresh remove wrinkle", + "green_wool": "Green wool", + "heart_wash": "Heart wash", + "insight_wash": "Insight wash", + "intelligent": "Intelligent", + "jacket": "Jacket", + "jean": "Jean", + "kids": "Kids", + "love": "Love", + "memory": "Memory", + "mink": "Mink", + "mixed_wash": "Mixed wash", + "mixed_wash_min": "Mixed wash min", + "mute": "Mute", + "new_clothes_wash": "New clothes wash", + "new_water_cotton": "New water cotton", + "night_fresh_wash": "Night fresh wash", + "outdoor": "Outdoor", + "prevent_allergy": "Prevent allergy", + "quick_wash": "Quick wash", + "remove_mite_wash": "Remove mite wash", + "rinsing_dehydration": "Rinsing dehydration", + "self_wash_5": "Self wash 5", + "self_wash_min": "Self wash min", + "shirt": "Shirt", + "silk": "Silk", + "silk_wash": "Silk wash", + "single_dehytration": "Single dehydration", + "single_drying": "Single drying", + "soft_wash": "Soft wash", + "specialist": "Specialist", + "sport_clothes": "Sport clothes", + "spring_autumn_wash": "Spring autumn wash", + "ssp": "SSP", + "standard": "Standard", + "steam_care": "Steam care", + "steam_sterilize_wash": "Steam sterilize wash", + "steep": "Steep", + "sterilize_wash": "Sterilize wash", + "stir": "Stir", + "summer_wash": "Summer wash", + "time_dry": "Time dry", + "wash_and_dry": "Wash and dry", + "wash_drying_60": "Wash and dry 60", + "water_cold_wash": "Water cold wash", + "water_cotton": "Water cotton", + "water_eco": "Water eco", + "water_fast_wash_30": "Water fast wash 30", + "water_fiber": "Water fiber", + "water_intelligent": "Water intelligent", + "water_intense_wash": "Water intense wash", + "water_kids": "Water kids", + "water_mixed_wash": "Water mixed wash", + "water_outdoor": "Water outdoor", + "water_prevent_allergy": "Water prevent allergy", + "water_remove_mite_wash": "Water remove mite wash", + "water_ssp": "Water SSP", + "water_steep": "Water steep", + "water_underwear": "Water underwear", + "winter_wash": "Winter wash", + "wool": "Wool" + } + }, + "wash_progress": { + "name": "Wash progress", + "state": { + "dry": "Drying", + "hi_speed_spin": "High Speed Spinning", + "idle": "[%key:common::state::idle%]", + "pre_wash": "Pre-washing", + "rinse": "Rinsing", + "soak": "Soaking", + "spin": "Spinning", + "wash": "Washing", + "weight": "Weighing" + } + }, + "wash_strength": { + "name": "Wash strength", + "state": { + "medium": "[%key:common::state::medium%]", + "none": "None", + "strong": "Strong", + "weak": "Weak" + } + }, "wash_time": { "name": "Wash time" }, @@ -689,6 +916,16 @@ "water_consumption_big": { "name": "Water consumption aggregated" }, + "water_level": { + "name": "Water level", + "state": { + "4": "4", + "auto": "[%key:common::state::auto%]", + "high": "[%key:common::state::high%]", + "low": "[%key:common::state::low%]", + "mid": "[%key:common::state::medium%]" + } + }, "water_temperature": { "name": "Water temperature" } diff --git a/tests/components/midea/snapshots/test_sensor.ambr b/tests/components/midea/snapshots/test_sensor.ambr index 3295d1abbcf8..b5af03937a39 100644 --- a/tests/components/midea/snapshots/test_sensor.ambr +++ b/tests/components/midea/snapshots/test_sensor.ambr @@ -405,6 +405,490 @@ 'state': '21.5', }) # --- +# name: test_all_entities[da][sensor.top_load_washer_dehydration_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'none', + 'low', + 'medium', + 'high', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_dehydration_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dehydration level', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Dehydration level', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dehydration_level', + 'unique_id': '12345678_dehydration_level', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_dehydration_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Dehydration level', + : list([ + 'none', + 'low', + 'medium', + 'high', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_dehydration_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'low', + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_detergent-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'no', + 'less', + 'medium', + 'more', + '4', + '5', + '6', + '7', + '8', + 'insufficient', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_detergent', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Detergent', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Detergent', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'detergent', + 'unique_id': '12345678_detergent', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_detergent-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Detergent', + : list([ + 'no', + 'less', + 'medium', + 'more', + '4', + '5', + '6', + '7', + '8', + 'insufficient', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_detergent', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'no', + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_softener-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'no', + 'intelligent', + 'programed', + '3', + '4', + '5', + '6', + '7', + '8', + 'insufficient', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_softener', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Softener', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Softener', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'softener', + 'unique_id': '12345678_softener', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_softener-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Softener', + : list([ + 'no', + 'intelligent', + 'programed', + '3', + '4', + '5', + '6', + '7', + '8', + 'insufficient', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_softener', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_program-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'standard', + 'fast', + 'blanket', + 'wool', + 'embathe', + 'memory', + 'child', + 'down_jacket', + 'stir', + 'mute', + 'bucket_self_clean', + 'air_dry', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_wash_program', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash program', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash program', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_program', + 'unique_id': '12345678_program', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_program-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Wash program', + : list([ + 'standard', + 'fast', + 'blanket', + 'wool', + 'embathe', + 'memory', + 'child', + 'down_jacket', + 'stir', + 'mute', + 'bucket_self_clean', + 'air_dry', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_wash_program', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'wool', + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'idle', + 'spin', + 'rinse', + 'wash', + 'weight', + 'dry', + 'soak', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_wash_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash progress', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash progress', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_progress', + 'unique_id': '12345678_progress', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Wash progress', + : list([ + 'idle', + 'spin', + 'rinse', + 'wash', + 'weight', + 'dry', + 'soak', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_wash_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'weight', + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_strength-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'none', + 'weak', + 'medium', + 'strong', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.top_load_washer_wash_strength', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash strength', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash strength', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_strength', + 'unique_id': '12345678_wash_strength', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da][sensor.top_load_washer_wash_strength-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Top Load Washer Wash strength', + : list([ + 'none', + 'weak', + 'medium', + 'strong', + ]), + }), + 'context': , + 'entity_id': 'sensor.top_load_washer_wash_strength', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'weak', + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_dehydration_speed-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_dehydration_speed', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dehydration speed', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Dehydration speed', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dehydration_speed', + 'unique_id': '12345678_dehydration_speed', + 'unit_of_measurement': 'rpm', + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_dehydration_speed-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Front Load Washer Dehydration speed', + : , + : 'rpm', + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_dehydration_speed', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '1400.0', + }) +# --- # name: test_all_entities[db][sensor.front_load_washer_dehydration_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -527,6 +1011,76 @@ 'state': 'normal', }) # --- +# name: test_all_entities[db][sensor.front_load_washer_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'idle', + 'standby', + 'start', + 'pause', + 'end', + 'fault', + 'delay', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Status', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Status', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'status', + 'unique_id': '12345678_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Front Load Washer Status', + : list([ + 'idle', + 'standby', + 'start', + 'pause', + 'end', + 'fault', + 'delay', + ]), + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'pause', + }) +# --- # name: test_all_entities[db][sensor.front_load_washer_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -582,7 +1136,307 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '22.0', + 'state': '60.0', + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_wash_program-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'cotton', + 'eco', + 'fast_wash', + 'mixed_wash', + 'fiber', + 'wool', + 'enzyme', + 'ssp', + 'sport_clothes', + 'single_dehytration', + 'rinsing_dehydration', + 'big', + 'baby_clothes', + 'outdoor', + 'air_wash', + 'down_jacket', + 'color', + 'intelligent', + 'quick_wash', + 'kids', + 'water_cotton', + 'single_drying', + 'fast_wash_30', + 'fast_wash_60', + 'water_intelligent', + 'water_steep', + 'water_fast_wash_30', + 'shirt', + 'steep', + 'new_water_cotton', + 'water_mixed_wash', + 'water_fiber', + 'water_kids', + 'water_underwear', + 'specialist', + 'water_eco', + 'wash_drying_60', + 'self_wash_5', + 'fast_wash_min', + 'mixed_wash_min', + 'dehydration_min', + 'self_wash_min', + 'baby_clothes_min', + 'prevent_allergy', + 'cold_wash', + 'soft_wash', + 'remove_mite_wash', + 'water_intense_wash', + 'fast_dry', + 'water_outdoor', + 'spring_autumn_wash', + 'summer_wash', + 'winter_wash', + 'jean', + 'new_clothes_wash', + 'silk', + 'insight_wash', + 'fitness_clothes', + 'mink', + 'fresh_air', + 'bucket_dry', + 'jacket', + 'bath_towel', + 'night_fresh_wash', + 'diy0', + 'diy2', + 'heart_wash', + 'water_cold_wash', + 'water_prevent_allergy', + 'water_remove_mite_wash', + 'water_ssp', + 'silk_wash', + 'standard', + 'green_wool', + 'cook_wash', + 'fresh_remove_wrinkle', + 'steam_sterilize_wash', + 'aromatherapy', + 'eco_40_60', + 'steam_care', + 'allergy_care', + 'sterilize_wash', + 'wash_and_dry', + 'time_dry', + 'bulky', + 'love', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_wash_program', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash program', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash program', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_program', + 'unique_id': '12345678_program', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_wash_program-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Front Load Washer Wash program', + : list([ + 'cotton', + 'eco', + 'fast_wash', + 'mixed_wash', + 'fiber', + 'wool', + 'enzyme', + 'ssp', + 'sport_clothes', + 'single_dehytration', + 'rinsing_dehydration', + 'big', + 'baby_clothes', + 'outdoor', + 'air_wash', + 'down_jacket', + 'color', + 'intelligent', + 'quick_wash', + 'kids', + 'water_cotton', + 'single_drying', + 'fast_wash_30', + 'fast_wash_60', + 'water_intelligent', + 'water_steep', + 'water_fast_wash_30', + 'shirt', + 'steep', + 'new_water_cotton', + 'water_mixed_wash', + 'water_fiber', + 'water_kids', + 'water_underwear', + 'specialist', + 'water_eco', + 'wash_drying_60', + 'self_wash_5', + 'fast_wash_min', + 'mixed_wash_min', + 'dehydration_min', + 'self_wash_min', + 'baby_clothes_min', + 'prevent_allergy', + 'cold_wash', + 'soft_wash', + 'remove_mite_wash', + 'water_intense_wash', + 'fast_dry', + 'water_outdoor', + 'spring_autumn_wash', + 'summer_wash', + 'winter_wash', + 'jean', + 'new_clothes_wash', + 'silk', + 'insight_wash', + 'fitness_clothes', + 'mink', + 'fresh_air', + 'bucket_dry', + 'jacket', + 'bath_towel', + 'night_fresh_wash', + 'diy0', + 'diy2', + 'heart_wash', + 'water_cold_wash', + 'water_prevent_allergy', + 'water_remove_mite_wash', + 'water_ssp', + 'silk_wash', + 'standard', + 'green_wool', + 'cook_wash', + 'fresh_remove_wrinkle', + 'steam_sterilize_wash', + 'aromatherapy', + 'eco_40_60', + 'steam_care', + 'allergy_care', + 'sterilize_wash', + 'wash_and_dry', + 'time_dry', + 'bulky', + 'love', + ]), + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_wash_program', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'cotton', + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_wash_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'idle', + 'spin', + 'rinse', + 'wash', + 'pre_wash', + 'dry', + 'weight', + 'hi_speed_spin', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_wash_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash progress', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash progress', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_progress', + 'unique_id': '12345678_progress', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_wash_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Front Load Washer Wash progress', + : list([ + 'idle', + 'spin', + 'rinse', + 'wash', + 'pre_wash', + 'dry', + 'weight', + 'hi_speed_spin', + ]), + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_wash_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'rinse', }) # --- # name: test_all_entities[db][sensor.front_load_washer_wash_time-entry] @@ -643,6 +1497,72 @@ 'state': '65', }) # --- +# name: test_all_entities[db][sensor.front_load_washer_water_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'low', + 'mid', + 'high', + '4', + 'auto', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_water_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Water level', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Water level', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'water_level', + 'unique_id': '12345678_water_level', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[db][sensor.front_load_washer_water_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Front Load Washer Water level', + : list([ + 'low', + 'mid', + 'high', + '4', + 'auto', + ]), + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_water_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'low', + }) +# --- # name: test_all_entities[db_unknown_attributes][sensor.front_load_washer_dehydration_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -820,7 +1740,235 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '22.0', + 'state': '70.0', + }) +# --- +# name: test_all_entities[db_unknown_attributes][sensor.front_load_washer_wash_program-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'cotton', + 'eco', + 'fast_wash', + 'mixed_wash', + 'fiber', + 'wool', + 'enzyme', + 'ssp', + 'sport_clothes', + 'single_dehytration', + 'rinsing_dehydration', + 'big', + 'baby_clothes', + 'outdoor', + 'air_wash', + 'down_jacket', + 'color', + 'intelligent', + 'quick_wash', + 'kids', + 'water_cotton', + 'single_drying', + 'fast_wash_30', + 'fast_wash_60', + 'water_intelligent', + 'water_steep', + 'water_fast_wash_30', + 'shirt', + 'steep', + 'new_water_cotton', + 'water_mixed_wash', + 'water_fiber', + 'water_kids', + 'water_underwear', + 'specialist', + 'water_eco', + 'wash_drying_60', + 'self_wash_5', + 'fast_wash_min', + 'mixed_wash_min', + 'dehydration_min', + 'self_wash_min', + 'baby_clothes_min', + 'prevent_allergy', + 'cold_wash', + 'soft_wash', + 'remove_mite_wash', + 'water_intense_wash', + 'fast_dry', + 'water_outdoor', + 'spring_autumn_wash', + 'summer_wash', + 'winter_wash', + 'jean', + 'new_clothes_wash', + 'silk', + 'insight_wash', + 'fitness_clothes', + 'mink', + 'fresh_air', + 'bucket_dry', + 'jacket', + 'bath_towel', + 'night_fresh_wash', + 'diy0', + 'diy2', + 'heart_wash', + 'water_cold_wash', + 'water_prevent_allergy', + 'water_remove_mite_wash', + 'water_ssp', + 'silk_wash', + 'standard', + 'green_wool', + 'cook_wash', + 'fresh_remove_wrinkle', + 'steam_sterilize_wash', + 'aromatherapy', + 'eco_40_60', + 'steam_care', + 'allergy_care', + 'sterilize_wash', + 'wash_and_dry', + 'time_dry', + 'bulky', + 'love', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.front_load_washer_wash_program', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Wash program', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wash program', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'wash_program', + 'unique_id': '12345678_program', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[db_unknown_attributes][sensor.front_load_washer_wash_program-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Front Load Washer Wash program', + : list([ + 'cotton', + 'eco', + 'fast_wash', + 'mixed_wash', + 'fiber', + 'wool', + 'enzyme', + 'ssp', + 'sport_clothes', + 'single_dehytration', + 'rinsing_dehydration', + 'big', + 'baby_clothes', + 'outdoor', + 'air_wash', + 'down_jacket', + 'color', + 'intelligent', + 'quick_wash', + 'kids', + 'water_cotton', + 'single_drying', + 'fast_wash_30', + 'fast_wash_60', + 'water_intelligent', + 'water_steep', + 'water_fast_wash_30', + 'shirt', + 'steep', + 'new_water_cotton', + 'water_mixed_wash', + 'water_fiber', + 'water_kids', + 'water_underwear', + 'specialist', + 'water_eco', + 'wash_drying_60', + 'self_wash_5', + 'fast_wash_min', + 'mixed_wash_min', + 'dehydration_min', + 'self_wash_min', + 'baby_clothes_min', + 'prevent_allergy', + 'cold_wash', + 'soft_wash', + 'remove_mite_wash', + 'water_intense_wash', + 'fast_dry', + 'water_outdoor', + 'spring_autumn_wash', + 'summer_wash', + 'winter_wash', + 'jean', + 'new_clothes_wash', + 'silk', + 'insight_wash', + 'fitness_clothes', + 'mink', + 'fresh_air', + 'bucket_dry', + 'jacket', + 'bath_towel', + 'night_fresh_wash', + 'diy0', + 'diy2', + 'heart_wash', + 'water_cold_wash', + 'water_prevent_allergy', + 'water_remove_mite_wash', + 'water_ssp', + 'silk_wash', + 'standard', + 'green_wool', + 'cook_wash', + 'fresh_remove_wrinkle', + 'steam_sterilize_wash', + 'aromatherapy', + 'eco_40_60', + 'steam_care', + 'allergy_care', + 'sterilize_wash', + 'wash_and_dry', + 'time_dry', + 'bulky', + 'love', + ]), + }), + 'context': , + 'entity_id': 'sensor.front_load_washer_wash_program', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', }) # --- # name: test_all_entities[db_unknown_attributes][sensor.front_load_washer_wash_time-entry] @@ -881,6 +2029,238 @@ 'state': '65', }) # --- +# name: test_all_entities[dc][sensor.clothes_dryer_dry_program-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'cotton', + 'fiber', + 'mixed_wash', + 'jean', + 'bedsheet', + 'outdoor', + 'down_jacket', + 'plush', + 'wool', + 'dehumidify', + 'cold_air_fresh_air', + 'hot_air_dry', + 'sport_clothes', + 'underwear', + 'baby_clothes', + 'shirt', + 'standard', + 'quick_dry', + 'fresh_air', + 'low_temp_dry', + 'eco_dry', + 'quick_dry_30', + 'towel', + 'intelligent_dry', + 'steam_care', + 'big', + 'fixed_time_dry', + 'night_dry', + 'bracket_dry', + 'western_trouser', + 'dehumidification', + 'smart_dry', + 'four_piece_suit', + 'warm_clothes', + 'quick_dry_20', + 'steam_sterilize', + 'enzyme', + 'big_60', + 'steam_no_iron', + 'air_wash', + 'bed_clothes', + 'little_fast_dry', + 'small_piece_dry', + 'big_dry', + 'wool_nurse', + 'sun_quilt', + 'fresh_remove_smell', + 'bucket_self_clean', + 'silk', + 'sterilize', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.clothes_dryer_dry_program', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dry program', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Dry program', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dry_program', + 'unique_id': '12345678_program', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[dc][sensor.clothes_dryer_dry_program-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Clothes Dryer Dry program', + : list([ + 'cotton', + 'fiber', + 'mixed_wash', + 'jean', + 'bedsheet', + 'outdoor', + 'down_jacket', + 'plush', + 'wool', + 'dehumidify', + 'cold_air_fresh_air', + 'hot_air_dry', + 'sport_clothes', + 'underwear', + 'baby_clothes', + 'shirt', + 'standard', + 'quick_dry', + 'fresh_air', + 'low_temp_dry', + 'eco_dry', + 'quick_dry_30', + 'towel', + 'intelligent_dry', + 'steam_care', + 'big', + 'fixed_time_dry', + 'night_dry', + 'bracket_dry', + 'western_trouser', + 'dehumidification', + 'smart_dry', + 'four_piece_suit', + 'warm_clothes', + 'quick_dry_20', + 'steam_sterilize', + 'enzyme', + 'big_60', + 'steam_no_iron', + 'air_wash', + 'bed_clothes', + 'little_fast_dry', + 'small_piece_dry', + 'big_dry', + 'wool_nurse', + 'sun_quilt', + 'fresh_remove_smell', + 'bucket_self_clean', + 'silk', + 'sterilize', + ]), + }), + 'context': , + 'entity_id': 'sensor.clothes_dryer_dry_program', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'bedsheet', + }) +# --- +# name: test_all_entities[dc][sensor.clothes_dryer_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'idle', + 'standby', + 'start', + 'pause', + 'end', + 'prevent_wrinkle_end', + 'delay_choosing', + 'fault', + 'delay', + 'delay_pause', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.clothes_dryer_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Status', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Status', + 'platform': 'midea', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'status', + 'unique_id': '12345678_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[dc][sensor.clothes_dryer_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Clothes Dryer Status', + : list([ + 'idle', + 'standby', + 'start', + 'pause', + 'end', + 'prevent_wrinkle_end', + 'delay_choosing', + 'fault', + 'delay', + 'delay_pause', + ]), + }), + 'context': , + 'entity_id': 'sensor.clothes_dryer_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'prevent_wrinkle_end', + }) +# --- # name: test_all_entities[e8][sensor.electric_slow_cooker_target_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/midea/test_sensor.py b/tests/components/midea/test_sensor.py index e97b664b29b7..28f530b197bd 100644 --- a/tests/components/midea/test_sensor.py +++ b/tests/components/midea/test_sensor.py @@ -9,7 +9,9 @@ from midealocal.devices.ac import DeviceAttributes as ACAttributes from midealocal.devices.b1 import DeviceAttributes as B1Attributes from midealocal.devices.c3 import DeviceAttributes as C3Attributes from midealocal.devices.ca import MideaCADevice +from midealocal.devices.da import DeviceAttributes as DAAttributes from midealocal.devices.db import DeviceAttributes as DBAttributes, MideaDBDevice +from midealocal.devices.dc import DeviceAttributes as DCAttributes from midealocal.devices.e8 import DeviceAttributes as E8Attributes from midealocal.devices.ea import DeviceAttributes as EAAttributes, MideaEADevice from midealocal.devices.ec import DeviceAttributes as ECAttributes, MideaECDevice @@ -97,27 +99,56 @@ from tests.common import MockConfigEntry, snapshot_platform ), id="e8", ), + pytest.param( + DummyDevice( + DeviceType.DA, + attributes={ + DAAttributes.progress: "weight", + DAAttributes.program: "wool", + DAAttributes.dehydration_speed: "low", + DAAttributes.detergent: "no", + DAAttributes.softener: "default", + DAAttributes.wash_strength: "weak", + }, + ), + id="da", + ), pytest.param( DummyDevice( DeviceType.DB, attributes={ DBAttributes.power: True, DBAttributes.mode: "normal", - DBAttributes.temperature: 22.0, + DBAttributes.temperature: "60", DBAttributes.wash_time: 65, DBAttributes.dehydration_time: 30, DBAttributes.program: "cotton", + DBAttributes.status: "pause", + DBAttributes.dehydration_speed: "1400", + DBAttributes.water_level: "low", + DBAttributes.progress: "rinse", }, ), id="db", ), + pytest.param( + DummyDevice( + DeviceType.DC, + attributes={ + DCAttributes.power: True, + DCAttributes.status: "prevent_wrinkle_end", + DCAttributes.program: "bedsheet", + }, + ), + id="dc", + ), pytest.param( DummyDevice( DeviceType.DB, attributes={ DBAttributes.power: False, DBAttributes.mode: "unknown", - DBAttributes.temperature: 22.0, + DBAttributes.temperature: "70", DBAttributes.wash_time: 65, DBAttributes.dehydration_time: 30, DBAttributes.program: "unknown", @@ -265,6 +296,39 @@ async def test_sensor_state_update( assert state.state == "unknown" +async def test_db_sensor_with_invalid_dehydration_speed( + hass: HomeAssistant, + set_device_attribute: SetDeviceAttribute, + mock_config_entry: Callable[[DummyDevice], MockConfigEntry], +) -> None: + """Test DB sensor with invalid dehydration_speed.""" + device = DummyDevice( + DeviceType.DB, + attributes={ + DBAttributes.power: True, + DBAttributes.mode: "normal", + DBAttributes.temperature: "40", + DBAttributes.wash_time: 65, + DBAttributes.dehydration_time: 30, + DBAttributes.program: "cotton", + DBAttributes.status: "pause", + DBAttributes.dehydration_speed: "-", + DBAttributes.water_level: "low", + DBAttributes.progress: "rinse", + }, + ) + config_entry = mock_config_entry(device) + with patch("homeassistant.components.midea._PLATFORMS", [Platform.SENSOR]): + await setup_integration(hass, config_entry, device) + + entity_entry = entity_entries(hass, config_entry)[ + f"{TEST_DEVICE_ID}_dehydration_speed" + ] + state = hass.states.get(entity_entry.entity_id) + assert state is not None + assert state.state == "unknown" + + async def test_time_remaining_sensor_as_timestamp( hass: HomeAssistant, freezer: FrozenDateTimeFactory,