From 81d1f5d3dcac47008876c4032beb44fbc5b29a8f Mon Sep 17 00:00:00 2001 From: Dominic Griesel Date: Tue, 26 Jul 2022 12:04:29 +0200 Subject: [PATCH] feat(cc): implement Inclusion Controller CC --- packages/cc/src/cc/InclusionControllerCC.ts | 156 ++++++++++++++++++++ packages/cc/src/cc/index.ts | 5 + packages/cc/src/lib/API.ts | 3 + packages/cc/src/lib/_Types.ts | 153 +++---------------- 4 files changed, 183 insertions(+), 134 deletions(-) create mode 100644 packages/cc/src/cc/InclusionControllerCC.ts diff --git a/packages/cc/src/cc/InclusionControllerCC.ts b/packages/cc/src/cc/InclusionControllerCC.ts new file mode 100644 index 000000000000..1dcaadbaab0e --- /dev/null +++ b/packages/cc/src/cc/InclusionControllerCC.ts @@ -0,0 +1,156 @@ +import { CommandClasses, Maybe, validatePayload } from "@zwave-js/core"; +import type { ZWaveHost } from "@zwave-js/host"; +import { CCAPI } from "../lib/API"; +import { + CommandClass, + gotDeserializationOptions, + type CCCommandOptions, + type CommandClassDeserializationOptions, +} from "../lib/CommandClass"; +import { + API, + CCCommand, + commandClass, + expectedCCResponse, + implementedVersion, +} from "../lib/CommandClassDecorators"; +import { + InclusionControllerCommand, + InclusionControllerStatus, + InclusionControllerStep, +} from "../lib/_Types"; + +@commandClass(CommandClasses["Inclusion Controller"]) +@implementedVersion(1) +export class InclusionControllerCC extends CommandClass { + declare ccCommand: InclusionControllerCommand; +} + +@API(CommandClasses["Inclusion Controller"]) +export class InclusionControllerCCAPI extends CCAPI { + public supportsCommand(cmd: InclusionControllerCommand): Maybe { + switch (cmd) { + case InclusionControllerCommand.Initiate: + case InclusionControllerCommand.Complete: + return true; // This is mandatory + } + return super.supportsCommand(cmd); + } + + /** Instruct the target to initiate the given inclusion step for the given node */ + public async initiateStep( + nodeId: number, + step: InclusionControllerStep, + ): Promise { + this.assertSupportsCommand( + InclusionControllerCommand, + InclusionControllerCommand.Initiate, + ); + + const cc = new InclusionControllerCCInitiate(this.applHost, { + nodeId: this.endpoint.nodeId, + endpoint: this.endpoint.index, + includedNodeId: nodeId, + step, + }); + const response = + await this.applHost.sendCommand( + cc, + this.commandOptions, + ); + + return response?.status; + } + + /** Indicate to the other node that the given inclusion step has been completed */ + public async completeStep( + step: InclusionControllerStep, + status: InclusionControllerStatus, + ): Promise { + this.assertSupportsCommand( + InclusionControllerCommand, + InclusionControllerCommand.Complete, + ); + + const cc = new InclusionControllerCCComplete(this.applHost, { + nodeId: this.endpoint.nodeId, + endpoint: this.endpoint.index, + step, + status, + }); + await this.applHost.sendCommand(cc, this.commandOptions); + } +} + +interface InclusionControllerCCCompleteOptions extends CCCommandOptions { + step: InclusionControllerStep; + status: InclusionControllerStatus; +} + +@CCCommand(InclusionControllerCommand.Complete) +export class InclusionControllerCCComplete extends InclusionControllerCC { + public constructor( + host: ZWaveHost, + options: + | CommandClassDeserializationOptions + | InclusionControllerCCCompleteOptions, + ) { + super(host, options); + if (gotDeserializationOptions(options)) { + validatePayload(this.payload.length >= 2); + this.step = this.payload[0]; + validatePayload.withReason("Invalid inclusion controller step")( + this.step in InclusionControllerStep, + ); + this.status = this.payload[1]; + } else { + this.step = options.step; + this.status = options.status; + } + } + + public step: InclusionControllerStep; + public status: InclusionControllerStatus; + + public serialize(): Buffer { + this.payload = Buffer.from([this.step, this.status]); + return super.serialize(); + } +} + +interface InclusionControllerCCInitiateOptions extends CCCommandOptions { + includedNodeId: number; + step: InclusionControllerStep; +} + +@CCCommand(InclusionControllerCommand.Initiate) +@expectedCCResponse(InclusionControllerCCComplete) +export class InclusionControllerCCInitiate extends InclusionControllerCC { + public constructor( + host: ZWaveHost, + options: + | CommandClassDeserializationOptions + | InclusionControllerCCInitiateOptions, + ) { + super(host, options); + if (gotDeserializationOptions(options)) { + validatePayload(this.payload.length >= 2); + this.includedNodeId = this.payload[0]; + this.step = this.payload[1]; + validatePayload.withReason("Invalid inclusion controller step")( + this.step in InclusionControllerStep, + ); + } else { + this.includedNodeId = options.includedNodeId; + this.step = options.step; + } + } + + public includedNodeId: number; + public step: InclusionControllerStep; + + public serialize(): Buffer { + this.payload = Buffer.from([this.includedNodeId, this.step]); + return super.serialize(); + } +} diff --git a/packages/cc/src/cc/index.ts b/packages/cc/src/cc/index.ts index c698f1e18e88..8fa8be35e728 100644 --- a/packages/cc/src/cc/index.ts +++ b/packages/cc/src/cc/index.ts @@ -203,6 +203,11 @@ export { HumidityControlSetpointCCSupportedReport, HumidityControlSetpointCCValues, } from "./HumidityControlSetpointCC"; +export { + InclusionControllerCC, + InclusionControllerCCComplete, + InclusionControllerCCInitiate, +} from "./InclusionControllerCC"; export { IndicatorCC, IndicatorCCGet, diff --git a/packages/cc/src/lib/API.ts b/packages/cc/src/lib/API.ts index 1fb0b0548fcd..786b548c12bb 100644 --- a/packages/cc/src/lib/API.ts +++ b/packages/cc/src/lib/API.ts @@ -553,6 +553,8 @@ export type CCToName = [CC] extends [ ? "Humidity Control Operating State" : [CC] extends [typeof CommandClasses["Humidity Control Setpoint"]] ? "Humidity Control Setpoint" + : [CC] extends [typeof CommandClasses["Inclusion Controller"]] + ? "Inclusion Controller" : [CC] extends [typeof CommandClasses["Indicator"]] ? "Indicator" : [CC] extends [typeof CommandClasses["Irrigation"]] @@ -688,6 +690,7 @@ export interface CCAPIs { "Humidity Control Mode": import("../cc/HumidityControlModeCC").HumidityControlModeCCAPI; "Humidity Control Operating State": import("../cc/HumidityControlOperatingStateCC").HumidityControlOperatingStateCCAPI; "Humidity Control Setpoint": import("../cc/HumidityControlSetpointCC").HumidityControlSetpointCCAPI; + "Inclusion Controller": import("../cc/InclusionControllerCC").InclusionControllerCCAPI; Indicator: import("../cc/IndicatorCC").IndicatorCCAPI; Irrigation: import("../cc/IrrigationCC").IrrigationCCAPI; Language: import("../cc/LanguageCC").LanguageCCAPI; diff --git a/packages/cc/src/lib/_Types.ts b/packages/cc/src/lib/_Types.ts index c2be8671833b..fe1c1c8271ba 100644 --- a/packages/cc/src/lib/_Types.ts +++ b/packages/cc/src/lib/_Types.ts @@ -10,7 +10,6 @@ import { } from "@zwave-js/core/safe"; import type { NotificationCCReport } from "../cc/NotificationCC"; -/** @publicAPI */ export enum AlarmSensorCommand { Get = 0x01, Report = 0x02, @@ -18,7 +17,6 @@ export enum AlarmSensorCommand { SupportedReport = 0x04, } -/** @publicAPI */ export enum AlarmSensorType { "General Purpose" = 0x00, Smoke, @@ -29,14 +27,12 @@ export enum AlarmSensorType { Any = 0xff, } -/** @publicAPI */ export type AlarmSensorValueMetadata = ValueMetadata & { ccSpecific: { sensorType: AlarmSensorType; }; }; -/** @publicAPI */ export enum AssociationCommand { Set = 0x01, Get = 0x02, @@ -59,7 +55,6 @@ export enum AssociationCommand { // association group that represents the most recently detected button } -/** @publicAPI */ export enum AssociationGroupInfoCommand { NameGet = 0x01, NameReport = 0x02, @@ -70,7 +65,7 @@ export enum AssociationGroupInfoCommand { } // TODO: Check if this should be in a config file instead -/** @publicAPI */ + export enum AssociationGroupInfoProfile { "General: N/A" = 0x00_00, "General: Lifeline" = 0x00_01, @@ -252,7 +247,6 @@ export enum AssociationGroupInfoProfile { "Irrigation: Channel 32", } -/** @publicAPI */ export interface AssociationGroup { /** How many nodes this association group supports */ maxNodes: number; @@ -268,7 +262,6 @@ export interface AssociationGroup { issuedCommands?: ReadonlyMap; } -/** @publicAPI */ export enum BarrierOperatorCommand { Set = 0x01, Get = 0x02, @@ -280,7 +273,6 @@ export enum BarrierOperatorCommand { EventSignalingReport = 0x08, } -/** @publicAPI */ export enum BarrierState { Closed = 0x00, Closing = 0xfc, @@ -289,40 +281,34 @@ export enum BarrierState { Open = 0xff, } -/** @publicAPI */ export enum SubsystemType { Audible = 0x01, Visual = 0x02, } -/** @publicAPI */ export enum SubsystemState { Off = 0x00, On = 0xff, } -/** @publicAPI */ export enum BasicCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum BatteryChargingStatus { Discharging = 0x00, Charging = 0x01, Maintaining = 0x02, } -/** @publicAPI */ export enum BatteryReplacementStatus { No = 0x00, Soon = 0x01, Now = 0x02, } -/** @publicAPI */ export enum BatteryCommand { Get = 0x02, Report = 0x03, @@ -330,7 +316,6 @@ export enum BatteryCommand { HealthReport = 0x05, } -/** @publicAPI */ export enum BinarySensorCommand { Get = 0x02, Report = 0x03, @@ -338,7 +323,6 @@ export enum BinarySensorCommand { SupportedReport = 0x04, } -/** @publicAPI */ export enum BinarySensorType { "General Purpose" = 0x01, Smoke = 0x02, @@ -356,21 +340,18 @@ export enum BinarySensorType { Any = 0xff, } -/** @publicAPI */ export type BinarySensorValueMetadata = ValueMetadata & { ccSpecific: { sensorType: BinarySensorType; }; }; -/** @publicAPI */ export enum BinarySwitchCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum CentralSceneCommand { SupportedGet = 0x01, SupportedReport = 0x02, @@ -380,7 +361,6 @@ export enum CentralSceneCommand { ConfigurationReport = 0x06, } -/** @publicAPI */ export enum CentralSceneKeys { KeyPressed = 0x00, KeyReleased = 0x01, @@ -391,7 +371,6 @@ export enum CentralSceneKeys { KeyPressed5x = 0x06, } -/** @publicAPI */ export enum ClimateControlScheduleCommand { Set = 0x01, Get = 0x02, @@ -403,21 +382,18 @@ export enum ClimateControlScheduleCommand { OverrideReport = 0x08, } -/** @publicAPI */ export enum ScheduleOverrideType { None = 0x00, Temporary = 0x01, Permanent = 0x02, } -/** @publicAPI */ export enum ClockCommand { Set = 0x04, Get = 0x05, Report = 0x06, } -/** @publicAPI */ export enum Weekday { Unknown = 0x00, Monday = 0x01, @@ -429,7 +405,6 @@ export enum Weekday { Sunday = 0x07, } -/** @publicAPI */ export enum ColorSwitchCommand { SupportedGet = 0x01, SupportedReport = 0x02, @@ -440,7 +415,6 @@ export enum ColorSwitchCommand { StopLevelChange = 0x07, } -/** @publicAPI */ export enum ColorComponent { "Warm White" = 0, "Cold White", @@ -453,7 +427,6 @@ export enum ColorComponent { Index, } -/** @publicAPI */ export const ColorComponentMap = { warmWhite: ColorComponent["Warm White"], coldWhite: ColorComponent["Cold White"], @@ -475,7 +448,6 @@ export type ColorTable = | Partial> | Partial>; -/** @publicAPI */ export enum ConfigurationCommand { Set = 0x04, Get = 0x05, @@ -492,20 +464,16 @@ export enum ConfigurationCommand { DefaultReset = 0x01, } -/** @publicAPI */ export type { ConfigValue } from "@zwave-js/core/safe"; -/** @publicAPI */ export enum CRC16Command { CommandEncapsulation = 0x01, } -/** @publicAPI */ export enum DeviceResetLocallyCommand { Notification = 0x01, } -/** @publicAPI */ export enum DoorLockCommand { OperationSet = 0x01, OperationGet = 0x02, @@ -517,7 +485,6 @@ export enum DoorLockCommand { CapabilitiesReport = 0x08, } -/** @publicAPI */ export enum DoorLockMode { Unsecured = 0x00, UnsecuredWithTimeout = 0x01, @@ -529,16 +496,13 @@ export enum DoorLockMode { Secured = 0xff, } -/** @publicAPI */ export enum DoorLockOperationType { Constant = 0x01, Timed = 0x02, } -/** @publicAPI */ export type DoorHandleStatus = [boolean, boolean, boolean, boolean]; -/** @publicAPI */ export enum EntryControlEventTypes { Caching = 0x00, CachedKeys = 0x01, @@ -600,7 +564,6 @@ export const entryControlEventTypeLabels: Record< [EntryControlEventTypes.Cancel]: "Cancel", }; -/** @publicAPI */ export enum DoorLockLoggingCommand { RecordsSupportedGet = 0x01, RecordsSupportedReport = 0x02, @@ -608,7 +571,6 @@ export enum DoorLockLoggingCommand { RecordReport = 0x04, } -/** @publicAPI */ export enum DoorLockLoggingEventType { LockCode = 0x01, UnlockCode = 0x02, @@ -644,7 +606,6 @@ export enum DoorLockLoggingEventType { Unknown = 0x20, } -/** @publicAPI */ export interface DoorLockLoggingRecord { timestamp: string; eventType: DoorLockLoggingEventType; @@ -653,13 +614,11 @@ export interface DoorLockLoggingRecord { userCode?: string | Buffer; } -/** @publicAPI */ export enum DoorLockLoggingRecordStatus { Empty = 0x00, HoldsLegalData = 0x01, } -/** @publicAPI */ export enum EntryControlCommand { Notification = 0x01, KeySupportedGet = 0x02, @@ -671,7 +630,6 @@ export enum EntryControlCommand { ConfigurationReport = 0x08, } -/** @publicAPI */ export enum EntryControlDataTypes { None = 0x00, Raw = 0x01, @@ -679,7 +637,6 @@ export enum EntryControlDataTypes { MD5 = 0x03, } -/** @publicAPI */ export interface ZWaveNotificationCallbackArgs_EntryControlCC { eventType: EntryControlEventTypes; /** A human-readable label for the event type */ @@ -700,7 +657,6 @@ export type ZWaveNotificationCallbackParams_EntryControlCC = [ args: ZWaveNotificationCallbackArgs_EntryControlCC, ]; -/** @publicAPI */ export enum FirmwareUpdateMetaDataCommand { MetaDataGet = 0x01, MetaDataReport = 0x02, @@ -715,7 +671,6 @@ export enum FirmwareUpdateMetaDataCommand { PrepareReport = 0x0b, } -/** @publicAPI */ export enum FirmwareUpdateRequestStatus { Error_InvalidManufacturerOrFirmwareID = 0, Error_AuthenticationExpected = 1, @@ -727,7 +682,6 @@ export enum FirmwareUpdateRequestStatus { OK = 0xff, } -/** @publicAPI */ export enum FirmwareUpdateStatus { // Error_Timeout is not part of the Z-Wave standard, but we use it to report // that no status report was received @@ -749,14 +703,12 @@ export enum FirmwareUpdateStatus { OK_RestartPending = 0xff, } -/** @publicAPI */ export enum FirmwareUpdateActivationStatus { Error_InvalidFirmware = 0, Error_ActivationFailed = 1, OK = 0xff, } -/** @publicAPI */ export enum FirmwareDownloadStatus { Error_InvalidManufacturerOrFirmwareID = 0, Error_AuthenticationExpected = 1, @@ -766,7 +718,6 @@ export enum FirmwareDownloadStatus { OK = 0xff, } -/** @publicAPI */ export type FirmwareUpdateCapabilities = | { /** Indicates whether the node's firmware can be upgraded */ @@ -783,12 +734,10 @@ export type FirmwareUpdateCapabilities = readonly supportsActivation: Maybe; }; -/** @publicAPI */ export enum HailCommand { Hail = 0x01, } -/** @publicAPI */ export enum HumidityControlModeCommand { Set = 0x01, Get = 0x02, @@ -797,7 +746,6 @@ export enum HumidityControlModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum HumidityControlMode { "Off" = 0x00, "Humidify" = 0x01, @@ -805,20 +753,17 @@ export enum HumidityControlMode { "Auto" = 0x03, } -/** @publicAPI */ export enum HumidityControlOperatingStateCommand { Get = 0x01, Report = 0x02, } -/** @publicAPI */ export enum HumidityControlOperatingState { "Idle" = 0x00, "Humidifying" = 0x01, "De-humidifying" = 0x02, } -/** @publicAPI */ export enum HumidityControlSetpointCommand { Set = 0x01, Get = 0x02, @@ -831,7 +776,6 @@ export enum HumidityControlSetpointCommand { CapabilitiesReport = 0x09, } -/** @publicAPI */ export enum HumidityControlSetpointType { "N/A" = 0x00, "Humidifier" = 0x01, // CC v1 @@ -839,13 +783,11 @@ export enum HumidityControlSetpointType { "Auto" = 0x03, // CC v2 } -/** @publicAPI */ export interface HumidityControlSetpointValue { value: number; scale: number; } -/** @publicAPI */ export interface HumidityControlSetpointCapabilities { minValue: number; minValueScale: number; @@ -853,14 +795,30 @@ export interface HumidityControlSetpointCapabilities { maxValueScale: number; } -/** @publicAPI */ export type HumidityControlSetpointMetadata = ValueMetadata & { ccSpecific: { setpointType: HumidityControlSetpointType; }; }; -/** @publicAPI */ +export enum InclusionControllerCommand { + Initiate = 0x01, + Complete = 0x02, +} + +export enum InclusionControllerStep { + ProxyInclusion = 0x01, + S0Inclusion = 0x02, + ProxyInclusionReplace = 0x03, +} + +export enum InclusionControllerStatus { + OK = 0x01, + UserRejected = 0x02, + Failed = 0x03, + NotSupported = 0x04, +} + export enum IndicatorCommand { Set = 0x01, Get = 0x02, @@ -869,7 +827,6 @@ export enum IndicatorCommand { SupportedReport = 0x05, } -/** @publicAPI */ export type IndicatorMetadata = ValueMetadata & { ccSpecific: { indicatorId: number; @@ -878,7 +835,6 @@ export type IndicatorMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum IrrigationCommand { SystemInfoGet = 0x01, SystemInfoReport = 0x02, @@ -900,42 +856,35 @@ export enum IrrigationCommand { SystemShutoff = 0x12, } -/** @publicAPI */ export enum IrrigationSensorPolarity { Low = 0, High = 1, } -/** @publicAPI */ export enum ValveType { ZoneValve = 0, MasterValve = 1, } -/** @publicAPI */ export type ValveId = "master" | number; -/** @publicAPI */ export interface ValveTableEntry { valveId: number; duration: number; } -/** @publicAPI */ export enum LanguageCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum LockCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum ManufacturerSpecificCommand { Get = 0x04, Report = 0x05, @@ -943,14 +892,12 @@ export enum ManufacturerSpecificCommand { DeviceSpecificReport = 0x07, } -/** @publicAPI */ export enum DeviceIdType { FactoryDefault = 0x00, SerialNumber = 0x01, PseudoRandom = 0x02, } -/** @publicAPI */ export enum MeterCommand { Get = 0x01, Report = 0x02, @@ -959,14 +906,12 @@ export enum MeterCommand { Reset = 0x05, } -/** @publicAPI */ export enum RateType { Unspecified = 0x00, Consumed = 0x01, Produced = 0x02, } -/** @publicAPI */ export type MeterMetadata = ValueMetadata & { ccSpecific: { meterType: number; @@ -975,7 +920,6 @@ export type MeterMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum MultiChannelAssociationCommand { Set = 0x01, Get = 0x02, @@ -985,19 +929,16 @@ export enum MultiChannelAssociationCommand { SupportedGroupingsReport = 0x06, } -/** @publicAPI */ export interface AssociationAddress { nodeId: number; endpoint?: number; } -/** @publicAPI */ export interface EndpointAddress { nodeId: number; endpoint: number | number[]; } -/** @publicAPI */ export enum MultiChannelCommand { // Legacy commands for V1 (Multi Instance) GetV1 = 0x04, @@ -1016,12 +957,10 @@ export enum MultiChannelCommand { AggregatedMembersReport = 0x0f, } -/** @publicAPI */ export enum MultiCommandCommand { CommandEncapsulation = 0x01, } -/** @publicAPI */ export enum MultilevelSensorCommand { GetSupportedSensor = 0x01, SupportedSensorReport = 0x02, @@ -1031,13 +970,11 @@ export enum MultilevelSensorCommand { SupportedScaleReport = 0x06, } -/** @publicAPI */ export interface MultilevelSensorValue { value: number; scale: Scale; } -/** @publicAPI */ export type MultilevelSensorValueMetadata = ValueMetadata & { ccSpecific: { sensorType: number; @@ -1045,7 +982,6 @@ export type MultilevelSensorValueMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum MultilevelSwitchCommand { Set = 0x01, Get = 0x02, @@ -1056,14 +992,12 @@ export enum MultilevelSwitchCommand { SupportedReport = 0x07, } -/** @publicAPI */ export enum LevelChangeDirection { "up" = 0b0, "down" = 0b1, // "none" = 0b11, } -/** @publicAPI */ export enum SwitchType { "not supported" = 0x00, "Off/On" = 0x01, @@ -1075,7 +1009,6 @@ export enum SwitchType { "Pull/Push" = 0x07, } -/** @publicAPI */ export type MultilevelSwitchLevelChangeMetadata = ValueMetadata & { ccSpecific: { switchType: SwitchType; @@ -1107,7 +1040,6 @@ export type ZWaveNotificationCallbackParams_MultilevelSwitchCC = [ args: ZWaveNotificationCallbackArgs_MultilevelSwitchCC, ]; -/** @publicAPI */ export enum NodeNamingAndLocationCommand { NameSet = 0x01, NameGet = 0x02, @@ -1117,7 +1049,6 @@ export enum NodeNamingAndLocationCommand { LocationReport = 0x06, } -/** @publicAPI */ export enum NotificationCommand { EventSupportedGet = 0x01, EventSupportedReport = 0x02, @@ -1128,14 +1059,12 @@ export enum NotificationCommand { SupportedReport = 0x08, } -/** @publicAPI */ export type NotificationMetadata = ValueMetadata & { ccSpecific: { notificationType: number; }; }; -/** @publicAPI */ export interface ZWaveNotificationCallbackArgs_NotificationCC { /** The numeric identifier for the notification type */ type: number; @@ -1159,7 +1088,6 @@ export type ZWaveNotificationCallbackParams_NotificationCC = [ args: ZWaveNotificationCallbackArgs_NotificationCC, ]; -/** @publicAPI */ export enum PowerlevelCommand { Set = 0x01, Get = 0x02, @@ -1169,7 +1097,6 @@ export enum PowerlevelCommand { TestNodeReport = 0x06, } -/** @publicAPI */ export enum Powerlevel { "Normal Power" = 0x00, "-1 dBm" = 0x01, @@ -1183,7 +1110,6 @@ export enum Powerlevel { "-9 dBm" = 0x09, } -/** @publicAPI */ export enum PowerlevelTestStatus { Failed = 0x00, Success = 0x01, @@ -1210,7 +1136,6 @@ export type ZWaveNotificationCallbackParams_PowerlevelCC = [ args: ZWaveNotificationCallbackArgs_PowerlevelCC, ]; -/** @publicAPI */ export enum ProtectionCommand { Set = 0x01, Get = 0x02, @@ -1225,40 +1150,34 @@ export enum ProtectionCommand { TimeoutReport = 0x0b, } -/** @publicAPI */ export enum LocalProtectionState { Unprotected = 0, ProtectedBySequence = 1, NoOperationPossible = 2, } -/** @publicAPI */ export enum RFProtectionState { Unprotected = 0, NoControl = 1, NoResponse = 2, } -/** @publicAPI */ export enum SceneActivationCommand { Set = 0x01, } -/** @publicAPI */ export enum SceneActuatorConfigurationCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum SceneControllerConfigurationCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum Security2Command { NonceGet = 0x01, NonceReport = 0x02, @@ -1276,7 +1195,6 @@ export enum Security2Command { CommandsSupportedReport = 0x0e, } -/** @publicAPI */ export enum SecurityCommand { CommandsSupportedGet = 0x02, CommandsSupportedReport = 0x03, @@ -1291,7 +1209,6 @@ export enum SecurityCommand { CommandEncapsulationNonceGet = 0xc1, } -/** @publicAPI */ export enum SoundSwitchCommand { TonesNumberGet = 0x01, TonesNumberReport = 0x02, @@ -1305,19 +1222,16 @@ export enum SoundSwitchCommand { TonePlayReport = 0x0a, } -/** @publicAPI */ export enum ToneId { Off = 0x00, Default = 0xff, } -/** @publicAPI */ export enum SupervisionCommand { Get = 0x01, Report = 0x02, } -/** @publicAPI */ export enum ThermostatFanModeCommand { Set = 0x01, Get = 0x02, @@ -1326,7 +1240,6 @@ export enum ThermostatFanModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum ThermostatFanMode { "Auto low" = 0x00, "Low" = 0x01, @@ -1342,13 +1255,11 @@ export enum ThermostatFanMode { "External circulation" = 0x0b, } -/** @publicAPI */ export enum ThermostatFanStateCommand { Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum ThermostatFanState { "Idle / off" = 0x00, "Running / running low" = 0x01, @@ -1361,7 +1272,6 @@ export enum ThermostatFanState { "Quiet circulation mode" = 0x08, } -/** @publicAPI */ export enum ThermostatModeCommand { Set = 0x01, Get = 0x02, @@ -1370,7 +1280,6 @@ export enum ThermostatModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum ThermostatMode { "Off" = 0x00, "Heat" = 0x01, @@ -1390,7 +1299,6 @@ export enum ThermostatMode { "Manufacturer specific" = 0x1f, } -/** @publicAPI */ export enum ThermostatOperatingStateCommand { Get = 0x02, Report = 0x03, @@ -1401,7 +1309,6 @@ export enum ThermostatOperatingStateCommand { // LoggingReport = 0x06, } -/** @publicAPI */ export enum ThermostatOperatingState { "Idle" = 0x00, "Heating" = 0x01, @@ -1417,37 +1324,31 @@ export enum ThermostatOperatingState { "3rd Stage Aux Heat" = 0x0b, } -/** @publicAPI */ export enum ThermostatSetbackCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum SetbackType { None = 0x00, Temporary = 0x01, Permanent = 0x02, } -/** @publicAPI */ export type SetbackSpecialState = | "Frost Protection" | "Energy Saving" | "Unused"; -/** @publicAPI */ export type SetbackState = number | SetbackSpecialState; -/** @publicAPI */ export interface Switchpoint { hour: number; minute: number; state: SetbackState | undefined; } -/** @publicAPI */ export enum ThermostatSetpointCommand { Set = 0x01, Get = 0x02, @@ -1458,7 +1359,6 @@ export enum ThermostatSetpointCommand { CapabilitiesReport = 0x0a, } -/** @publicAPI */ export enum ThermostatSetpointType { "N/A" = 0x00, "Heating" = 0x01, // CC v1 @@ -1474,13 +1374,11 @@ export enum ThermostatSetpointType { "Full Power" = 0x0f, // CC v3 } -/** @publicAPI */ export interface ThermostatSetpointValue { value: number; scale: number; } -/** @publicAPI */ export interface ThermostatSetpointCapabilities { minValue: number; minValueScale: number; @@ -1488,14 +1386,12 @@ export interface ThermostatSetpointCapabilities { maxValueScale: number; } -/** @publicAPI */ export type ThermostatSetpointMetadata = ValueMetadata & { ccSpecific: { setpointType: ThermostatSetpointType; }; }; -/** @publicAPI */ export enum TimeCommand { TimeGet = 0x01, TimeReport = 0x02, @@ -1506,14 +1402,12 @@ export enum TimeCommand { TimeOffsetReport = 0x07, } -/** @publicAPI */ export enum TimeParametersCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum TransportServiceCommand { FirstSegment = 0xc0, SegmentComplete = 0xe8, @@ -1522,7 +1416,6 @@ export enum TransportServiceCommand { SubsequentSegment = 0xe0, } -/** @publicAPI */ export enum UserCodeCommand { Set = 0x01, Get = 0x02, @@ -1545,7 +1438,6 @@ export enum UserCodeCommand { UserCodeChecksumReport = 0x12, } -/** @publicAPI */ export enum UserIDStatus { Available = 0x00, Enabled, @@ -1555,7 +1447,6 @@ export enum UserIDStatus { StatusNotAvailable = 0xfe, } -/** @publicAPI */ export enum KeypadMode { Normal = 0x00, Vacation, @@ -1563,7 +1454,6 @@ export enum KeypadMode { LockedOut, } -/** @publicAPI */ export enum VersionCommand { Get = 0x11, Report = 0x12, @@ -1575,7 +1465,6 @@ export enum VersionCommand { ZWaveSoftwareReport = 0x18, } -/** @publicAPI */ export enum WakeUpCommand { IntervalSet = 0x04, IntervalGet = 0x05, @@ -1586,13 +1475,11 @@ export enum WakeUpCommand { IntervalCapabilitiesReport = 0x0a, } -/** @publicAPI */ export enum ZWavePlusCommand { Get = 0x01, Report = 0x02, } -/** @publicAPI */ export enum ZWavePlusRoleType { CentralStaticController = 0x00, SubStaticController = 0x01, @@ -1605,13 +1492,11 @@ export enum ZWavePlusRoleType { NetworkAwareSlave = 0x08, } -/** @publicAPI */ export enum ZWavePlusNodeType { Node = 0x00, // ZWave+ Node IPGateway = 0x02, // ZWave+ for IP Gateway } -/** @publicAPI */ export enum ZWaveProtocolCommand { NodeInformationFrame = 0x01, RequestNodeInformationFrame = 0x02,