diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index a057be0ebd3120..d4d512ed4f93ad 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -26,6 +26,7 @@ UnitOfPower, UnitOfPressure, UnitOfTemperature, + UnitOfTime, UnitOfVolume, ) from homeassistant.core import HomeAssistant @@ -141,7 +142,64 @@ "UVPaused": "uv_paused", } -WASHER_OPTIONS = ["pause", "run", "stop"] +DISHWASHER_MACHINE_STATE_OPTIONS = ["pause", "run", "stop"] +WASHER_MACHINE_STATE_OPTIONS = [ + "pause", + "paused", + "ready", + "run", + "running", + "stop", +] + + +WASHER_CYCLES = [ + "1c", + "2b", + "1b", + "1e", + "1d", + "96", + "8f", + "25", + "26", + "33", + "24", + "32", + "20", + "22", + "23", + "2f", + "21", + "66", + "2e", + "2d", + "30", + "29", + "27", + "28", +] + +DRYER_CYCLES = [ + "51", + "53", + "23", + "17", + "18", + "19", + "1d", + "1b", + "1c", + "21", + "1a", + "1e", + "20", + "27", + "25", + "24", + "4e", + "4c", +] def power_attributes(status: dict[str, Any]) -> dict[str, Any]: @@ -153,6 +211,18 @@ def power_attributes(status: dict[str, Any]) -> dict[str, Any]: return state +def _normalize_cycle_value(value: Any) -> str | None: + """Normalize washer/dryer cycle names.""" + if not value: + return None + value_str = str(value) + return ( + value_str.rsplit("_", maxsplit=1)[-1].lower() + if "_" in value_str + else value_str.lower() + ) + + @dataclass(frozen=True, kw_only=True) class SmartThingsSensorEntityDescription(SensorEntityDescription): """Describe a SmartThings sensor entity.""" @@ -365,7 +435,7 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription): SmartThingsSensorEntityDescription( key=Attribute.MACHINE_STATE, translation_key="dishwasher_machine_state", - options=WASHER_OPTIONS, + options=DISHWASHER_MACHINE_STATE_OPTIONS, device_class=SensorDeviceClass.ENUM, ) ], @@ -413,7 +483,7 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription): SmartThingsSensorEntityDescription( key=Attribute.MACHINE_STATE, translation_key="dryer_machine_state", - options=WASHER_OPTIONS, + options=WASHER_MACHINE_STATE_OPTIONS, device_class=SensorDeviceClass.ENUM, ) ], @@ -1153,7 +1223,7 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription): SmartThingsSensorEntityDescription( key=Attribute.MACHINE_STATE, translation_key="washer_machine_state", - options=WASHER_OPTIONS, + options=WASHER_MACHINE_STATE_OPTIONS, device_class=SensorDeviceClass.ENUM, component_fn=lambda component: component == "sub", component_translation_key={ @@ -1278,6 +1348,74 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription): ) ] }, + Capability.SAMSUNG_CE_WASHER_CYCLE: { + Attribute.WASHER_CYCLE: [ + SmartThingsSensorEntityDescription( + key=Attribute.WASHER_CYCLE, + translation_key="washer_cycle", + icon="mdi:washing-machine", + options=WASHER_CYCLES, + options_attribute=Attribute.SUPPORTED_CYCLES, + device_class=SensorDeviceClass.ENUM, + value_fn=_normalize_cycle_value, + ) + ] + }, + Capability.SAMSUNG_CE_DRYER_CYCLE: { + Attribute.DRYER_CYCLE: [ + SmartThingsSensorEntityDescription( + key=Attribute.DRYER_CYCLE, + translation_key="dryer_cycle", + icon="mdi:tumble-dryer", + options=DRYER_CYCLES, + options_attribute=Attribute.SUPPORTED_CYCLES, + device_class=SensorDeviceClass.ENUM, + value_fn=_normalize_cycle_value, + ) + ] + }, + Capability.SAMSUNG_CE_WASHER_OPERATING_STATE: { + Attribute.PROGRESS: [ + SmartThingsSensorEntityDescription( + key=Attribute.PROGRESS, + translation_key="washer_progress", + icon="mdi:washing-machine", + state_class=SensorStateClass.MEASUREMENT, + native_unit_of_measurement=PERCENTAGE, + ) + ], + Attribute.REMAINING_TIME: [ + SmartThingsSensorEntityDescription( + key=Attribute.REMAINING_TIME, + translation_key="washer_remaining_time", + icon="mdi:timer-sand", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.DURATION, + native_unit_of_measurement=UnitOfTime.MINUTES, + ) + ], + }, + Capability.SAMSUNG_CE_DRYER_OPERATING_STATE: { + Attribute.PROGRESS: [ + SmartThingsSensorEntityDescription( + key=Attribute.PROGRESS, + translation_key="dryer_progress", + icon="mdi:tumble-dryer", + state_class=SensorStateClass.MEASUREMENT, + native_unit_of_measurement=PERCENTAGE, + ) + ], + Attribute.REMAINING_TIME: [ + SmartThingsSensorEntityDescription( + key=Attribute.REMAINING_TIME, + translation_key="dryer_remaining_time", + icon="mdi:timer-sand", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.DURATION, + native_unit_of_measurement=UnitOfTime.MINUTES, + ) + ], + }, } @@ -1461,13 +1599,48 @@ def extra_state_attributes(self) -> Mapping[str, Any] | None: def options(self) -> list[str] | None: """Return the options for this sensor.""" if self.entity_description.options_attribute: - if ( - options := self.get_attribute_value( - self.capability, self.entity_description.options_attribute - ) - ) is None: + options_val = self.get_attribute_value( + self.capability, self.entity_description.options_attribute + ) + if options_val is not None: + options_list = [] + for option in options_val: + if isinstance(option, dict): + opt_val = option.get("cycle") + else: + opt_val = option + if opt_val is not None: + if options_map := self.entity_description.options_map: + opt_val = options_map.get(opt_val, opt_val) + else: + opt_val = self.entity_description.value_fn(opt_val) + if self.entity_description.presentation_fn: + opt_val = self.entity_description.presentation_fn( + self.device.device.presentation_id, opt_val + ) + if opt_val is not None: + options_list.append(str(opt_val).lower()) + # Fall back to static options in description if attribute is missing/None + elif (static_options := super().options) is not None: + options_list = [str(opt).lower() for opt in static_options] + else: return [] - if options_map := self.entity_description.options_map: - return [options_map[option] for option in options] - return [option.lower() for option in options] - return super().options + elif (static_options := super().options) is not None: + options_list = [str(opt).lower() for opt in static_options] + else: + return None + + # Deduplicate while preserving order + seen: set[str] = set() + unique_options: list[str] = [] + for opt in options_list: + if opt not in seen: + seen.add(opt) + unique_options.append(opt) + + if (current_value := self.native_value) is not None: + current_value_str = str(current_value).lower() + if current_value_str not in seen: + unique_options.append(current_value_str) + + return unique_options diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index cf4653c55cb47a..f28603953b16ba 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -505,6 +505,29 @@ "tank": "Tank" } }, + "dryer_cycle": { + "name": "Dryer cycle", + "state": { + "1a": "Wool", + "1b": "Bedding", + "1c": "Shirts", + "1d": "Towels", + "1e": "Outdoor", + "4c": "Air Refresh", + "4e": "Self Dry", + "17": "Super Speed", + "18": "Synthetics", + "19": "Delicates", + "20": "Iron Dry", + "21": "Hygiene Care", + "23": "Quick Dry 35'", + "24": "Cool Air", + "25": "Warm Air", + "27": "Time Dry", + "51": "Eco Cotton", + "53": "AI Dry+" + } + }, "dryer_job_state": { "name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]", "state": { @@ -529,13 +552,22 @@ "name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]", "state": { "pause": "[%key:common::state::paused%]", + "paused": "[%key:common::state::paused%]", + "ready": "[%key:component::smartthings::entity::sensor::oven_machine_state::state::ready%]", "run": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", + "running": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", "stop": "[%key:common::state::stopped%]" } }, "dryer_mode": { "name": "Dryer mode" }, + "dryer_progress": { + "name": "Drying progress" + }, + "dryer_remaining_time": { + "name": "Dryer remaining time" + }, "energy_difference": { "name": "Energy difference" }, @@ -918,6 +950,35 @@ "uv_index": { "name": "UV index" }, + "washer_cycle": { + "name": "Washer cycle", + "state": { + "1b": "Cotton", + "1c": "Eco 40-60", + "1d": "Super Speed", + "1e": "15' Quick Wash", + "2b": "AI Wash", + "2d": "Silent Wash", + "2e": "Baby Care", + "2f": "Activewear", + "8f": "Intense Cold", + "20": "Hygiene Steam", + "21": "Colors", + "22": "Wool", + "23": "Outdoor", + "24": "Bedding", + "25": "Synthetics", + "26": "Delicates", + "27": "Rinse+Spin", + "28": "Drain/Spin", + "29": "Drum Clean+", + "30": "Cloudy day", + "32": "Shirts", + "33": "Towels", + "66": "Denim", + "96": "Less Microfiber" + } + }, "washer_job_state": { "name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]", "state": { @@ -943,13 +1004,22 @@ "name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]", "state": { "pause": "[%key:common::state::paused%]", + "paused": "[%key:common::state::paused%]", + "ready": "[%key:component::smartthings::entity::sensor::oven_machine_state::state::ready%]", "run": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", + "running": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", "stop": "[%key:common::state::stopped%]" } }, "washer_mode": { "name": "Washer mode" }, + "washer_progress": { + "name": "Washing progress" + }, + "washer_remaining_time": { + "name": "Washer remaining time" + }, "washer_sub_completion_time": { "name": "Upper washer completion time" }, @@ -978,7 +1048,10 @@ "name": "Upper washer machine state", "state": { "pause": "[%key:common::state::paused%]", + "paused": "[%key:common::state::paused%]", + "ready": "[%key:component::smartthings::entity::sensor::oven_machine_state::state::ready%]", "run": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", + "running": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", "stop": "[%key:common::state::stopped%]" } }, diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index f36a638ed32348..9135dd75aa62b6 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -15484,7 +15484,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -15525,7 +15528,10 @@ 'friendly_name': 'AirDresser Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -15706,6 +15712,201 @@ 'state': '2025-02-08T19:25:10+00:00', }) # --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_dryer_cycle-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + '01', + '9c', + 'a5', + '9e', + '9b', + '27', + 'e5', + 'a0', + 'a4', + 'a6', + 'a3', + 'a2', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_dryer_dryer_cycle', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dryer cycle', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Dryer cycle', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_cycle', + 'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_samsungce.dryerCycle_dryerCycle_dryerCycle', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_dryer_cycle-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Dryer Dryer cycle', + 'icon': 'mdi:tumble-dryer', + 'options': list([ + '01', + '9c', + 'a5', + '9e', + '9b', + '27', + 'e5', + 'a0', + 'a4', + 'a6', + 'a3', + 'a2', + ]), + }), + 'context': , + 'entity_id': 'sensor.theater_dryer_dryer_cycle', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '01', + }) +# --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_dryer_remaining_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_dryer_dryer_remaining_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dryer remaining time', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Dryer remaining time', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_remaining_time', + 'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_samsungce.dryerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', + }) +# --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_dryer_remaining_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'duration', + 'friendly_name': 'Dryer Dryer remaining time', + 'icon': 'mdi:timer-sand', + 'state_class': , + 'unit_of_measurement': 'min', + }), + 'context': , + 'entity_id': 'sensor.theater_dryer_dryer_remaining_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '75', + }) +# --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_drying_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_dryer_drying_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Drying progress', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Drying progress', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_progress', + 'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_samsungce.dryerOperatingState_progress_progress', + 'unit_of_measurement': '%', + }) +# --- +# name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_drying_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Dryer Drying progress', + 'icon': 'mdi:tumble-dryer', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.theater_dryer_drying_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '1', + }) +# --- # name: test_all_entities[da_wm_wd_000001][sensor.theater_dryer_energy-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -15975,7 +16176,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -16016,7 +16220,10 @@ 'friendly_name': 'Dryer Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -16197,14 +16404,29 @@ 'state': '2025-03-09T22:55:37+00:00', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy-entry] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_dryer_cycle-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'options': list([ + '9a', + 'ca', + 'db', + '99', + '93', + 'b5', + 'd7', + 'a5', + '96', + '97', + '7f', + '98', + 'eb', + 'b6', + ]), }), 'config_entry_id': , 'config_subentry_id': , @@ -16213,7 +16435,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.seca_roupa_energy', + 'entity_id': 'sensor.seca_roupa_dryer_cycle', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -16221,48 +16443,60 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Energy', + 'object_id_base': 'Dryer cycle', 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Energy', + 'original_device_class': , + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Dryer cycle', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, - 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_energy_meter', - 'unit_of_measurement': , + 'translation_key': 'dryer_cycle', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_samsungce.dryerCycle_dryerCycle_dryerCycle', + 'unit_of_measurement': None, }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy-state] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_dryer_cycle-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Seca-Roupa Energy', - 'state_class': , - 'unit_of_measurement': , + 'device_class': 'enum', + 'friendly_name': 'Seca-Roupa Dryer cycle', + 'icon': 'mdi:tumble-dryer', + 'options': list([ + '9a', + 'ca', + 'db', + '99', + '93', + 'b5', + 'd7', + 'a5', + '96', + '97', + '7f', + '98', + 'eb', + 'b6', + ]), }), 'context': , - 'entity_id': 'sensor.seca_roupa_energy', + 'entity_id': 'sensor.seca_roupa_dryer_cycle', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '796.4', + 'state': '9a', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_difference-entry] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_dryer_remaining_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -16271,7 +16505,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.seca_roupa_energy_difference', + 'entity_id': 'sensor.seca_roupa_dryer_remaining_time', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -16279,48 +16513,49 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Energy difference', + 'object_id_base': 'Dryer remaining time', 'options': dict({ 'sensor': dict({ 'suggested_display_precision': 2, }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Energy difference', + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Dryer remaining time', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'energy_difference', - 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_deltaEnergy_meter', - 'unit_of_measurement': , + 'translation_key': 'dryer_remaining_time', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_samsungce.dryerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_difference-state] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_dryer_remaining_time-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Seca-Roupa Energy difference', - 'state_class': , - 'unit_of_measurement': , + 'device_class': 'duration', + 'friendly_name': 'Seca-Roupa Dryer remaining time', + 'icon': 'mdi:timer-sand', + 'state_class': , + 'unit_of_measurement': 'min', }), 'context': , - 'entity_id': 'sensor.seca_roupa_energy_difference', + 'entity_id': 'sensor.seca_roupa_dryer_remaining_time', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '188', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_saved-entry] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_drying_progress-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -16329,7 +16564,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.seca_roupa_energy_saved', + 'entity_id': 'sensor.seca_roupa_drying_progress', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -16337,64 +16572,45 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Energy saved', + 'object_id_base': 'Drying progress', 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Energy saved', + 'original_device_class': None, + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Drying progress', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'energy_saved', - 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_energySaved_meter', - 'unit_of_measurement': , + 'translation_key': 'dryer_progress', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_samsungce.dryerOperatingState_progress_progress', + 'unit_of_measurement': '%', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_saved-state] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_drying_progress-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Seca-Roupa Energy saved', - 'state_class': , - 'unit_of_measurement': , + 'friendly_name': 'Seca-Roupa Drying progress', + 'icon': 'mdi:tumble-dryer', + 'state_class': , + 'unit_of_measurement': '%', }), 'context': , - 'entity_id': 'sensor.seca_roupa_energy_saved', + 'entity_id': 'sensor.seca_roupa_drying_progress', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '1', }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_job_state-entry] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'options': list([ - 'cooling', - 'delay_wash', - 'drying', - 'finished', - 'none', - 'refreshing', - 'weight_sensing', - 'wrinkle_prevent', - 'dehumidifying', - 'ai_drying', - 'sanitizing', - 'internal_care', - 'freeze_protection', - 'continuous_dehumidifying', - 'thawing_frozen_inside', - ]), + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -16403,7 +16619,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.seca_roupa_job_state', + 'entity_id': 'sensor.seca_roupa_energy', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -16411,25 +16627,215 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Job state', + 'object_id_base': 'Energy', 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), }), - 'original_device_class': , + 'original_device_class': , 'original_icon': None, - 'original_name': 'Job state', + 'original_name': 'Energy', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'dryer_job_state', - 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_dryerOperatingState_dryerJobState_dryerJobState', - 'unit_of_measurement': None, + 'translation_key': None, + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_energy_meter', + 'unit_of_measurement': , }) # --- -# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_job_state-state] +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'enum', + 'device_class': 'energy', + 'friendly_name': 'Seca-Roupa Energy', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.seca_roupa_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '796.4', + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_difference-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.seca_roupa_energy_difference', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Energy difference', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Energy difference', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'energy_difference', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_deltaEnergy_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_difference-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'Seca-Roupa Energy difference', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.seca_roupa_energy_difference', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_saved-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.seca_roupa_energy_saved', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Energy saved', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Energy saved', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'energy_saved', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_powerConsumptionReport_powerConsumption_energySaved_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_energy_saved-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'Seca-Roupa Energy saved', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.seca_roupa_energy_saved', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_job_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'cooling', + 'delay_wash', + 'drying', + 'finished', + 'none', + 'refreshing', + 'weight_sensing', + 'wrinkle_prevent', + 'dehumidifying', + 'ai_drying', + 'sanitizing', + 'internal_care', + 'freeze_protection', + 'continuous_dehumidifying', + 'thawing_frozen_inside', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.seca_roupa_job_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Job state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Job state', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_job_state', + 'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_dryerOperatingState_dryerJobState_dryerJobState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wd_000001_1][sensor.seca_roupa_job_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', 'friendly_name': 'Seca-Roupa Job state', 'options': list([ 'cooling', @@ -16466,7 +16872,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -16507,7 +16916,10 @@ 'friendly_name': 'Seca-Roupa Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -16688,6 +17100,215 @@ 'state': '2025-10-16T14:15:07+00:00', }) # --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_dryer_cycle-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + '51', + '53', + '23', + '17', + '18', + '19', + '1d', + '1b', + '1c', + '21', + '1a', + '1e', + '22', + '20', + '27', + '25', + '24', + '4e', + '4c', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.trockner_dryer_cycle', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dryer cycle', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Dryer cycle', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_cycle', + 'unique_id': '3d39866c-7716-5259-44f0-fd7025efd85f_main_samsungce.dryerCycle_dryerCycle_dryerCycle', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_dryer_cycle-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Trockner Dryer cycle', + 'icon': 'mdi:tumble-dryer', + 'options': list([ + '51', + '53', + '23', + '17', + '18', + '19', + '1d', + '1b', + '1c', + '21', + '1a', + '1e', + '22', + '20', + '27', + '25', + '24', + '4e', + '4c', + ]), + }), + 'context': , + 'entity_id': 'sensor.trockner_dryer_cycle', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '51', + }) +# --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_dryer_remaining_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.trockner_dryer_remaining_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dryer remaining time', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Dryer remaining time', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_remaining_time', + 'unique_id': '3d39866c-7716-5259-44f0-fd7025efd85f_main_samsungce.dryerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', + }) +# --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_dryer_remaining_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'duration', + 'friendly_name': 'Trockner Dryer remaining time', + 'icon': 'mdi:timer-sand', + 'state_class': , + 'unit_of_measurement': 'min', + }), + 'context': , + 'entity_id': 'sensor.trockner_dryer_remaining_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '270', + }) +# --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_drying_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.trockner_drying_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Drying progress', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:tumble-dryer', + 'original_name': 'Drying progress', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'dryer_progress', + 'unique_id': '3d39866c-7716-5259-44f0-fd7025efd85f_main_samsungce.dryerOperatingState_progress_progress', + 'unit_of_measurement': '%', + }) +# --- +# name: test_all_entities[da_wm_wd_01011][sensor.trockner_drying_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Trockner Drying progress', + 'icon': 'mdi:tumble-dryer', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.trockner_drying_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '1', + }) +# --- # name: test_all_entities[da_wm_wd_01011][sensor.trockner_energy-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -16957,7 +17578,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -16998,7 +17622,10 @@ 'friendly_name': 'Trockner Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -17434,14 +18061,200 @@ ]), }), 'context': , - 'entity_id': 'sensor.theater_washer_job_state', + 'entity_id': 'sensor.theater_washer_job_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'none', + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_machine_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_washer_machine_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Machine state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Machine state', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_machine_state', + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_machine_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Washer Machine state', + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'context': , + 'entity_id': 'sensor.theater_washer_machine_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'stop', + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_washer_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_powerConsumptionReport_powerConsumption_power_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Washer Power', + 'power_consumption_end': '2025-02-07T03:09:45Z', + 'power_consumption_start': '2025-02-07T03:09:24Z', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.theater_washer_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.theater_washer_power_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power energy', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'power_energy', + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'Washer Power energy', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.theater_washer_power_energy', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'none', + 'state': '0.0', }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_machine_state-entry] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washer_cycle-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -17449,9 +18262,18 @@ 'area_id': None, 'capabilities': dict({ 'options': list([ - 'pause', - 'run', - 'stop', + '01', + '70', + '55', + '71', + '72', + '77', + 'e5', + '57', + '73', + '74', + '75', + '78', ]), }), 'config_entry_id': , @@ -17461,7 +18283,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.theater_washer_machine_state', + 'entity_id': 'sensor.theater_washer_washer_cycle', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -17469,41 +18291,51 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Machine state', + 'object_id_base': 'Washer cycle', 'options': dict({ }), 'original_device_class': , - 'original_icon': None, - 'original_name': 'Machine state', + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washer cycle', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'washer_machine_state', - 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState', + 'translation_key': 'washer_cycle', + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_samsungce.washerCycle_washerCycle_washerCycle', 'unit_of_measurement': None, }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_machine_state-state] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washer_cycle-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Washer Machine state', + 'friendly_name': 'Washer Washer cycle', + 'icon': 'mdi:washing-machine', 'options': list([ - 'pause', - 'run', - 'stop', + '01', + '70', + '55', + '71', + '72', + '77', + 'e5', + '57', + '73', + '74', + '75', + '78', ]), }), 'context': , - 'entity_id': 'sensor.theater_washer_machine_state', + 'entity_id': 'sensor.theater_washer_washer_cycle', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'stop', + 'state': '01', }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power-entry] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washer_remaining_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -17519,7 +18351,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.theater_washer_power', + 'entity_id': 'sensor.theater_washer_washer_remaining_time', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -17527,50 +18359,49 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power', + 'object_id_base': 'Washer remaining time', 'options': dict({ 'sensor': dict({ 'suggested_display_precision': 2, }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power', + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Washer remaining time', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, - 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_powerConsumptionReport_powerConsumption_power_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_remaining_time', + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_samsungce.washerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power-state] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washer_remaining_time-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'power', - 'friendly_name': 'Washer Power', - 'power_consumption_end': '2025-02-07T03:09:45Z', - 'power_consumption_start': '2025-02-07T03:09:24Z', + 'device_class': 'duration', + 'friendly_name': 'Washer Washer remaining time', + 'icon': 'mdi:timer-sand', 'state_class': , - 'unit_of_measurement': , + 'unit_of_measurement': 'min', }), 'context': , - 'entity_id': 'sensor.theater_washer_power', + 'entity_id': 'sensor.theater_washer_washer_remaining_time', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0', + 'state': '45', }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power_energy-entry] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washing_progress-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -17579,7 +18410,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.theater_washer_power_energy', + 'entity_id': 'sensor.theater_washer_washing_progress', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -17587,38 +18418,35 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power energy', + 'object_id_base': 'Washing progress', 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power energy', + 'original_device_class': None, + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washing progress', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'power_energy', - 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_progress', + 'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_samsungce.washerOperatingState_progress_progress', + 'unit_of_measurement': '%', }) # --- -# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_power_energy-state] +# name: test_all_entities[da_wm_wm_000001][sensor.theater_washer_washing_progress-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Washer Power energy', - 'state_class': , - 'unit_of_measurement': , + 'friendly_name': 'Washer Washing progress', + 'icon': 'mdi:washing-machine', + 'state_class': , + 'unit_of_measurement': '%', }), 'context': , - 'entity_id': 'sensor.theater_washer_power_energy', + 'entity_id': 'sensor.theater_washer_washing_progress', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '1', }) # --- # name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_completion_time-entry] @@ -17927,14 +18755,200 @@ ]), }), 'context': , - 'entity_id': 'sensor.washing_machine_job_state', + 'entity_id': 'sensor.washing_machine_job_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'wash', + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_machine_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washing_machine_machine_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Machine state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Machine state', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_machine_state', + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_washerOperatingState_machineState_machineState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_machine_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Washing Machine Machine state', + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'context': , + 'entity_id': 'sensor.washing_machine_machine_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'run', + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washing_machine_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_powerConsumptionReport_powerConsumption_power_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Washing Machine Power', + 'power_consumption_end': '2025-03-07T06:23:21Z', + 'power_consumption_start': '2025-03-07T06:21:09Z', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.washing_machine_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washing_machine_power_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power energy', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'power_energy', + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'Washing Machine Power energy', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.washing_machine_power_energy', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'wash', + 'state': '0.0', }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_machine_state-entry] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washer_cycle-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -17942,9 +18956,20 @@ 'area_id': None, 'capabilities': dict({ 'options': list([ - 'pause', - 'run', - 'stop', + 'd0', + 'dc', + 'e3', + 'e4', + '50', + '51', + 'ca', + 'e7', + 'c7', + 'd8', + 'd4', + 'd3', + 'da', + 'd2', ]), }), 'config_entry_id': , @@ -17954,7 +18979,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.washing_machine_machine_state', + 'entity_id': 'sensor.washing_machine_washer_cycle', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -17962,41 +18987,53 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Machine state', + 'object_id_base': 'Washer cycle', 'options': dict({ }), 'original_device_class': , - 'original_icon': None, - 'original_name': 'Machine state', + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washer cycle', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'washer_machine_state', - 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_washerOperatingState_machineState_machineState', + 'translation_key': 'washer_cycle', + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerCycle_washerCycle_washerCycle', 'unit_of_measurement': None, }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_machine_state-state] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washer_cycle-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Washing Machine Machine state', + 'friendly_name': 'Washing Machine Washer cycle', + 'icon': 'mdi:washing-machine', 'options': list([ - 'pause', - 'run', - 'stop', + 'd0', + 'dc', + 'e3', + 'e4', + '50', + '51', + 'ca', + 'e7', + 'c7', + 'd8', + 'd4', + 'd3', + 'da', + 'd2', ]), }), 'context': , - 'entity_id': 'sensor.washing_machine_machine_state', + 'entity_id': 'sensor.washing_machine_washer_cycle', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'run', + 'state': 'e3', }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power-entry] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washer_remaining_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -18012,7 +19049,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.washing_machine_power', + 'entity_id': 'sensor.washing_machine_washer_remaining_time', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -18020,50 +19057,49 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power', + 'object_id_base': 'Washer remaining time', 'options': dict({ 'sensor': dict({ 'suggested_display_precision': 2, }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power', + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Washer remaining time', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, - 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_powerConsumptionReport_powerConsumption_power_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_remaining_time', + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power-state] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washer_remaining_time-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'power', - 'friendly_name': 'Washing Machine Power', - 'power_consumption_end': '2025-03-07T06:23:21Z', - 'power_consumption_start': '2025-03-07T06:21:09Z', + 'device_class': 'duration', + 'friendly_name': 'Washing Machine Washer remaining time', + 'icon': 'mdi:timer-sand', 'state_class': , - 'unit_of_measurement': , + 'unit_of_measurement': 'min', }), 'context': , - 'entity_id': 'sensor.washing_machine_power', + 'entity_id': 'sensor.washing_machine_washer_remaining_time', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0', + 'state': '31', }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power_energy-entry] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washing_progress-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -18072,7 +19108,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.washing_machine_power_energy', + 'entity_id': 'sensor.washing_machine_washing_progress', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -18080,38 +19116,35 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power energy', + 'object_id_base': 'Washing progress', 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power energy', + 'original_device_class': None, + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washing progress', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'power_energy', - 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_progress', + 'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerOperatingState_progress_progress', + 'unit_of_measurement': '%', }) # --- -# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_power_energy-state] +# name: test_all_entities[da_wm_wm_000001_1][sensor.washing_machine_washing_progress-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Washing Machine Power energy', - 'state_class': , - 'unit_of_measurement': , + 'friendly_name': 'Washing Machine Washing progress', + 'icon': 'mdi:washing-machine', + 'state_class': , + 'unit_of_measurement': '%', }), 'context': , - 'entity_id': 'sensor.washing_machine_power_energy', + 'entity_id': 'sensor.washing_machine_washing_progress', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '36', }) # --- # name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_completion_time-entry] @@ -18424,10 +19457,196 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'wash', + 'state': 'wash', + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_machine_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.machine_a_laver_machine_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Machine state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Machine state', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_machine_state', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_washerOperatingState_machineState_machineState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_machine_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Machine à Laver Machine state', + 'options': list([ + 'pause', + 'paused', + 'ready', + 'run', + 'running', + 'stop', + ]), + }), + 'context': , + 'entity_id': 'sensor.machine_a_laver_machine_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'run', + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.machine_a_laver_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_powerConsumptionReport_powerConsumption_power_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'power', + 'friendly_name': 'Machine à Laver Power', + 'power_consumption_end': '2025-04-25T08:43:46Z', + 'power_consumption_start': '2025-04-25T08:28:43Z', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.machine_a_laver_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.machine_a_laver_power_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Power energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power energy', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'power_energy', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'Machine à Laver Power energy', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.machine_a_laver_power_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_machine_state-entry] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washer_cycle-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -18435,9 +19654,30 @@ 'area_id': None, 'capabilities': dict({ 'options': list([ - 'pause', - 'run', - 'stop', + '1c', + '2b', + '1b', + '1e', + '1d', + '96', + '8f', + '25', + '26', + '33', + '24', + '32', + '20', + '22', + '23', + '2f', + '21', + '2a', + '2e', + '2d', + '30', + '29', + '27', + '28', ]), }), 'config_entry_id': , @@ -18447,7 +19687,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.machine_a_laver_machine_state', + 'entity_id': 'sensor.machine_a_laver_washer_cycle', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -18455,41 +19695,63 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Machine state', + 'object_id_base': 'Washer cycle', 'options': dict({ }), 'original_device_class': , - 'original_icon': None, - 'original_name': 'Machine state', + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washer cycle', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'washer_machine_state', - 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_washerOperatingState_machineState_machineState', + 'translation_key': 'washer_cycle', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_samsungce.washerCycle_washerCycle_washerCycle', 'unit_of_measurement': None, }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_machine_state-state] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washer_cycle-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Machine à Laver Machine state', + 'friendly_name': 'Machine à Laver Washer cycle', + 'icon': 'mdi:washing-machine', 'options': list([ - 'pause', - 'run', - 'stop', + '1c', + '2b', + '1b', + '1e', + '1d', + '96', + '8f', + '25', + '26', + '33', + '24', + '32', + '20', + '22', + '23', + '2f', + '21', + '2a', + '2e', + '2d', + '30', + '29', + '27', + '28', ]), }), 'context': , - 'entity_id': 'sensor.machine_a_laver_machine_state', + 'entity_id': 'sensor.machine_a_laver_washer_cycle', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'run', + 'state': '1c', }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power-entry] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washer_remaining_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, @@ -18505,7 +19767,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.machine_a_laver_power', + 'entity_id': 'sensor.machine_a_laver_washer_remaining_time', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -18513,50 +19775,49 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power', + 'object_id_base': 'Washer remaining time', 'options': dict({ 'sensor': dict({ 'suggested_display_precision': 2, }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power', + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Washer remaining time', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, - 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_powerConsumptionReport_powerConsumption_power_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_remaining_time', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_samsungce.washerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power-state] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washer_remaining_time-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'power', - 'friendly_name': 'Machine à Laver Power', - 'power_consumption_end': '2025-04-25T08:43:46Z', - 'power_consumption_start': '2025-04-25T08:28:43Z', + 'device_class': 'duration', + 'friendly_name': 'Machine à Laver Washer remaining time', + 'icon': 'mdi:timer-sand', 'state_class': , - 'unit_of_measurement': , + 'unit_of_measurement': 'min', }), 'context': , - 'entity_id': 'sensor.machine_a_laver_power', + 'entity_id': 'sensor.machine_a_laver_washer_remaining_time', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0', + 'state': '100', }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power_energy-entry] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washing_progress-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ None, ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': , 'config_subentry_id': , @@ -18565,7 +19826,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.machine_a_laver_power_energy', + 'entity_id': 'sensor.machine_a_laver_washing_progress', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -18573,38 +19834,35 @@ 'labels': set({ }), 'name': None, - 'object_id_base': 'Power energy', + 'object_id_base': 'Washing progress', 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Power energy', + 'original_device_class': None, + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washing progress', 'platform': 'smartthings', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'power_energy', - 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', - 'unit_of_measurement': , + 'translation_key': 'washer_progress', + 'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_samsungce.washerOperatingState_progress_progress', + 'unit_of_measurement': '%', }) # --- -# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_power_energy-state] +# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_washing_progress-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'Machine à Laver Power energy', - 'state_class': , - 'unit_of_measurement': , + 'friendly_name': 'Machine à Laver Washing progress', + 'icon': 'mdi:washing-machine', + 'state_class': , + 'unit_of_measurement': '%', }), 'context': , - 'entity_id': 'sensor.machine_a_laver_power_energy', + 'entity_id': 'sensor.machine_a_laver_washing_progress', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '40', }) # --- # name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_water_consumption-entry] @@ -18813,7 +20071,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -18854,7 +20115,10 @@ 'friendly_name': 'Washer 1 Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -18866,6 +20130,120 @@ 'state': 'stop', }) # --- +# name: test_all_entities[da_wm_wm_100001][sensor.washer_1_washer_remaining_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washer_1_washer_remaining_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Washer remaining time', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Washer remaining time', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_remaining_time', + 'unique_id': 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee_main_samsungce.washerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', + }) +# --- +# name: test_all_entities[da_wm_wm_100001][sensor.washer_1_washer_remaining_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'duration', + 'friendly_name': 'Washer 1 Washer remaining time', + 'icon': 'mdi:timer-sand', + 'state_class': , + 'unit_of_measurement': 'min', + }), + 'context': , + 'entity_id': 'sensor.washer_1_washer_remaining_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '57', + }) +# --- +# name: test_all_entities[da_wm_wm_100001][sensor.washer_1_washing_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washer_1_washing_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Washing progress', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washing progress', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_progress', + 'unique_id': 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee_main_samsungce.washerOperatingState_progress_progress', + 'unit_of_measurement': '%', + }) +# --- +# name: test_all_entities[da_wm_wm_100001][sensor.washer_1_washing_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Washer 1 Washing progress', + 'icon': 'mdi:washing-machine', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.washer_1_washing_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_all_entities[da_wm_wm_100002][sensor.washer_2_completion_time-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -19014,7 +20392,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -19055,7 +20436,10 @@ 'friendly_name': 'Washer 2 Machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -19215,7 +20599,10 @@ 'capabilities': dict({ 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -19256,7 +20643,10 @@ 'friendly_name': 'Washer 2 Upper washer machine state', 'options': list([ 'pause', + 'paused', + 'ready', 'run', + 'running', 'stop', ]), }), @@ -19268,6 +20658,120 @@ 'state': 'stop', }) # --- +# name: test_all_entities[da_wm_wm_100002][sensor.washer_2_washer_remaining_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washer_2_washer_remaining_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Washer remaining time', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:timer-sand', + 'original_name': 'Washer remaining time', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_remaining_time', + 'unique_id': 'C097276D-C8D4-0000-0000-000000000000_main_samsungce.washerOperatingState_remainingTime_remainingTime', + 'unit_of_measurement': 'min', + }) +# --- +# name: test_all_entities[da_wm_wm_100002][sensor.washer_2_washer_remaining_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'duration', + 'friendly_name': 'Washer 2 Washer remaining time', + 'icon': 'mdi:timer-sand', + 'state_class': , + 'unit_of_measurement': 'min', + }), + 'context': , + 'entity_id': 'sensor.washer_2_washer_remaining_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '5', + }) +# --- +# name: test_all_entities[da_wm_wm_100002][sensor.washer_2_washing_progress-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.washer_2_washing_progress', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Washing progress', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:washing-machine', + 'original_name': 'Washing progress', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'washer_progress', + 'unique_id': 'C097276D-C8D4-0000-0000-000000000000_main_samsungce.washerOperatingState_progress_progress', + 'unit_of_measurement': '%', + }) +# --- +# name: test_all_entities[da_wm_wm_100002][sensor.washer_2_washing_progress-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Washer 2 Washing progress', + 'icon': 'mdi:washing-machine', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.washer_2_washing_progress', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_all_entities[ecobee_sensor][sensor.child_bedroom_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/smartthings/test_sensor.py b/tests/components/smartthings/test_sensor.py index 6bd9b80705262c..e451449da4ef7a 100644 --- a/tests/components/smartthings/test_sensor.py +++ b/tests/components/smartthings/test_sensor.py @@ -1,6 +1,6 @@ """Test for the SmartThings sensors platform.""" -from unittest.mock import AsyncMock +from unittest.mock import AsyncMock, MagicMock from pysmartthings import Attribute, Capability from pysmartthings.models import HealthStatus @@ -12,6 +12,11 @@ from homeassistant.components.script import scripts_with_entity from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.components.smartthings.const import DOMAIN, MAIN +from homeassistant.components.smartthings.sensor import ( + SmartThingsSensor, + SmartThingsSensorEntityDescription, + _normalize_cycle_value, +) from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er, issue_registry as ir @@ -393,3 +398,158 @@ async def test_availability_at_start( hass.states.get("sensor.theater_ac_office_granit_temperature").state == STATE_UNAVAILABLE ) + + +def test_normalize_cycle_value() -> None: + """Test cycle name normalization.""" + assert _normalize_cycle_value(None) is None + assert _normalize_cycle_value("") is None + assert _normalize_cycle_value("NORMAL_CYCLE") == "cycle" + assert _normalize_cycle_value("washer_delicate") == "delicate" + assert _normalize_cycle_value("delicate") == "delicate" + + +def test_sensor_options_and_fallback() -> None: + """Test options and fallback logic in SmartThingsSensor.""" + mock_client = MagicMock() + mock_device = MagicMock() + mock_device.device.device_id = "test-device-id" + mock_device.device.presentation_id = "test-presentation-id" + mock_device.online = True + + component = MAIN + capability = Capability.SAMSUNG_CE_WASHER_CYCLE + attribute = Attribute.WASHER_CYCLE + options_attribute = Attribute.SUPPORTED_CYCLES + + # Setup the mock attribute status values + mock_attribute_status = MagicMock() + mock_attribute_status.value = "unsupported_cycle" + mock_options_status = MagicMock() + mock_options_status.value = ["normal_cycle", "delicate_cycle"] + + mock_device.status = { + component: { + capability: { + attribute: mock_attribute_status, + options_attribute: mock_options_status, + } + } + } + + # 1. Test safety guard: native_value appended if not in dynamically retrieved options (line 1610) + desc = SmartThingsSensorEntityDescription( + key=attribute, + options_attribute=options_attribute, + ) + sensor = SmartThingsSensor( + client=mock_client, + device=mock_device, + entity_description=desc, + component=component, + capability=capability, + attribute=attribute, + ) + assert sensor.options == ["normal_cycle", "delicate_cycle", "unsupported_cycle"] + + # 2. Test fallback to static options if dynamic options value is None (lines 1614-1621) + mock_options_status.value = None + desc_with_static = SmartThingsSensorEntityDescription( + key=attribute, + options_attribute=options_attribute, + options=["static_1", "static_2"], + ) + sensor_static = SmartThingsSensor( + client=mock_client, + device=mock_device, + entity_description=desc_with_static, + component=component, + capability=capability, + attribute=attribute, + ) + assert sensor_static.options == ["static_1", "static_2", "unsupported_cycle"] + + # 3. Test returning empty list if dynamic options value is None and static options is None (line 1621) + desc_no_static = SmartThingsSensorEntityDescription( + key=attribute, + options_attribute=options_attribute, + options=None, + ) + sensor_no_static = SmartThingsSensor( + client=mock_client, + device=mock_device, + entity_description=desc_no_static, + component=component, + capability=capability, + attribute=attribute, + ) + assert sensor_no_static.options == [] + + # 4. Test safety guard for standard sensor (no dynamic options_attribute) appends native_value (line 1628) + desc_std = SmartThingsSensorEntityDescription( + key=attribute, + options_attribute=None, + options=["static_1", "static_2"], + ) + sensor_std = SmartThingsSensor( + client=mock_client, + device=mock_device, + entity_description=desc_std, + component=component, + capability=capability, + attribute=attribute, + ) + assert sensor_std.options == ["static_1", "static_2", "unsupported_cycle"] + + +def test_sensor_options_normalization_dict() -> None: + """Test option normalization (using value_fn), dictionary options and deduplication.""" + mock_client = MagicMock() + mock_device = MagicMock() + mock_device.device.device_id = "test-device-id" + mock_device.device.presentation_id = "test-presentation-id" + mock_device.online = True + + component = MAIN + capability = Capability.SAMSUNG_CE_WASHER_CYCLE + attribute = Attribute.WASHER_CYCLE + options_attribute = Attribute.SUPPORTED_CYCLES + + # Setup the mock attribute status values + mock_attribute_status = MagicMock() + mock_attribute_status.value = "NORMAL_CYCLE" + mock_options_status = MagicMock() + mock_options_status.value = [ + {"cycle": "NORMAL_CYCLE"}, + {"cycle": "DELICATE_CYCLE"}, + {"cycle": "Normal_Cycle"}, + ] + + mock_device.status = { + component: { + capability: { + attribute: mock_attribute_status, + options_attribute: mock_options_status, + } + } + } + + desc = SmartThingsSensorEntityDescription( + key=attribute, + options_attribute=options_attribute, + value_fn=_normalize_cycle_value, + ) + sensor = SmartThingsSensor( + client=mock_client, + device=mock_device, + entity_description=desc, + component=component, + capability=capability, + attribute=attribute, + ) + + assert sensor.options == ["cycle"] + + # Test with mixed-case strings that normalize to different values + mock_options_status.value = ["Wash_Normal", "Wash_Delicate", "wash_normal"] + assert sensor.options == ["normal", "delicate", "cycle"]