1
0
mirror of https://github.com/home-assistant/core.git synced 2026-03-03 08:10:36 +00:00
Files
core/tests/components/ecobee/fixtures/ecobee-data.json
myztillx 6861bbed79 Add ecobee set_sensors_used_in_climate service (#102871)
* Add set_active_sensors Service

* Remove version bump from service addition commit

* Reviewer suggested changes

* Changed naming to be more clear of functionality

* Adjusted additional naming to follow new convention

* Updated to pass failing CI tests

* Fix typo

* Fix to pass CI

* Changed argument from climate_name to preset_mode and changed service error

* Made loop more clear and changed raised error to log msg

* Fix typo

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Removed code that was accidentally added back in and fixed mypy errors

* Add icon for service

* Added sensors as attributes and updated tests

* Revert changes made in #126587

* Added tests for remote_sensors and set_sensors_used_in_climate

* Changed back to load multiplatforms (#126587)

* Check for empty sensor list and negative tests for errors raised

* Added tests and fixed errors

* Add hass to class init to allow for device_registry lookup at startup and check for name changed by user

* Added tests to test the new functions

* Simplified code and fixed testing error for simplification

* Added freeze in test

* Fixed device filtering

* Simplified code section

* Maintains the ability to call `set_sensors_used_in_climate` function even is the user changes the device name from the ecobee app or thermostat without needing to reload home assistant.

* Update tests with new functionality. Changed thermostat identifier to a string, since that is what is provided via the ecobee api

* Changed function parameter

* Search for specific ecobee identifier

* Moved errors to strings.json

* Added test for sensor not on thermostat

* Improved tests and updated device check

* Added attributes to _unrecoreded_attributes

* Changed name to be more clear

* Improve error message and add test for added property

* Renamed variables for clarity

* Added device_id to available_sensors to make it easier on user to find it

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-10-21 16:21:56 +02:00

297 lines
7.0 KiB
JSON

{
"thermostatList": [
{
"identifier": "8675309",
"name": "ecobee",
"modelNumber": "athenaSmart",
"utcTime": "2022-01-01 10:00:00",
"thermostatTime": "2022-01-01 6:00:00",
"location": {
"timeZone": "America/Toronto"
},
"program": {
"climates": [
{
"name": "Home",
"climateRef": "home",
"sensors": [
{
"name": "ecobee"
}
]
},
{
"name": "Climate1",
"climateRef": "c1",
"sensors": [
{
"name": "ecobee"
}
]
},
{
"name": "Climate2",
"climateRef": "c2",
"sensors": [
{
"name": "ecobee"
}
]
}
],
"currentClimateRef": "c1"
},
"runtime": {
"connected": true,
"actualTemperature": 300,
"actualHumidity": 15,
"desiredHeat": 400,
"desiredCool": 200,
"desiredFanMode": "on",
"desiredHumidity": 40
},
"settings": {
"hvacMode": "auto",
"heatStages": 1,
"coolStages": 1,
"fanMinOnTime": 10,
"heatCoolMinDelta": 50,
"holdAction": "nextTransition",
"ventilatorType": "hrv",
"ventilatorMinOnTimeHome": 20,
"ventilatorMinOnTimeAway": 10,
"ventilatorOffDateTime": "2022-01-01 6:00:00",
"isVentilatorTimerOn": false,
"hasHumidifier": true,
"humidifierMode": "manual",
"hasHeatPump": false,
"humidity": "30"
},
"equipmentStatus": "fan",
"events": [
{
"name": "Event1",
"running": true,
"type": "hold",
"holdClimateRef": "away",
"startDate": "2022-02-02",
"startTime": "11:00:00",
"endDate": "2022-01-01",
"endTime": "10:00:00"
}
],
"remoteSensors": [
{
"id": "ei:0",
"name": "ecobee",
"type": "thermostat",
"inUse": true,
"capability": [
{
"id": "1",
"type": "temperature",
"value": "782"
},
{
"id": "2",
"type": "humidity",
"value": "54"
}
]
},
{
"id": "rs:100",
"name": "Remote Sensor 1",
"type": "ecobee3_remote_sensor",
"code": "WKRP",
"inUse": false,
"capability": [
{
"id": "1",
"type": "temperature",
"value": "782"
},
{
"id": "2",
"type": "occupancy",
"value": "false"
}
]
}
]
},
{
"identifier": 8675308,
"name": "ecobee2",
"modelNumber": "athenaSmart",
"program": {
"climates": [
{
"name": "Climate1",
"climateRef": "c1"
},
{
"name": "Climate2",
"climateRef": "c2"
}
],
"currentClimateRef": "c1"
},
"runtime": {
"connected": true,
"actualTemperature": 300,
"actualHumidity": 15,
"desiredHeat": 400,
"desiredCool": 200,
"desiredFanMode": "on",
"desiredHumidity": 40
},
"settings": {
"hvacMode": "auto",
"heatStages": 1,
"coolStages": 1,
"fanMinOnTime": 10,
"heatCoolMinDelta": 50,
"holdAction": "nextTransition",
"ventilatorType": "none",
"ventilatorMinOnTimeHome": 20,
"ventilatorMinOnTimeAway": 10,
"isVentilatorTimerOn": false,
"hasHumidifier": true,
"humidifierMode": "manual",
"hasHeatPump": true,
"humidity": "30"
},
"equipmentStatus": "fan",
"events": [
{
"name": "Event1",
"running": true,
"type": "hold",
"holdClimateRef": "away",
"startDate": "2022-02-02",
"startTime": "11:00:00",
"endDate": "2022-01-01",
"endTime": "10:00:00"
}
],
"remoteSensors": [
{
"id": "rs:100",
"name": "Remote Sensor 1",
"type": "ecobee3_remote_sensor",
"code": "WKRP",
"inUse": false,
"capability": [
{
"id": "1",
"type": "temperature",
"value": "782"
},
{
"id": "2",
"type": "occupancy",
"value": "false"
}
]
},
{
"id": "rs:101",
"name": "Remote Sensor 2",
"type": "ecobee3_remote_sensor",
"code": "VTRK",
"inUse": false,
"capability": [
{
"id": "1",
"type": "temperature",
"value": "782"
},
{
"id": "2",
"type": "occupancy",
"value": "false"
}
]
}
]
},
{
"identifier": 8675307,
"name": "unknownEcobeeName",
"modelNumber": "unknownEcobeeModel",
"program": {
"climates": [
{
"name": "Climate1",
"climateRef": "c1"
},
{
"name": "Climate2",
"climateRef": "c2"
}
],
"currentClimateRef": "c1"
},
"runtime": {
"connected": true,
"actualTemperature": 300,
"desiredHeat": 400,
"desiredCool": 200,
"desiredFanMode": "on",
"desiredHumidity": 40
},
"settings": {
"hvacMode": "auto",
"heatStages": 1,
"coolStages": 1,
"fanMinOnTime": 10,
"heatCoolMinDelta": 50,
"holdAction": "nextTransition",
"ventilatorType": "none",
"ventilatorMinOnTimeHome": 20,
"ventilatorMinOnTimeAway": 10,
"isVentilatorTimerOn": false,
"hasHumidifier": true,
"humidifierMode": "manual",
"hasHeatPump": false,
"humidity": "30"
},
"equipmentStatus": "fan",
"events": [
{
"name": "Event1",
"running": true,
"type": "hold",
"holdClimateRef": "away",
"startDate": "2022-02-02",
"startTime": "11:00:00",
"endDate": "2022-01-01",
"endTime": "10:00:00"
}
],
"remoteSensors": [
{
"id": "rs:100",
"name": "Remote Sensor 1",
"type": "ecobee3_remote_sensor",
"code": "WKRP",
"inUse": false,
"capability": [
{
"id": "1",
"type": "temperature",
"value": "782"
},
{
"id": "2",
"type": "occupancy",
"value": "false"
}
]
}
]
}
]
}