mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add thermostat fixture to SmartThings (#145407)
This commit is contained in:
parent
ca01bdc481
commit
cd9339903f
@ -146,6 +146,7 @@ def mock_smartthings() -> Generator[AsyncMock]:
|
||||
"ecobee_sensor",
|
||||
"ecobee_thermostat",
|
||||
"ecobee_thermostat_offline",
|
||||
"sensi_thermostat",
|
||||
"fake_fan",
|
||||
"generic_fan_3_speed",
|
||||
"heatit_ztrm3_thermostat",
|
||||
|
@ -0,0 +1,106 @@
|
||||
{
|
||||
"components": {
|
||||
"main": {
|
||||
"thermostatOperatingState": {
|
||||
"supportedThermostatOperatingStates": {
|
||||
"value": null
|
||||
},
|
||||
"thermostatOperatingState": {
|
||||
"value": "idle",
|
||||
"timestamp": "2025-05-17T14:16:43.740Z"
|
||||
}
|
||||
},
|
||||
"relativeHumidityMeasurement": {
|
||||
"humidity": {
|
||||
"value": 49,
|
||||
"unit": "%",
|
||||
"timestamp": "2025-05-17T14:32:56.192Z"
|
||||
}
|
||||
},
|
||||
"healthCheck": {
|
||||
"checkInterval": {
|
||||
"value": 60,
|
||||
"unit": "s",
|
||||
"data": {
|
||||
"deviceScheme": "UNTRACKED",
|
||||
"protocol": "cloud"
|
||||
},
|
||||
"timestamp": "2022-04-16T19:45:51.006Z"
|
||||
},
|
||||
"healthStatus": {
|
||||
"value": null
|
||||
},
|
||||
"DeviceWatch-Enroll": {
|
||||
"value": null
|
||||
},
|
||||
"DeviceWatch-DeviceStatus": {
|
||||
"value": "online",
|
||||
"data": {},
|
||||
"timestamp": "2025-05-17T14:16:10.555Z"
|
||||
}
|
||||
},
|
||||
"temperatureMeasurement": {
|
||||
"temperatureRange": {
|
||||
"value": null
|
||||
},
|
||||
"temperature": {
|
||||
"value": 74.5,
|
||||
"unit": "F",
|
||||
"timestamp": "2025-05-17T14:32:56.192Z"
|
||||
}
|
||||
},
|
||||
"thermostatHeatingSetpoint": {
|
||||
"heatingSetpoint": {
|
||||
"value": 71,
|
||||
"unit": "F",
|
||||
"timestamp": "2025-05-17T14:16:12.093Z"
|
||||
},
|
||||
"heatingSetpointRange": {
|
||||
"value": null
|
||||
}
|
||||
},
|
||||
"thermostatFanMode": {
|
||||
"thermostatFanMode": {
|
||||
"value": "auto",
|
||||
"data": {
|
||||
"supportedThermostatFanModes": ["auto", "on", "circulate"]
|
||||
},
|
||||
"timestamp": "2025-05-17T03:45:45.413Z"
|
||||
},
|
||||
"supportedThermostatFanModes": {
|
||||
"value": ["auto", "on", "circulate"],
|
||||
"timestamp": "2025-05-17T03:45:45.413Z"
|
||||
}
|
||||
},
|
||||
"thermostatMode": {
|
||||
"thermostatMode": {
|
||||
"value": "auto",
|
||||
"data": {
|
||||
"supportedThermostatModes": [
|
||||
"off",
|
||||
"heat",
|
||||
"cool",
|
||||
"emergency heat",
|
||||
"auto"
|
||||
]
|
||||
},
|
||||
"timestamp": "2025-05-17T05:45:53.597Z"
|
||||
},
|
||||
"supportedThermostatModes": {
|
||||
"value": ["off", "heat", "cool", "emergency heat", "auto"],
|
||||
"timestamp": "2025-05-17T03:45:45.413Z"
|
||||
}
|
||||
},
|
||||
"thermostatCoolingSetpoint": {
|
||||
"coolingSetpointRange": {
|
||||
"value": null
|
||||
},
|
||||
"coolingSetpoint": {
|
||||
"value": 75,
|
||||
"unit": "F",
|
||||
"timestamp": "2025-05-17T14:16:13.677Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"deviceId": "2409a73c-918a-4d1f-b4f5-c27468c71d70",
|
||||
"name": "Sensi Thermostat",
|
||||
"label": "Thermostat",
|
||||
"manufacturerName": "0AKf",
|
||||
"presentationId": "sensi_thermostat",
|
||||
"deviceManufacturerCode": "Emerson",
|
||||
"locationId": "fc2fb744-4d34-4276-be33-56bbc6af266e",
|
||||
"ownerId": "aecdb855-3ab7-9305-c0e3-0dced524e5dc",
|
||||
"roomId": "025f6d30-c16c-4d11-8be2-03d5f4708d86",
|
||||
"components": [
|
||||
{
|
||||
"id": "main",
|
||||
"label": "main",
|
||||
"capabilities": [
|
||||
{
|
||||
"id": "temperatureMeasurement",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "thermostatCoolingSetpoint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "thermostatHeatingSetpoint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "thermostatOperatingState",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "thermostatMode",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "thermostatFanMode",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "relativeHumidityMeasurement",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "healthCheck",
|
||||
"version": 1
|
||||
}
|
||||
],
|
||||
"categories": [
|
||||
{
|
||||
"name": "Thermostat",
|
||||
"categoryType": "manufacturer"
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"createTime": "2022-04-16T19:45:50.864Z",
|
||||
"profile": {
|
||||
"id": "923a86cc-983f-4cb1-98da-64fb5aa435ca"
|
||||
},
|
||||
"viper": {
|
||||
"manufacturerName": "Emerson",
|
||||
"modelName": "1F95U-42WF",
|
||||
"swVersion": "6004971003",
|
||||
"endpointAppId": "viper_7722c3c0-dfc1-11e9-9149-4f2618178093"
|
||||
},
|
||||
"type": "VIPER",
|
||||
"restrictionTier": 0,
|
||||
"allowed": null,
|
||||
"executionContext": "CLOUD",
|
||||
"relationships": []
|
||||
}
|
||||
],
|
||||
"_links": {}
|
||||
}
|
@ -797,6 +797,90 @@
|
||||
'state': 'heat',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][climate.thermostat-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'fan_modes': list([
|
||||
'auto',
|
||||
'on',
|
||||
'circulate',
|
||||
]),
|
||||
'hvac_modes': list([
|
||||
<HVACMode.OFF: 'off'>,
|
||||
<HVACMode.HEAT: 'heat'>,
|
||||
<HVACMode.COOL: 'cool'>,
|
||||
<HVACMode.HEAT: 'heat'>,
|
||||
<HVACMode.HEAT_COOL: 'heat_cool'>,
|
||||
]),
|
||||
'max_temp': 35.0,
|
||||
'min_temp': 7.0,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'climate',
|
||||
'entity_category': None,
|
||||
'entity_id': 'climate.thermostat',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 395>,
|
||||
'translation_key': None,
|
||||
'unique_id': '2409a73c-918a-4d1f-b4f5-c27468c71d70_main',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][climate.thermostat-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'current_humidity': 49,
|
||||
'current_temperature': 23.6,
|
||||
'fan_mode': 'auto',
|
||||
'fan_modes': list([
|
||||
'auto',
|
||||
'on',
|
||||
'circulate',
|
||||
]),
|
||||
'friendly_name': 'Thermostat',
|
||||
'hvac_action': <HVACAction.IDLE: 'idle'>,
|
||||
'hvac_modes': list([
|
||||
<HVACMode.OFF: 'off'>,
|
||||
<HVACMode.HEAT: 'heat'>,
|
||||
<HVACMode.COOL: 'cool'>,
|
||||
<HVACMode.HEAT: 'heat'>,
|
||||
<HVACMode.HEAT_COOL: 'heat_cool'>,
|
||||
]),
|
||||
'max_temp': 35.0,
|
||||
'min_temp': 7.0,
|
||||
'supported_features': <ClimateEntityFeature: 395>,
|
||||
'target_temp_high': 23.9,
|
||||
'target_temp_low': 21.7,
|
||||
'temperature': None,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'climate.thermostat',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'heat_cool',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[virtual_thermostat][climate.asd-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -1751,6 +1751,39 @@
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_devices[sensi_thermostat]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
'config_entries': <ANY>,
|
||||
'config_entries_subentries': <ANY>,
|
||||
'configuration_url': 'https://account.smartthings.com',
|
||||
'connections': set({
|
||||
}),
|
||||
'disabled_by': None,
|
||||
'entry_type': None,
|
||||
'hw_version': None,
|
||||
'id': <ANY>,
|
||||
'identifiers': set({
|
||||
tuple(
|
||||
'smartthings',
|
||||
'2409a73c-918a-4d1f-b4f5-c27468c71d70',
|
||||
),
|
||||
}),
|
||||
'is_new': False,
|
||||
'labels': set({
|
||||
}),
|
||||
'manufacturer': 'Emerson',
|
||||
'model': '1F95U-42WF',
|
||||
'model_id': None,
|
||||
'name': 'Thermostat',
|
||||
'name_by_user': None,
|
||||
'primary_config_entry': <ANY>,
|
||||
'serial_number': None,
|
||||
'suggested_area': None,
|
||||
'sw_version': '6004971003',
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_devices[sensibo_airconditioner_1]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
|
@ -11327,6 +11327,110 @@
|
||||
'state': '-1042',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][sensor.thermostat_humidity-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.thermostat_humidity',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.HUMIDITY: 'humidity'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Humidity',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2409a73c-918a-4d1f-b4f5-c27468c71d70_main_relativeHumidityMeasurement_humidity_humidity',
|
||||
'unit_of_measurement': '%',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][sensor.thermostat_humidity-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'humidity',
|
||||
'friendly_name': 'Thermostat Humidity',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': '%',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.thermostat_humidity',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '49',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][sensor.thermostat_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.thermostat_temperature',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Temperature',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2409a73c-918a-4d1f-b4f5-c27468c71d70_main_temperatureMeasurement_temperature_temperature',
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensi_thermostat][sensor.thermostat_temperature-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'temperature',
|
||||
'friendly_name': 'Thermostat Temperature',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.thermostat_temperature',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '23.6',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensibo_airconditioner_1][sensor.office_air_conditioner_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -516,53 +516,6 @@
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_sc_000001][switch.airdresser_sanitize-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.airdresser_sanitize',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Sanitize',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'sanitize',
|
||||
'unique_id': 'b93211bf-9d96-bd21-3b2f-964fcc87f5cc_main_samsungce.steamClosetSanitizeMode_status_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_sc_000001][switch.airdresser_sanitize-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'AirDresser Sanitize',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.airdresser_sanitize',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_sc_000001][switch.airdresser_auto_cycle_link-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
@ -657,6 +610,53 @@
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_sc_000001][switch.airdresser_sanitize-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.airdresser_sanitize',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Sanitize',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'sanitize',
|
||||
'unique_id': 'b93211bf-9d96-bd21-3b2f-964fcc87f5cc_main_samsungce.steamClosetSanitizeMode_status_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_sc_000001][switch.airdresser_sanitize-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'AirDresser Sanitize',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.airdresser_sanitize',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wd_000001][switch.dryer_wrinkle_prevent-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -613,7 +613,7 @@ async def test_thermostat_set_fan_mode(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("device_fixture", ["virtual_thermostat"])
|
||||
@pytest.mark.parametrize("device_fixture", ["sensi_thermostat"])
|
||||
async def test_thermostat_set_hvac_mode(
|
||||
hass: HomeAssistant,
|
||||
devices: AsyncMock,
|
||||
@ -625,11 +625,11 @@ async def test_thermostat_set_hvac_mode(
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_HVAC_MODE,
|
||||
{ATTR_ENTITY_ID: "climate.asd", ATTR_HVAC_MODE: HVACMode.HEAT_COOL},
|
||||
{ATTR_ENTITY_ID: "climate.thermostat", ATTR_HVAC_MODE: HVACMode.HEAT_COOL},
|
||||
blocking=True,
|
||||
)
|
||||
devices.execute_device_command.assert_called_once_with(
|
||||
"2894dc93-0f11-49cc-8a81-3a684cebebf6",
|
||||
"2409a73c-918a-4d1f-b4f5-c27468c71d70",
|
||||
Capability.THERMOSTAT_MODE,
|
||||
Command.SET_THERMOSTAT_MODE,
|
||||
MAIN,
|
||||
|
Loading…
x
Reference in New Issue
Block a user