Skip to content

Commit

Permalink
TadoX
Browse files Browse the repository at this point in the history
  • Loading branch information
HGlab01 committed Oct 6, 2024
1 parent fcadddc commit 3968e3d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ class Tado extends utils.Adapter {
} else {
this.log.debug('CheckExpire() at DoDataRefresh() if not outdated started');
await jsonExplorer.checkExpire(homeID + '.Rooms.*');
await jsonExplorer.checkExpire(homeID + '.Rooms1.*');
await jsonExplorer.checkExpire(homeID + '.Weather.*');
await jsonExplorer.checkExpire(homeID + '.Mobile_Devices.*');
}
Expand Down Expand Up @@ -980,7 +981,14 @@ class Tado extends utils.Adapter {
jsonExplorer.traverseJson(this.MobileDevices_data, `${HomeId}.Mobile_Devices`, true, true, 0);
}

async DoRooms(HomeId) {
let rooms = await this.getRooms(HomeId);
this.log.info(JSON.stringify(rooms));
jsonExplorer.traverseJson(rooms, `${HomeId}.Rooms1`, true, true, 0);
}

async DoZones(HomeId) {
this.DoRooms(HomeId);
this.Zones_data = await this.getZones(HomeId);
this.log.debug('Zones_data Result: ' + JSON.stringify(this.Zones_data));
this.DoWriteJsonRespons(HomeId, 'Stage_08_ZonesData', this.Zones_data);
Expand Down Expand Up @@ -1383,6 +1391,10 @@ class Tado extends utils.Adapter {
return this.apiCall(`/api/v2/homes/${home_id}/zones`);
}

getRooms(home_id) {
return this.apiCall(`https://hops.tado.com/homes/${home_id}/rooms`);
}

getZoneState(home_id, zone_id) {
return this.apiCall(`/api/v2/homes/${home_id}/zones/${zone_id}/state`);
}
Expand Down

0 comments on commit 3968e3d

Please sign in to comment.