Skip to content

Commit

Permalink
Merge pull request #81 from abn/types/fix-datapoint
Browse files Browse the repository at this point in the history
types: improve activity data point, add support for ac power
  • Loading branch information
mattdavis90 authored Oct 31, 2024
2 parents b36f25b + 5225b73 commit 166c3f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/types/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export type ZoneOverlayTerminationTypeSkillBasedApp = "MANUAL" | "NEXT_TIME_BLOC
export enum DataPointType {
PERCENTAGE = "PERCENTAGE",
TEMPERATURE = "TEMPERATURE",
POWER = "POWER",
}

export type TimeTableDayType =
Expand Down
24 changes: 20 additions & 4 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,30 @@ export type DataPointTemperature = Temperature & {
type: DataPointType.TEMPERATURE;
timestamp: string;
precision: Temperature;
} & {
value?: Power;
};

export type DataPoint = DataPointPercentage | DataPointTemperature;

export type ZoneActivityDataPoints = {
heatingPower: DataPoint;
export type DataPointPower = {
type: DataPointType.POWER;
power: Power;
};

export type DataPointHeating = DataPointPercentage | DataPointTemperature;

/**
* @deprecated Use {@link DataPointHeating} instead.
*/
export type DataPoint = DataPointHeating;

export type ZoneActivityDataPoints =
| {
heatingPower: DataPointHeating;
}
| {
acPower: DataPointPower;
};

export type ZoneStateSensorDataPoints = {
insideTemperature: DataPointTemperature;
humidity: DataPointPercentage;
Expand Down

0 comments on commit 166c3f4

Please sign in to comment.