From 5225b73fb0bdd697603f8e1b218f9453ce9fcaa2 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Thu, 31 Oct 2024 15:02:45 +0100 Subject: [PATCH] types: improve activity data point, add support for ac power --- src/types/enums.ts | 1 + src/types/index.ts | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/types/enums.ts b/src/types/enums.ts index 850efd2..f1af042 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -72,6 +72,7 @@ export type ZoneOverlayTerminationTypeSkillBasedApp = "MANUAL" | "NEXT_TIME_BLOC export enum DataPointType { PERCENTAGE = "PERCENTAGE", TEMPERATURE = "TEMPERATURE", + POWER = "POWER", } export type TimeTableDayType = diff --git a/src/types/index.ts b/src/types/index.ts index 8faee92..b83bcca 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -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;