diff --git a/homeassistant/components/smartthings/climate.py b/homeassistant/components/smartthings/climate.py index 98581af9fe89..28c1c9c37825 100644 --- a/homeassistant/components/smartthings/climate.py +++ b/homeassistant/components/smartthings/climate.py @@ -14,6 +14,9 @@ from homeassistant.components.climate import ( ATTR_TARGET_TEMP_LOW, DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP, + PRESET_BOOST, + PRESET_NONE, + PRESET_SLEEP, SWING_BOTH, SWING_HORIZONTAL, SWING_OFF, @@ -97,6 +100,19 @@ HEAT_PUMP_AC_MODE_TO_HA = { "heat": HVACMode.HEAT, } +PRESET_MODE_TO_HA = { + "off": PRESET_NONE, + "windFree": "wind_free", + "sleep": PRESET_SLEEP, + "windFreeSleep": "wind_free_sleep", + "speed": PRESET_BOOST, + "quiet": "quiet", + "longWind": "long_wind", + "smart": "smart", +} + +HA_MODE_TO_PRESET_MODE = {v: k for k, v in PRESET_MODE_TO_HA.items()} + HA_MODE_TO_HEAT_PUMP_AC_MODE = {v: k for k, v in HEAT_PUMP_AC_MODE_TO_HA.items()} WIND = "wind" @@ -362,6 +378,7 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity): """Define a SmartThings Air Conditioner.""" _attr_name = None + _attr_translation_key = "air_conditioner" def __init__(self, client: SmartThings, device: FullDevice) -> None: """Init the class.""" @@ -582,9 +599,7 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity): Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, Attribute.AC_OPTIONAL_MODE, ) - # Return the mode if it is in the supported modes - if self._attr_preset_modes and mode in self._attr_preset_modes: - return mode + return PRESET_MODE_TO_HA.get(mode) return None def _determine_preset_modes(self) -> list[str] | None: @@ -594,8 +609,16 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity): Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, Attribute.SUPPORTED_AC_OPTIONAL_MODE, ) - if supported_modes: - return supported_modes + modes = [] + for mode in supported_modes: + if (ha_mode := PRESET_MODE_TO_HA.get(mode)) is not None: + modes.append(ha_mode) + else: + _LOGGER.warning( + "Unknown preset mode: %s, please report at https://github.com/home-assistant/core/issues", + mode, + ) + return modes return None async def async_set_preset_mode(self, preset_mode: str) -> None: @@ -603,7 +626,7 @@ class SmartThingsAirConditioner(SmartThingsEntity, ClimateEntity): await self.execute_device_command( Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, Command.SET_AC_OPTIONAL_MODE, - argument=preset_mode, + argument=HA_MODE_TO_PRESET_MODE[preset_mode], ) def _determine_hvac_modes(self) -> list[HVACMode]: diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 0c9cc394fb39..244324bb1b4c 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -78,6 +78,21 @@ "name": "[%key:common::action::stop%]" } }, + "climate": { + "air_conditioner": { + "state_attributes": { + "preset_mode": { + "state": { + "wind_free": "WindFree", + "wind_free_sleep": "WindFree sleep", + "quiet": "Quiet", + "long_wind": "Long wind", + "smart": "Smart" + } + } + } + } + }, "event": { "button": { "state": { diff --git a/tests/components/smartthings/conftest.py b/tests/components/smartthings/conftest.py index b28a7c761f4c..c45417122e92 100644 --- a/tests/components/smartthings/conftest.py +++ b/tests/components/smartthings/conftest.py @@ -99,7 +99,6 @@ def mock_smartthings() -> Generator[AsyncMock]: "aq_sensor_3_ikea", "da_ac_airsensor_01001", "da_ac_rac_000001", - "da_ac_rac_000002", "da_ac_rac_000003", "da_ac_rac_100001", "da_ac_rac_01001", diff --git a/tests/components/smartthings/fixtures/device_status/da_ac_rac_000002.json b/tests/components/smartthings/fixtures/device_status/da_ac_rac_000002.json deleted file mode 100644 index 1dce4ae52614..000000000000 --- a/tests/components/smartthings/fixtures/device_status/da_ac_rac_000002.json +++ /dev/null @@ -1,886 +0,0 @@ -{ - "components": { - "1": { - "relativeHumidityMeasurement": { - "humidity": { - "value": 0, - "unit": "%", - "timestamp": "2021-04-06T16:43:35.291Z" - } - }, - "custom.airConditionerOdorController": { - "airConditionerOdorControllerProgress": { - "value": null, - "timestamp": "2021-04-08T04:11:38.269Z" - }, - "airConditionerOdorControllerState": { - "value": null, - "timestamp": "2021-04-08T04:11:38.269Z" - } - }, - "custom.thermostatSetpointControl": { - "minimumSetpoint": { - "value": null, - "timestamp": "2021-04-08T04:04:19.901Z" - }, - "maximumSetpoint": { - "value": null, - "timestamp": "2021-04-08T04:04:19.901Z" - } - }, - "airConditionerMode": { - "availableAcModes": { - "value": null - }, - "supportedAcModes": { - "value": null, - "timestamp": "2021-04-08T03:50:50.930Z" - }, - "airConditionerMode": { - "value": null, - "timestamp": "2021-04-08T03:50:50.930Z" - } - }, - "custom.spiMode": { - "spiMode": { - "value": null, - "timestamp": "2021-04-06T16:57:57.686Z" - } - }, - "airQualitySensor": { - "airQuality": { - "value": null, - "unit": "CAQI", - "timestamp": "2021-04-06T16:57:57.602Z" - } - }, - "custom.airConditionerOptionalMode": { - "supportedAcOptionalMode": { - "value": null, - "timestamp": "2021-04-06T16:57:57.659Z" - }, - "acOptionalMode": { - "value": null, - "timestamp": "2021-04-06T16:57:57.659Z" - } - }, - "switch": { - "switch": { - "value": null, - "timestamp": "2021-04-06T16:44:10.518Z" - } - }, - "custom.airConditionerTropicalNightMode": { - "acTropicalNightModeLevel": { - "value": null, - "timestamp": "2021-04-06T16:44:10.498Z" - } - }, - "ocf": { - "st": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mndt": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnfv": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnhw": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "di": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnsl": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "dmv": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "n": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnmo": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "vid": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnmn": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnml": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnpv": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "mnos": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "pi": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - }, - "icv": { - "value": null, - "timestamp": "2021-04-06T16:44:10.472Z" - } - }, - "airConditionerFanMode": { - "fanMode": { - "value": null, - "timestamp": "2021-04-06T16:44:10.381Z" - }, - "supportedAcFanModes": { - "value": ["auto", "low", "medium", "high", "turbo"], - "timestamp": "2024-09-10T10:26:28.605Z" - }, - "availableAcFanModes": { - "value": null - } - }, - "custom.disabledCapabilities": { - "disabledCapabilities": { - "value": [ - "remoteControlStatus", - "airQualitySensor", - "dustSensor", - "odorSensor", - "veryFineDustSensor", - "custom.dustFilter", - "custom.deodorFilter", - "custom.deviceReportStateConfiguration", - "audioVolume", - "custom.autoCleaningMode", - "custom.airConditionerTropicalNightMode", - "custom.airConditionerOdorController", - "demandResponseLoadControl", - "relativeHumidityMeasurement" - ], - "timestamp": "2024-09-10T10:26:28.605Z" - } - }, - "fanOscillationMode": { - "supportedFanOscillationModes": { - "value": null, - "timestamp": "2021-04-06T16:44:10.325Z" - }, - "availableFanOscillationModes": { - "value": null - }, - "fanOscillationMode": { - "value": "fixed", - "timestamp": "2025-02-08T00:44:53.247Z" - } - }, - "temperatureMeasurement": { - "temperatureRange": { - "value": null - }, - "temperature": { - "value": null, - "timestamp": "2021-04-06T16:44:10.373Z" - } - }, - "dustSensor": { - "dustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:44:10.122Z" - }, - "fineDustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:44:10.122Z" - } - }, - "custom.deviceReportStateConfiguration": { - "reportStateRealtimePeriod": { - "value": null, - "timestamp": "2021-04-06T16:44:09.800Z" - }, - "reportStateRealtime": { - "value": null, - "timestamp": "2021-04-06T16:44:09.800Z" - }, - "reportStatePeriod": { - "value": null, - "timestamp": "2021-04-06T16:44:09.800Z" - } - }, - "thermostatCoolingSetpoint": { - "coolingSetpointRange": { - "value": null - }, - "coolingSetpoint": { - "value": null, - "timestamp": "2021-04-06T16:43:59.136Z" - } - }, - "demandResponseLoadControl": { - "drlcStatus": { - "value": null, - "timestamp": "2021-04-06T16:43:54.748Z" - } - }, - "audioVolume": { - "volume": { - "value": null, - "unit": "%", - "timestamp": "2021-04-06T16:43:53.541Z" - } - }, - "powerConsumptionReport": { - "powerConsumption": { - "value": null, - "timestamp": "2021-04-06T16:43:53.364Z" - } - }, - "custom.autoCleaningMode": { - "supportedAutoCleaningModes": { - "value": null - }, - "timedCleanDuration": { - "value": null - }, - "operatingState": { - "value": null - }, - "timedCleanDurationRange": { - "value": null - }, - "supportedOperatingStates": { - "value": null - }, - "progress": { - "value": null - }, - "autoCleaningMode": { - "value": null, - "timestamp": "2021-04-06T16:43:53.344Z" - } - }, - "custom.dustFilter": { - "dustFilterUsageStep": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - }, - "dustFilterUsage": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - }, - "dustFilterLastResetDate": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - }, - "dustFilterStatus": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - }, - "dustFilterCapacity": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - }, - "dustFilterResetType": { - "value": null, - "timestamp": "2021-04-06T16:43:39.145Z" - } - }, - "odorSensor": { - "odorLevel": { - "value": null, - "timestamp": "2021-04-06T16:43:38.992Z" - } - }, - "remoteControlStatus": { - "remoteControlEnabled": { - "value": null, - "timestamp": "2021-04-06T16:43:39.097Z" - } - }, - "custom.deodorFilter": { - "deodorFilterCapacity": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - }, - "deodorFilterLastResetDate": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - }, - "deodorFilterStatus": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - }, - "deodorFilterResetType": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - }, - "deodorFilterUsage": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - }, - "deodorFilterUsageStep": { - "value": null, - "timestamp": "2021-04-06T16:43:39.118Z" - } - }, - "custom.energyType": { - "energyType": { - "value": null, - "timestamp": "2021-04-06T16:43:38.843Z" - }, - "energySavingSupport": { - "value": null - }, - "drMaxDuration": { - "value": null - }, - "energySavingLevel": { - "value": null - }, - "energySavingInfo": { - "value": null - }, - "supportedEnergySavingLevels": { - "value": null - }, - "energySavingOperation": { - "value": null - }, - "notificationTemplateID": { - "value": null - }, - "energySavingOperationSupport": { - "value": null - } - }, - "veryFineDustSensor": { - "veryFineDustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:43:38.529Z" - } - } - }, - "main": { - "relativeHumidityMeasurement": { - "humidity": { - "value": 60, - "unit": "%", - "timestamp": "2024-12-30T13:10:23.759Z" - } - }, - "custom.airConditionerOdorController": { - "airConditionerOdorControllerProgress": { - "value": null, - "timestamp": "2021-04-06T16:43:37.555Z" - }, - "airConditionerOdorControllerState": { - "value": null, - "timestamp": "2021-04-06T16:43:37.555Z" - } - }, - "custom.thermostatSetpointControl": { - "minimumSetpoint": { - "value": 16, - "unit": "C", - "timestamp": "2025-01-08T06:30:58.307Z" - }, - "maximumSetpoint": { - "value": 30, - "unit": "C", - "timestamp": "2024-09-10T10:26:28.781Z" - } - }, - "airConditionerMode": { - "availableAcModes": { - "value": null - }, - "supportedAcModes": { - "value": ["cool", "dry", "wind", "auto", "heat"], - "timestamp": "2024-09-10T10:26:28.781Z" - }, - "airConditionerMode": { - "value": "heat", - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "custom.spiMode": { - "spiMode": { - "value": "off", - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "samsungce.dongleSoftwareInstallation": { - "status": { - "value": "completed", - "timestamp": "2021-12-29T01:36:51.289Z" - } - }, - "samsungce.deviceIdentification": { - "micomAssayCode": { - "value": null - }, - "modelName": { - "value": null - }, - "serialNumber": { - "value": null - }, - "serialNumberExtra": { - "value": null - }, - "modelClassificationCode": { - "value": null - }, - "description": { - "value": null - }, - "releaseYear": { - "value": null - }, - "binaryId": { - "value": "ARTIK051_KRAC_18K", - "timestamp": "2025-02-08T00:44:53.855Z" - } - }, - "airQualitySensor": { - "airQuality": { - "value": null, - "unit": "CAQI", - "timestamp": "2021-04-06T16:43:37.208Z" - } - }, - "custom.airConditionerOptionalMode": { - "supportedAcOptionalMode": { - "value": [ - "off", - "sleep", - "quiet", - "speed", - "windFree", - "windFreeSleep" - ], - "timestamp": "2024-09-10T10:26:28.781Z" - }, - "acOptionalMode": { - "value": "windFree", - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "switch": { - "switch": { - "value": "off", - "timestamp": "2025-02-09T16:37:54.072Z" - } - }, - "custom.airConditionerTropicalNightMode": { - "acTropicalNightModeLevel": { - "value": 0, - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "ocf": { - "st": { - "value": null, - "timestamp": "2021-04-06T16:43:35.933Z" - }, - "mndt": { - "value": null, - "timestamp": "2021-04-06T16:43:35.912Z" - }, - "mnfv": { - "value": "0.1.0", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnhw": { - "value": "1.0", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "di": { - "value": "13549124-3320-4fda-8e5c-3f363e043034", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnsl": { - "value": null, - "timestamp": "2021-04-06T16:43:35.803Z" - }, - "dmv": { - "value": "res.1.1.0,sh.1.1.0", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "n": { - "value": "[room a/c] Samsung", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnmo": { - "value": "ARTIK051_KRAC_18K|10193441|60010132001111110200000000000000", - "timestamp": "2024-09-10T10:26:28.781Z" - }, - "vid": { - "value": "DA-AC-RAC-000001", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnmn": { - "value": "Samsung Electronics", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnml": { - "value": "http://www.samsung.com", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnpv": { - "value": "0G3MPDCKA00010E", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "mnos": { - "value": "TizenRT2.0", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "pi": { - "value": "13549124-3320-4fda-8e5c-3f363e043034", - "timestamp": "2024-09-10T10:26:28.552Z" - }, - "icv": { - "value": "core.1.1.0", - "timestamp": "2024-09-10T10:26:28.552Z" - } - }, - "airConditionerFanMode": { - "fanMode": { - "value": "low", - "timestamp": "2025-02-09T09:14:39.249Z" - }, - "supportedAcFanModes": { - "value": ["auto", "low", "medium", "high", "turbo"], - "timestamp": "2025-02-09T09:14:39.249Z" - }, - "availableAcFanModes": { - "value": null - } - }, - "custom.disabledCapabilities": { - "disabledCapabilities": { - "value": [ - "remoteControlStatus", - "airQualitySensor", - "dustSensor", - "veryFineDustSensor", - "custom.dustFilter", - "custom.deodorFilter", - "custom.deviceReportStateConfiguration", - "samsungce.dongleSoftwareInstallation", - "demandResponseLoadControl", - "custom.airConditionerOdorController" - ], - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "samsungce.driverVersion": { - "versionNumber": { - "value": 24070101, - "timestamp": "2024-09-04T06:35:09.557Z" - } - }, - "fanOscillationMode": { - "supportedFanOscillationModes": { - "value": null, - "timestamp": "2021-04-06T16:43:35.782Z" - }, - "availableFanOscillationModes": { - "value": null - }, - "fanOscillationMode": { - "value": "fixed", - "timestamp": "2025-02-09T09:14:39.249Z" - } - }, - "temperatureMeasurement": { - "temperatureRange": { - "value": null - }, - "temperature": { - "value": 25, - "unit": "C", - "timestamp": "2025-02-09T16:33:29.164Z" - } - }, - "dustSensor": { - "dustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:43:35.665Z" - }, - "fineDustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:43:35.665Z" - } - }, - "custom.deviceReportStateConfiguration": { - "reportStateRealtimePeriod": { - "value": null, - "timestamp": "2021-04-06T16:43:35.643Z" - }, - "reportStateRealtime": { - "value": null, - "timestamp": "2021-04-06T16:43:35.643Z" - }, - "reportStatePeriod": { - "value": null, - "timestamp": "2021-04-06T16:43:35.643Z" - } - }, - "thermostatCoolingSetpoint": { - "coolingSetpointRange": { - "value": null - }, - "coolingSetpoint": { - "value": 25, - "unit": "C", - "timestamp": "2025-02-09T09:15:11.608Z" - } - }, - "custom.disabledComponents": { - "disabledComponents": { - "value": ["1"], - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "demandResponseLoadControl": { - "drlcStatus": { - "value": { - "drlcType": 1, - "drlcLevel": -1, - "start": "1970-01-01T00:00:00Z", - "duration": 0, - "override": false - }, - "timestamp": "2024-09-10T10:26:28.781Z" - } - }, - "audioVolume": { - "volume": { - "value": 100, - "unit": "%", - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "powerConsumptionReport": { - "powerConsumption": { - "value": { - "energy": 2247300, - "deltaEnergy": 400, - "power": 0, - "powerEnergy": 0.0, - "persistedEnergy": 2247300, - "energySaved": 0, - "start": "2025-02-09T15:45:29Z", - "end": "2025-02-09T16:15:33Z" - }, - "timestamp": "2025-02-09T16:15:33.639Z" - } - }, - "custom.autoCleaningMode": { - "supportedAutoCleaningModes": { - "value": null - }, - "timedCleanDuration": { - "value": null - }, - "operatingState": { - "value": null - }, - "timedCleanDurationRange": { - "value": null - }, - "supportedOperatingStates": { - "value": null - }, - "progress": { - "value": null - }, - "autoCleaningMode": { - "value": "off", - "timestamp": "2025-02-09T09:14:39.642Z" - } - }, - "refresh": {}, - "execute": { - "data": { - "value": { - "payload": { - "rt": ["oic.r.temperature"], - "if": ["oic.if.baseline", "oic.if.a"], - "range": [16.0, 30.0], - "units": "C", - "temperature": 22.0 - } - }, - "data": { - "href": "/temperature/desired/0" - }, - "timestamp": "2023-07-19T03:07:43.270Z" - } - }, - "samsungce.selfCheck": { - "result": { - "value": null - }, - "supportedActions": { - "value": ["start"], - "timestamp": "2024-09-04T06:35:09.557Z" - }, - "progress": { - "value": null - }, - "errors": { - "value": [], - "timestamp": "2025-02-08T00:44:53.349Z" - }, - "status": { - "value": "ready", - "timestamp": "2025-02-08T00:44:53.549Z" - } - }, - "custom.dustFilter": { - "dustFilterUsageStep": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - }, - "dustFilterUsage": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - }, - "dustFilterLastResetDate": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - }, - "dustFilterStatus": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - }, - "dustFilterCapacity": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - }, - "dustFilterResetType": { - "value": null, - "timestamp": "2021-04-06T16:43:35.527Z" - } - }, - "remoteControlStatus": { - "remoteControlEnabled": { - "value": null, - "timestamp": "2021-04-06T16:43:35.379Z" - } - }, - "custom.deodorFilter": { - "deodorFilterCapacity": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - }, - "deodorFilterLastResetDate": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - }, - "deodorFilterStatus": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - }, - "deodorFilterResetType": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - }, - "deodorFilterUsage": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - }, - "deodorFilterUsageStep": { - "value": null, - "timestamp": "2021-04-06T16:43:35.502Z" - } - }, - "custom.energyType": { - "energyType": { - "value": "1.0", - "timestamp": "2024-09-10T10:26:28.781Z" - }, - "energySavingSupport": { - "value": false, - "timestamp": "2021-12-29T07:29:17.526Z" - }, - "drMaxDuration": { - "value": null - }, - "energySavingLevel": { - "value": null - }, - "energySavingInfo": { - "value": null - }, - "supportedEnergySavingLevels": { - "value": null - }, - "energySavingOperation": { - "value": null - }, - "notificationTemplateID": { - "value": null - }, - "energySavingOperationSupport": { - "value": null - } - }, - "samsungce.softwareUpdate": { - "targetModule": { - "value": null - }, - "otnDUID": { - "value": "43CEZFTFFL7Z2", - "timestamp": "2025-02-08T00:44:53.855Z" - }, - "lastUpdatedDate": { - "value": null - }, - "availableModules": { - "value": [], - "timestamp": "2025-02-08T00:44:53.855Z" - }, - "newVersionAvailable": { - "value": false, - "timestamp": "2025-02-08T00:44:53.855Z" - }, - "operatingState": { - "value": null - }, - "progress": { - "value": null - } - }, - "veryFineDustSensor": { - "veryFineDustLevel": { - "value": null, - "unit": "\u03bcg/m^3", - "timestamp": "2021-04-06T16:43:35.363Z" - } - } - } - } -} diff --git a/tests/components/smartthings/fixtures/devices/da_ac_rac_000002.json b/tests/components/smartthings/fixtures/devices/da_ac_rac_000002.json deleted file mode 100644 index f14341897601..000000000000 --- a/tests/components/smartthings/fixtures/devices/da_ac_rac_000002.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "items": [ - { - "deviceId": "13549124-3320-4fda-8e5c-3f363e043034", - "name": "[room a/c] Samsung", - "label": "AC Office Granit", - "manufacturerName": "Samsung Electronics", - "presentationId": "DA-AC-RAC-000001", - "deviceManufacturerCode": "Samsung Electronics", - "locationId": "58d3fd7c-c512-4da3-b500-ef269382756c", - "ownerId": "f9a28d7c-1ed5-d9e9-a81c-18971ec081db", - "roomId": "7715151d-0314-457a-a82c-5ce48900e065", - "deviceTypeName": "Samsung OCF Air Conditioner", - "components": [ - { - "id": "main", - "label": "main", - "capabilities": [ - { - "id": "ocf", - "version": 1 - }, - { - "id": "switch", - "version": 1 - }, - { - "id": "airConditionerMode", - "version": 1 - }, - { - "id": "airConditionerFanMode", - "version": 1 - }, - { - "id": "fanOscillationMode", - "version": 1 - }, - { - "id": "airQualitySensor", - "version": 1 - }, - { - "id": "temperatureMeasurement", - "version": 1 - }, - { - "id": "thermostatCoolingSetpoint", - "version": 1 - }, - { - "id": "relativeHumidityMeasurement", - "version": 1 - }, - { - "id": "dustSensor", - "version": 1 - }, - { - "id": "veryFineDustSensor", - "version": 1 - }, - { - "id": "audioVolume", - "version": 1 - }, - { - "id": "remoteControlStatus", - "version": 1 - }, - { - "id": "powerConsumptionReport", - "version": 1 - }, - { - "id": "demandResponseLoadControl", - "version": 1 - }, - { - "id": "refresh", - "version": 1 - }, - { - "id": "execute", - "version": 1 - }, - { - "id": "custom.spiMode", - "version": 1 - }, - { - "id": "custom.thermostatSetpointControl", - "version": 1 - }, - { - "id": "custom.airConditionerOptionalMode", - "version": 1 - }, - { - "id": "custom.airConditionerTropicalNightMode", - "version": 1 - }, - { - "id": "custom.autoCleaningMode", - "version": 1 - }, - { - "id": "custom.deviceReportStateConfiguration", - "version": 1 - }, - { - "id": "custom.energyType", - "version": 1 - }, - { - "id": "custom.dustFilter", - "version": 1 - }, - { - "id": "custom.airConditionerOdorController", - "version": 1 - }, - { - "id": "custom.deodorFilter", - "version": 1 - }, - { - "id": "custom.disabledComponents", - "version": 1 - }, - { - "id": "custom.disabledCapabilities", - "version": 1 - }, - { - "id": "samsungce.deviceIdentification", - "version": 1 - }, - { - "id": "samsungce.dongleSoftwareInstallation", - "version": 1 - }, - { - "id": "samsungce.softwareUpdate", - "version": 1 - }, - { - "id": "samsungce.selfCheck", - "version": 1 - }, - { - "id": "samsungce.driverVersion", - "version": 1 - } - ], - "categories": [ - { - "name": "AirConditioner", - "categoryType": "manufacturer" - } - ] - }, - { - "id": "1", - "label": "1", - "capabilities": [ - { - "id": "switch", - "version": 1 - }, - { - "id": "airConditionerMode", - "version": 1 - }, - { - "id": "airConditionerFanMode", - "version": 1 - }, - { - "id": "fanOscillationMode", - "version": 1 - }, - { - "id": "temperatureMeasurement", - "version": 1 - }, - { - "id": "thermostatCoolingSetpoint", - "version": 1 - }, - { - "id": "relativeHumidityMeasurement", - "version": 1 - }, - { - "id": "airQualitySensor", - "version": 1 - }, - { - "id": "dustSensor", - "version": 1 - }, - { - "id": "veryFineDustSensor", - "version": 1 - }, - { - "id": "odorSensor", - "version": 1 - }, - { - "id": "remoteControlStatus", - "version": 1 - }, - { - "id": "audioVolume", - "version": 1 - }, - { - "id": "custom.thermostatSetpointControl", - "version": 1 - }, - { - "id": "custom.autoCleaningMode", - "version": 1 - }, - { - "id": "custom.airConditionerTropicalNightMode", - "version": 1 - }, - { - "id": "custom.disabledCapabilities", - "version": 1 - }, - { - "id": "ocf", - "version": 1 - }, - { - "id": "powerConsumptionReport", - "version": 1 - }, - { - "id": "demandResponseLoadControl", - "version": 1 - }, - { - "id": "custom.spiMode", - "version": 1 - }, - { - "id": "custom.airConditionerOptionalMode", - "version": 1 - }, - { - "id": "custom.deviceReportStateConfiguration", - "version": 1 - }, - { - "id": "custom.energyType", - "version": 1 - }, - { - "id": "custom.dustFilter", - "version": 1 - }, - { - "id": "custom.airConditionerOdorController", - "version": 1 - }, - { - "id": "custom.deodorFilter", - "version": 1 - } - ], - "categories": [ - { - "name": "Other", - "categoryType": "manufacturer" - } - ] - } - ], - "createTime": "2021-04-06T16:43:34.753Z", - "profile": { - "id": "60fbc713-8da5-315d-b31a-6d6dcde4be7b" - }, - "ocf": { - "ocfDeviceType": "x.com.st.d.sensor.light", - "manufacturerName": "Samsung Electronics", - "vendorId": "VD-Sensor.Light-2023", - "lastSignupTime": "2025-01-08T02:32:04.631093137Z", - "transferCandidate": false, - "additionalAuthCodeRequired": false - }, - "type": "OCF", - "restrictionTier": 0, - "allowed": [], - "executionContext": "CLOUD" - } - ], - "_links": {} -} diff --git a/tests/components/smartthings/snapshots/test_climate.ambr b/tests/components/smartthings/snapshots/test_climate.ambr index 6976371376c3..293aa961ca74 100644 --- a/tests/components/smartthings/snapshots/test_climate.ambr +++ b/tests/components/smartthings/snapshots/test_climate.ambr @@ -36,7 +36,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': 'bf53a150-f8a4-45d1-aac4-86252475d551_main', 'unit_of_measurement': None, }) @@ -153,10 +153,10 @@ 'max_temp': 35, 'min_temp': 7, 'preset_modes': list([ - 'off', - 'windFree', - 'longWind', - 'speed', + 'none', + 'wind_free', + 'long_wind', + 'boost', 'quiet', 'sleep', ]), @@ -191,7 +191,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': '23c6d296-4656-20d8-f6eb-2ff13e041753_main', 'unit_of_measurement': None, }) @@ -222,12 +222,12 @@ ]), 'max_temp': 35, 'min_temp': 7, - 'preset_mode': 'off', + 'preset_mode': 'none', 'preset_modes': list([ - 'off', - 'windFree', - 'longWind', - 'speed', + 'none', + 'wind_free', + 'long_wind', + 'boost', 'quiet', 'sleep', ]), @@ -341,8 +341,8 @@ 'max_temp': 35, 'min_temp': 7, 'preset_modes': list([ - 'off', - 'windFree', + 'none', + 'wind_free', ]), 'swing_modes': None, }), @@ -370,7 +370,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': '96a5ef74-5832-a84b-f1f7-ca799957065d_main', 'unit_of_measurement': None, }) @@ -402,121 +402,10 @@ ]), 'max_temp': 35, 'min_temp': 7, - 'preset_mode': 'windFree', + 'preset_mode': 'wind_free', 'preset_modes': list([ - 'off', - 'windFree', - ]), - 'supported_features': , - 'swing_mode': 'off', - 'swing_modes': None, - 'temperature': 25, - }), - 'context': , - 'entity_id': 'climate.ac_office_granit', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': 'off', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][climate.ac_office_granit-entry] - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': dict({ - 'fan_modes': list([ - 'auto', - 'low', - 'medium', - 'high', - 'turbo', - ]), - 'hvac_modes': list([ - , - , - , - , - , - , - ]), - 'max_temp': 35, - 'min_temp': 7, - 'preset_modes': list([ - 'off', - 'sleep', - 'quiet', - 'speed', - 'windFree', - 'windFreeSleep', - ]), - 'swing_modes': None, - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'climate', - 'entity_category': None, - 'entity_id': 'climate.ac_office_granit', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': None, - 'platform': 'smartthings', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': , - 'translation_key': None, - 'unique_id': '13549124-3320-4fda-8e5c-3f363e043034_main', - 'unit_of_measurement': None, - }) -# --- -# name: test_all_entities[da_ac_rac_000002][climate.ac_office_granit-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'current_temperature': 25, - 'drlc_status_duration': 0, - 'drlc_status_level': -1, - 'drlc_status_override': False, - 'drlc_status_start': '1970-01-01T00:00:00Z', - 'fan_mode': 'low', - 'fan_modes': list([ - 'auto', - 'low', - 'medium', - 'high', - 'turbo', - ]), - 'friendly_name': 'AC Office Granit', - 'hvac_modes': list([ - , - , - , - , - , - , - ]), - 'max_temp': 35, - 'min_temp': 7, - 'preset_mode': 'windFree', - 'preset_modes': list([ - 'off', - 'sleep', - 'quiet', - 'speed', - 'windFree', - 'windFreeSleep', + 'none', + 'wind_free', ]), 'supported_features': , 'swing_mode': 'off', @@ -554,13 +443,13 @@ 'max_temp': 35, 'min_temp': 7, 'preset_modes': list([ - 'off', + 'none', 'sleep', 'quiet', 'smart', - 'speed', - 'windFree', - 'windFreeSleep', + 'boost', + 'wind_free', + 'wind_free_sleep', ]), 'swing_modes': list([ 'off', @@ -593,7 +482,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': 'c76d6f38-1b7f-13dd-37b5-db18d5272783_main', 'unit_of_measurement': None, }) @@ -622,15 +511,15 @@ ]), 'max_temp': 35, 'min_temp': 7, - 'preset_mode': 'off', + 'preset_mode': 'none', 'preset_modes': list([ - 'off', + 'none', 'sleep', 'quiet', 'smart', - 'speed', - 'windFree', - 'windFreeSleep', + 'boost', + 'wind_free', + 'wind_free_sleep', ]), 'supported_features': , 'swing_mode': 'off', @@ -674,13 +563,13 @@ 'max_temp': 35, 'min_temp': 7, 'preset_modes': list([ - 'off', + 'none', 'sleep', 'quiet', 'smart', - 'speed', - 'windFree', - 'windFreeSleep', + 'boost', + 'wind_free', + 'wind_free_sleep', ]), 'swing_modes': list([ 'off', @@ -713,7 +602,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': '4ece486b-89db-f06a-d54d-748b676b4d8e_main', 'unit_of_measurement': None, }) @@ -745,15 +634,15 @@ ]), 'max_temp': 35, 'min_temp': 7, - 'preset_mode': 'off', + 'preset_mode': 'none', 'preset_modes': list([ - 'off', + 'none', 'sleep', 'quiet', 'smart', - 'speed', - 'windFree', - 'windFreeSleep', + 'boost', + 'wind_free', + 'wind_free_sleep', ]), 'supported_features': , 'swing_mode': 'off', @@ -820,7 +709,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': , - 'translation_key': None, + 'translation_key': 'air_conditioner', 'unique_id': 'F8042E25-0E53-0000-0000-000000000000_main', 'unit_of_measurement': None, }) diff --git a/tests/components/smartthings/snapshots/test_init.ambr b/tests/components/smartthings/snapshots/test_init.ambr index 0de7bcc5bf0c..5cd56c316839 100644 --- a/tests/components/smartthings/snapshots/test_init.ambr +++ b/tests/components/smartthings/snapshots/test_init.ambr @@ -436,37 +436,6 @@ 'via_device_id': None, }) # --- -# name: test_devices[da_ac_rac_000002] - DeviceRegistryEntrySnapshot({ - 'area_id': 'theater', - 'config_entries': , - 'config_entries_subentries': , - 'configuration_url': 'https://account.smartthings.com', - 'connections': set({ - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': None, - 'id': , - 'identifiers': set({ - tuple( - 'smartthings', - '13549124-3320-4fda-8e5c-3f363e043034', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'Samsung Electronics', - 'model': None, - 'model_id': None, - 'name': 'AC Office Granit', - 'name_by_user': None, - 'primary_config_entry': , - 'serial_number': None, - 'sw_version': None, - 'via_device_id': None, - }) -# --- # name: test_devices[da_ac_rac_000003] DeviceRegistryEntrySnapshot({ 'area_id': None, diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index 78c5ba9bed15..9e83fdacab91 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -2509,446 +2509,6 @@ 'state': '100', }) # --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy-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.ac_office_granit_energy', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 2, - }), - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Energy', - 'platform': 'smartthings', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': None, - 'unique_id': '13549124-3320-4fda-8e5c-3f363e043034_main_powerConsumptionReport_powerConsumption_energy_meter', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'AC Office Granit Energy', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_energy', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '2247.3', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy_difference-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.ac_office_granit_energy_difference', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - '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': '13549124-3320-4fda-8e5c-3f363e043034_main_powerConsumptionReport_powerConsumption_deltaEnergy_meter', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy_difference-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'AC Office Granit Energy difference', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_energy_difference', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0.4', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy_saved-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.ac_office_granit_energy_saved', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - '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': '13549124-3320-4fda-8e5c-3f363e043034_main_powerConsumptionReport_powerConsumption_energySaved_meter', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_energy_saved-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'AC Office Granit Energy saved', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_energy_saved', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0.0', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_humidity-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.ac_office_granit_humidity', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Humidity', - 'platform': 'smartthings', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': None, - 'unique_id': '13549124-3320-4fda-8e5c-3f363e043034_main_relativeHumidityMeasurement_humidity_humidity', - 'unit_of_measurement': '%', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_humidity-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'humidity', - 'friendly_name': 'AC Office Granit Humidity', - 'state_class': , - 'unit_of_measurement': '%', - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_humidity', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '60', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_power-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.ac_office_granit_power', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - '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': '13549124-3320-4fda-8e5c-3f363e043034_main_powerConsumptionReport_powerConsumption_power_meter', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_power-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'power', - 'friendly_name': 'AC Office Granit Power', - 'power_consumption_end': '2025-02-09T16:15:33Z', - 'power_consumption_start': '2025-02-09T15:45:29Z', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_power', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_power_energy-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.ac_office_granit_power_energy', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - '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': '13549124-3320-4fda-8e5c-3f363e043034_main_powerConsumptionReport_powerConsumption_powerEnergy_meter', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_power_energy-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'energy', - 'friendly_name': 'AC Office Granit Power energy', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_power_energy', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0.0', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_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.ac_office_granit_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': '13549124-3320-4fda-8e5c-3f363e043034_main_temperatureMeasurement_temperature_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_temperature-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'temperature', - 'friendly_name': 'AC Office Granit Temperature', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_temperature', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '25', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_volume-entry] - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': None, - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': None, - 'entity_id': 'sensor.ac_office_granit_volume', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': 'Volume', - 'platform': 'smartthings', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'audio_volume', - 'unique_id': '13549124-3320-4fda-8e5c-3f363e043034_main_audioVolume_volume_volume', - 'unit_of_measurement': '%', - }) -# --- -# name: test_all_entities[da_ac_rac_000002][sensor.ac_office_granit_volume-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'friendly_name': 'AC Office Granit Volume', - 'unit_of_measurement': '%', - }), - 'context': , - 'entity_id': 'sensor.ac_office_granit_volume', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '100', - }) -# --- # name: test_all_entities[da_ac_rac_000003][sensor.office_airfree_energy-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/smartthings/test_climate.py b/tests/components/smartthings/test_climate.py index e1a8129c873b..d27bd042b119 100644 --- a/tests/components/smartthings/test_climate.py +++ b/tests/components/smartthings/test_climate.py @@ -23,6 +23,9 @@ from homeassistant.components.climate import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, DOMAIN as CLIMATE_DOMAIN, + PRESET_BOOST, + PRESET_NONE, + PRESET_SLEEP, SERVICE_SET_FAN_MODE, SERVICE_SET_HVAC_MODE, SERVICE_SET_PRESET_MODE, @@ -441,86 +444,43 @@ async def test_ac_set_swing_mode( ) -@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000002"]) +@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000003"]) @pytest.mark.parametrize( - "mode", ["off", "sleep", "quiet", "speed", "windFree", "windFreeSleep"] + ("mode", "expected_mode"), + [ + (PRESET_NONE, "off"), + (PRESET_SLEEP, "sleep"), + ("quiet", "quiet"), + (PRESET_BOOST, "speed"), + ("wind_free", "windFree"), + ("wind_free_sleep", "windFreeSleep"), + ], ) async def test_ac_set_preset_mode( hass: HomeAssistant, devices: AsyncMock, mode: str, + expected_mode: str, mock_config_entry: MockConfigEntry, ) -> None: """Test setting and retrieving AC preset modes.""" await setup_integration(hass, mock_config_entry) - # Mock supported preset modes - set_attribute_value( - devices, - Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, - Attribute.SUPPORTED_AC_OPTIONAL_MODE, - ["off", "sleep", "quiet", "speed", "windFree", "windFreeSleep"], - ) - await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_PRESET_MODE, - {ATTR_ENTITY_ID: "climate.ac_office_granit", ATTR_PRESET_MODE: mode}, + {ATTR_ENTITY_ID: "climate.office_airfree", ATTR_PRESET_MODE: mode}, blocking=True, ) devices.execute_device_command.assert_called_with( - "13549124-3320-4fda-8e5c-3f363e043034", + "c76d6f38-1b7f-13dd-37b5-db18d5272783", Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, Command.SET_AC_OPTIONAL_MODE, MAIN, - argument=mode, + argument=expected_mode, ) -@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000002"]) -@pytest.mark.parametrize( - "mode", ["off", "sleep", "quiet", "speed", "windFree", "windFreeSleep"] -) -async def test_ac_get_preset_mode( - hass: HomeAssistant, - devices: AsyncMock, - mode: str, - mock_config_entry: MockConfigEntry, -) -> None: - """Test setting and retrieving AC preset modes.""" - await setup_integration(hass, mock_config_entry) - - # Mock supported preset modes - set_attribute_value( - devices, - Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, - Attribute.SUPPORTED_AC_OPTIONAL_MODE, - ["off", "sleep", "quiet", "speed", "windFree", "windFreeSleep"], - ) - - # Mock the current preset mode to simulate the device state - set_attribute_value( - devices, - Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, - Attribute.AC_OPTIONAL_MODE, - mode, - ) - - # Trigger an update to refresh the state - await trigger_update( - hass, - devices, - "13549124-3320-4fda-8e5c-3f363e043034", - Capability.CUSTOM_AIR_CONDITIONER_OPTIONAL_MODE, - Attribute.AC_OPTIONAL_MODE, - mode, - ) - - # Verify the preset mode is correctly reflected in the entity state - state = hass.states.get("climate.ac_office_granit") - assert state.attributes[ATTR_PRESET_MODE] == mode - - @pytest.mark.parametrize("device_fixture", ["da_ac_rac_000001"]) async def test_ac_state_update( hass: HomeAssistant,