Fix Tado unique mobile device dispatcher (#107631)
* Add unique home ID device dispatch * Adding fixture for new setup * Minor refactor work * Add check for unlinked to different homes * If the interface returns an error * Proper error handling * Feedback fixes * Comments for error in client * Typo * Update homeassistant/components/tado/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/tado/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update devices fix standard * Dispatch out of loop * Update dispatcher * Clean up --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
093e35f4d4
commit
15e3af72d1
5 changed files with 74 additions and 14 deletions
26
tests/components/tado/fixtures/mobile_devices.json
Normal file
26
tests/components/tado/fixtures/mobile_devices.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
[
|
||||
{
|
||||
"name": "Home",
|
||||
"id": 123456,
|
||||
"settings": {
|
||||
"geoTrackingEnabled": false,
|
||||
"specialOffersEnabled": false,
|
||||
"onDemandLogRetrievalEnabled": false,
|
||||
"pushNotifications": {
|
||||
"lowBatteryReminder": true,
|
||||
"awayModeReminder": true,
|
||||
"homeModeReminder": true,
|
||||
"openWindowReminder": true,
|
||||
"energySavingsReportReminder": true,
|
||||
"incidentDetection": true,
|
||||
"energyIqReminder": false
|
||||
}
|
||||
},
|
||||
"deviceMetadata": {
|
||||
"platform": "Android",
|
||||
"osVersion": "14",
|
||||
"model": "Samsung",
|
||||
"locale": "nl"
|
||||
}
|
||||
}
|
||||
]
|
|
@ -17,6 +17,7 @@ async def async_init_integration(
|
|||
|
||||
token_fixture = "tado/token.json"
|
||||
devices_fixture = "tado/devices.json"
|
||||
mobile_devices_fixture = "tado/mobile_devices.json"
|
||||
me_fixture = "tado/me.json"
|
||||
weather_fixture = "tado/weather.json"
|
||||
home_state_fixture = "tado/home_state.json"
|
||||
|
@ -70,6 +71,10 @@ async def async_init_integration(
|
|||
"https://my.tado.com/api/v2/homes/1/devices",
|
||||
text=load_fixture(devices_fixture),
|
||||
)
|
||||
m.get(
|
||||
"https://my.tado.com/api/v2/homes/1/mobileDevices",
|
||||
text=load_fixture(mobile_devices_fixture),
|
||||
)
|
||||
m.get(
|
||||
"https://my.tado.com/api/v2/devices/WR1/",
|
||||
text=load_fixture(device_wr1_fixture),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue