diff --git a/index.d.ts b/index.d.ts index b52adc7..237c971 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1782,6 +1782,7 @@ declare module "zigbee-clusters" { controlSequenceOfOperation: { id: 0x1b, type: ZCLDataType<"cooling" | "coolingWithReheat" | "heating" | "heatingWithReheat" | "coolingAndHeating4Pipes" | "coolingAndHeating4PipesWithReheat"> }, systemMode: { id: 0x1c, type: ZCLDataType<"off" | "auto" | "cool" | "heat" | "emergencyHeating" | "precooling" | "fanOnly" | "dry" | "sleep"> }, alarmMask: { id: 0x1d, type: ZCLDataType> }, + runningMode: { id: 0x1e, type: ZCLDataType<"off" | "cool" | "heat"> }, }; type ThermostatClusterCommands = { setSetpoint: { id: 0x00, direction: "DIRECTION_SERVER_TO_CLIENT", args: { @@ -1816,6 +1817,14 @@ declare module "zigbee-clusters" { type DehumidificationControlClusterCommands = Record; class DehumidificationControlCluster extends Cluster { } + type ThermostatUserInterfaceConfigurationClusterAttributes = { + temperatureDisplayMode: { id: 0x00, type: ZCLDataType<"celsius" | "fahrenheit"> }, + keypadLockout: { id: 0x01, type: ZCLDataType<"none" | "level1" | "level2" | "level3" | "level4" | "level5"> }, + scheduleProgrammingVisibility: { id: 0x02, type: ZCLDataType<"enabled" | "disabled"> }, + }; + type ThermostatUserInterfaceConfigurationClusterCommands = Record; + class ThermostatUserInterfaceConfigurationCluster extends Cluster { + } type ColorControlClusterAttributes = { currentHue: { id: 0x00, type: ZCLDataType }, currentSaturation: { id: 0x01, type: ZCLDataType }, @@ -2517,6 +2526,12 @@ declare module "zigbee-clusters" { ATTRIBUTES: Readonly, COMMANDS: Readonly, }, + THERMOSTAT_UI_CONFIGURATION: { + ID: 0x0204, + NAME: "thermostatUserInterfaceConfiguration", + ATTRIBUTES: Readonly, + COMMANDS: Readonly, + }, PUMP_CONFIGURATION_AND_CONTROL: { ID: 0x0200, NAME: "pumpConfigurationAndControl", @@ -2654,6 +2669,7 @@ declare module "zigbee-clusters" { "doorLock"?: DoorLockCluster; "windowCovering"?: WindowCoveringCluster; "thermostat"?: ThermostatCluster; + "thermostatUserInterfaceConfiguration"?: ThermostatUserInterfaceConfigurationCluster; "pumpConfigurationAndControl"?: PumpConfigurationAndControlCluster; "fanControl"?: FanControlCluster; "colorControl"?: ColorControlCluster; @@ -3239,6 +3255,7 @@ declare module "zigbee-clusters" { type CommandDefinition = { id: number, + manufacturerId?: number, direction?: CommandDirection, args?: { [argName: string]: ZCLDataType, diff --git a/lib/clusters/index.js b/lib/clusters/index.js index ec314e3..cf5718b 100644 --- a/lib/clusters/index.js +++ b/lib/clusters/index.js @@ -30,6 +30,7 @@ const ThermostatCluster = require('./thermostat'); const PumpConfigurationAndControlCluster = require('./pumpConfigurationAndControl'); const FanControlCluster = require('./fanControl'); const DehumidificationControlCluster = require('./dehumidificationControl'); +const ThermostatUserInterfaceConfigurationCluster = require('./thermostatUserInterfaceConfiguration'); const ColorControlCluster = require('./colorControl'); const BallastConfigurationCluster = require('./ballastConfiguration'); const IlluminanceMeasurementCluster = require('./illuminanceMeasurement'); @@ -95,6 +96,7 @@ module.exports = { PumpConfigurationAndControlCluster, // 0x0200 => 512 FanControlCluster, // 0x0202 => 514 DehumidificationControlCluster, // 0x0203 => 515 + ThermostatUserInterfaceConfigurationCluster, // 0x0204 => 516 ColorControlCluster, // 0x0300 => 768 BallastConfigurationCluster, // 0x0301 => 769 IlluminanceMeasurementCluster, // 0x0400 => 1024 @@ -139,6 +141,7 @@ module.exports = { DOOR_LOCK: destructConstProps(DoorLockCluster), WINDOW_COVERING: destructConstProps(WindowCoveringCluster), THERMOSTAT: destructConstProps(ThermostatCluster), + THERMOSTAT_UI_CONFIGURATION: destructConstProps(ThermostatUserInterfaceConfigurationCluster), PUMP_CONFIGURATION_AND_CONTROL: destructConstProps(PumpConfigurationAndControlCluster), FAN_CONTROL: destructConstProps(FanControlCluster), COLOR_CONTROL: destructConstProps(ColorControlCluster), diff --git a/lib/clusters/thermostat.js b/lib/clusters/thermostat.js index af6cf95..e8d73ce 100644 --- a/lib/clusters/thermostat.js +++ b/lib/clusters/thermostat.js @@ -50,6 +50,14 @@ const ATTRIBUTES = { }), }, alarmMask: { id: 29, type: ZCLDataTypes.map8('initializationFailure', 'hardwareFailure', 'selfCalibrationFailure') }, + runningMode: { + id: 30, + type: ZCLDataTypes.enum8({ + off: 0, + cool: 3, + heat: 4, + }), + }, }; const COMMANDS = { diff --git a/lib/clusters/thermostatUserInterfaceConfiguration.js b/lib/clusters/thermostatUserInterfaceConfiguration.js new file mode 100644 index 0000000..09531e3 --- /dev/null +++ b/lib/clusters/thermostatUserInterfaceConfiguration.js @@ -0,0 +1,58 @@ +'use strict'; + +const Cluster = require('../Cluster'); +const { ZCLDataTypes } = require('../zclTypes'); + +const ATTRIBUTES = { + temperatureDisplayMode: { + id: 0, + type: ZCLDataTypes.enum8({ + celsius: 0, + fahrenheit: 1, + }), + }, + keypadLockout: { + id: 1, + type: ZCLDataTypes.enum8({ + none: 0, + level1: 1, + level2: 2, + level3: 3, + level4: 4, + level5: 5, + }), + }, + scheduleProgrammingVisibility: { + id: 2, + type: ZCLDataTypes.enum8({ + enabled: 0, + disabled: 1, + }), + }, +}; + +const COMMANDS = {}; + +class ThermostatUserInterfaceConfigurationCluster extends Cluster { + + static get ID() { + return 516; + } + + static get NAME() { + return 'thermostatUserInterfaceConfiguration'; + } + + static get ATTRIBUTES() { + return ATTRIBUTES; + } + + static get COMMANDS() { + return COMMANDS; + } + +} + +Cluster.addCluster(ThermostatUserInterfaceConfigurationCluster); + +module.exports = ThermostatUserInterfaceConfigurationCluster; diff --git a/scripts/template.d.ts.txt b/scripts/template.d.ts.txt index 0ac980f..c3937d9 100644 --- a/scripts/template.d.ts.txt +++ b/scripts/template.d.ts.txt @@ -565,6 +565,7 @@ declare module 'zigbee-clusters' { type CommandDefinition = { id: number, + manufacturerId?: number, direction?: CommandDirection, args?: { [argName: string]: ZCLDataType,