Skip to content

Commit

Permalink
Fix airComfort to use OAuth2
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdavis90 committed Nov 18, 2023
1 parent e2d39b8 commit 03e5a81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ class Tado {
async getAirComfortDetailed(home_id) {
const home = await this.getHome(home_id);
const location = `latitude=${home.geolocation.latitude}&longitude=${home.geolocation.longitude}`;
const login = `username=${this._username}&password=${this._password}`;
const resp = await (0, axios_1.default)(`https://acme.tado.com/v1/homes/${home_id}/airComfort?${location}&${login}`);
return resp.data;
return this.apiCall(`https://acme.tado.com/v1/homes/${home_id}/airComfort?${location}`);
}
async getEnergyIQ(home_id) {
const home = await this.getHome(home_id);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-tado-client",
"version": "0.13.7",
"version": "0.13.8",
"description": "A Tado client for nodejs",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,9 @@ export class Tado {
async getAirComfortDetailed(home_id: number): Promise<AirComfortDetailed> {
const home = await this.getHome(home_id)
const location = `latitude=${home.geolocation.latitude}&longitude=${home.geolocation.longitude}`
const login = `username=${this._username}&password=${this._password}`
const resp = await axios(
`https://acme.tado.com/v1/homes/${home_id}/airComfort?${location}&${login}`
return this.apiCall(
`https://acme.tado.com/v1/homes/${home_id}/airComfort?${location}`
)
return resp.data
}

async getEnergyIQ(home_id: number): Promise<EnergyIQ> {
Expand Down

0 comments on commit 03e5a81

Please sign in to comment.