Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use hops endpoint for TadoX AirComfort #107

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {
AddEnergiIQMeterReadingResponse,
AirComfort,
AirComfortDetailed,
BoilerSystemInformation,
Country,
Expand Down Expand Up @@ -579,16 +578,6 @@ export class BaseTado {
}
}

/**
* Retrieves the air comfort details for a given home.
*
* @param home_id - The ID of the home for which to get the air comfort details.
* @returns A promise that resolves to an AirComfort object containing the air comfort details.
*/
getAirComfort(home_id: number): Promise<AirComfort> {
return this.apiCall(`/api/v2/homes/${home_id}/airComfort`);
}

/**
* Fetches detailed air comfort information for a specific home.
*
Expand Down
11 changes: 11 additions & 0 deletions src/tado.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
ACMode,
AirComfort,
AwayConfiguration,
DeepPartial,
DefaultOverlay,
Expand Down Expand Up @@ -714,4 +715,14 @@ export class Tado extends BaseTado {
childLockEnabled: child_lock,
});
}

/**
* Retrieves the air comfort details for a given home.
*
* @param home_id - The ID of the home for which to get the air comfort details.
* @returns A promise that resolves to an AirComfort object containing the air comfort details.
*/
getAirComfort(home_id: number): Promise<AirComfort> {
return this.apiCall(`/api/v2/homes/${home_id}/airComfort`);
}
}
14 changes: 14 additions & 0 deletions src/tadox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
ActionableDevice,
AirComfort,
FlowTemperatureOptimization,
Power,
XFeatures,
Expand Down Expand Up @@ -309,4 +310,17 @@ export class TadoX extends BaseTado {
maxFlowTemperature: temperature,
});
}

/**
* Retrieves the air comfort details for a given home.
*
* @param home_id - The ID of the home for which to get the air comfort details.
* @returns A promise that resolves to an AirComfort object containing the air comfort details.
*/
async getAirComfort(home_id: number): Promise<AirComfort> {
const resp = (await this.apiCallX(`/api/v2/homes/${home_id}/airComfort`)) as {
data: AirComfort;
};
return resp.data;
}
}
Loading