diff --git a/homeassistant/components/smartthings/number.py b/homeassistant/components/smartthings/number.py index 6ac2f60d7a9..7899d8db351 100644 --- a/homeassistant/components/smartthings/number.py +++ b/homeassistant/components/smartthings/number.py @@ -41,7 +41,7 @@ async def async_setup_entry( ) for device in entry_data.devices.values() for component in device.status - if component in ("cooler", "freezer") + if component in ("cooler", "freezer", "onedoor") and Capability.THERMOSTAT_COOLING_SETPOINT in device.status[component] ) async_add_entities(entities) @@ -176,7 +176,8 @@ class SmartThingsRefrigeratorTemperatureNumberEntity(SmartThingsEntity, NumberEn self._attr_translation_key = { "cooler": "cooler_temperature", "freezer": "freezer_temperature", - }[component] + "onedoor": "target_temperature", + }.get(component) @property def range(self) -> dict[str, int]: diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index 2a73de39185..209b0da0e00 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -912,7 +912,9 @@ CAPABILITY_TO_SENSORS: dict[ if Capability.CUSTOM_OUTING_MODE in status else None ), - component_fn=lambda component: component in {"freezer", "cooler"}, + component_fn=( + lambda component: component in {"freezer", "cooler", "onedoor"} + ), component_translation_key={ "freezer": "freezer_temperature", "cooler": "cooler_temperature", @@ -1299,7 +1301,7 @@ class SmartThingsSensor(SmartThingsEntity, SensorEntity): ) if self.entity_description.component_translation_key and component != MAIN: self._attr_translation_key = ( - self.entity_description.component_translation_key[component] + self.entity_description.component_translation_key.get(component) ) @property diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 4cae24e2e3f..29387d22d64 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -151,6 +151,9 @@ "hood_fan_speed": { "name": "Fan speed" }, + "target_temperature": { + "name": "Target temperature" + }, "washer_rinse_cycles": { "name": "Rinse cycles", "unit_of_measurement": "cycles" diff --git a/tests/components/smartthings/snapshots/test_number.ambr b/tests/components/smartthings/snapshots/test_number.ambr index b9af2605f1d..0b600387033 100644 --- a/tests/components/smartthings/snapshots/test_number.ambr +++ b/tests/components/smartthings/snapshots/test_number.ambr @@ -410,6 +410,65 @@ 'state': '2.0', }) # --- +# name: test_all_entities[da_ref_normal_01011_onedoor][number.lodowka_target_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'max': 7, + 'min': 1, + 'mode': , + 'step': 1, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.lodowka_target_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Target temperature', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'target_temperature', + 'unique_id': '271d82e0-5b0c-e4b8-058e-cdf23a188610_onedoor_thermostatCoolingSetpoint_coolingSetpoint_coolingSetpoint', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_ref_normal_01011_onedoor][number.lodowka_target_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Lodówka Target temperature', + 'max': 7, + 'min': 1, + 'mode': , + 'step': 1, + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'number.lodowka_target_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '3', + }) +# --- # name: test_all_entities[da_wm_wm_000001][number.washer_rinse_cycles-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index cbec75b3a86..4abe995c6b9 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -9367,6 +9367,62 @@ 'state': '0.00027936416665713', }) # --- +# name: test_all_entities[da_ref_normal_01011_onedoor][sensor.lodowka_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + '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.lodowka_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Temperature', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '271d82e0-5b0c-e4b8-058e-cdf23a188610_onedoor_temperatureMeasurement_temperature_temperature', + 'unit_of_measurement': , + }) +# --- +# name: test_all_entities[da_ref_normal_01011_onedoor][sensor.lodowka_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Lodówka Temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.lodowka_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '3', + }) +# --- # name: test_all_entities[da_rvc_map_01011][sensor.robot_vacuum_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': set({