Skip to content

Commit

Permalink
next
Browse files Browse the repository at this point in the history
  • Loading branch information
HGlab01 committed Oct 17, 2024
1 parent 140b74f commit 1a13d73
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Tado extends utils.Adapter {
if (set_terminationMode == 'NO_OVERLAY') {
if (set_power == 'ON') {
this.log.info(`Overlay cleared for room '${roomId}' in home '${homeId}'`);
await this.setResumeScheduleTadoX(homeId, roomId);
await this.setResumeRoomScheduleTadoX(homeId, roomId);
break;
}
else {
Expand Down Expand Up @@ -185,9 +185,6 @@ class Tado extends utils.Adapter {
const homeId = idSplitted[2];
const zoneId = idSplitted[4];
const deviceId = idSplitted[6];
const homeId = idSplitted[2];
const zoneId = idSplitted[4];
const deviceId = idSplitted[6];
const statename = idSplitted[idSplitted.length - 1];
const beforeStatename = idSplitted[idSplitted.length - 2];
this.log.debug(`Attribute '${id}' changed. '${statename}' will be checked.`);
Expand Down Expand Up @@ -1110,7 +1107,7 @@ class Tado extends utils.Adapter {
this.home_data = await this.getHome(HomeId);
}
this.log.debug('Home_data Result: ' + JSON.stringify(this.home_data));
if (this.Home_data.generation == 'LINE_X') this.isTadoX = true;
if (this.home_data.generation == 'LINE_X') this.isTadoX = true;
else this.isTadoX = false;
this.log.info('TadoX is ' + this.isTadoX);
if (this.home_data == null) throw new Error('home_date is null');
Expand Down Expand Up @@ -1608,6 +1605,18 @@ class Tado extends utils.Adapter {
async getHomeState(homeId) {
return await this.apiCall(`/api/v2/homes/${homeId}/state`);
}

async getRoomsTadoX(home_id) {
return this.apiCall(`${tadoX_url}/homes/${home_id}/rooms`);
}

async getRoomStateTadoX(home_id, zone_id) {
return this.apiCall(`${tadoX_url}/homes/${home_id}/rooms/${zone_id}`);
}

async getRoomsAndDevicesTadoX(home_id) {
return this.apiCall(`${tadoX_url}/homes/${home_id}/roomsAndDevices`);
}
}

function toBoolean(valueToBoolean) {
Expand Down

0 comments on commit 1a13d73

Please sign in to comment.