diff --git a/docs/api/CCs/InclusionController.md b/docs/api/CCs/InclusionController.md new file mode 100644 index 000000000000..a07d12414295 --- /dev/null +++ b/docs/api/CCs/InclusionController.md @@ -0,0 +1,27 @@ +# Inclusion Controller CC + +?> CommandClass ID: `0x74` + +## Inclusion Controller CC methods + +### `initiateStep` + +```ts +async initiateStep( + nodeId: number, + step: InclusionControllerStep, +): Promise; +``` + +Instruct the target to initiate the given inclusion step for the given node. + +### `completeStep` + +```ts +async completeStep( + step: InclusionControllerStep, + status: InclusionControllerStatus, +): Promise; +``` + +Indicate to the other node that the given inclusion step has been completed. diff --git a/docs/api/CCs/_sidebar.md b/docs/api/CCs/_sidebar.md index 0b36c50ef432..86f17dfc9ac8 100644 --- a/docs/api/CCs/_sidebar.md +++ b/docs/api/CCs/_sidebar.md @@ -46,6 +46,7 @@ - [Humidity Control Mode CC](api/CCs/HumidityControlMode.md) - [Humidity Control Operating State CC](api/CCs/HumidityControlOperatingState.md) - [Humidity Control Setpoint CC](api/CCs/HumidityControlSetpoint.md) + - [Inclusion Controller CC](api/CCs/InclusionController.md) - [Indicator CC](api/CCs/Indicator.md) - [Irrigation CC](api/CCs/Irrigation.md) - [Language CC](api/CCs/Language.md) diff --git a/docs/api/CCs/index.md b/docs/api/CCs/index.md index ca8acf8112e5..01af3c6f72c1 100644 --- a/docs/api/CCs/index.md +++ b/docs/api/CCs/index.md @@ -31,6 +31,7 @@ The **Command Classes API** provides a high-to-mid level entrypoint which allows - [Humidity Control Mode CC](api/CCs/HumidityControlMode.md) · `0x6d` - [Humidity Control Operating State CC](api/CCs/HumidityControlOperatingState.md) · `0x6e` - [Humidity Control Setpoint CC](api/CCs/HumidityControlSetpoint.md) · `0x64` +- [Inclusion Controller CC](api/CCs/InclusionController.md) · `0x74` - [Indicator CC](api/CCs/Indicator.md) · `0x87` - [Irrigation CC](api/CCs/Irrigation.md) · `0x6b` - [Language CC](api/CCs/Language.md) · `0x89` diff --git a/packages/cc/api.md b/packages/cc/api.md index 90c39bbcce39..9f94d187d52f 100644 --- a/packages/cc/api.md +++ b/packages/cc/api.md @@ -285,7 +285,6 @@ export const AlarmSensorCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AlarmSensorCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -300,7 +299,6 @@ export enum AlarmSensorCommand { SupportedReport = 4 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AlarmSensorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -321,7 +319,6 @@ export enum AlarmSensorType { Smoke = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AlarmSensorValueMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -353,7 +350,6 @@ export type APIMethodsOf = Omit; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AssociationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -598,7 +593,6 @@ export enum AssociationCommand { SupportedGroupingsReport = 6 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AssociationGroup" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -840,7 +834,6 @@ export const AssociationGroupInfoCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AssociationGroupInfoCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -859,7 +852,6 @@ export enum AssociationGroupInfoCommand { NameReport = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "AssociationGroupInfoProfile" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1475,7 +1467,6 @@ export const BarrierOperatorCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BarrierOperatorCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1498,7 +1489,6 @@ export enum BarrierOperatorCommand { SignalingCapabilitiesReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BarrierState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1711,7 +1701,6 @@ export const BasicCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BasicCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2128,7 +2117,6 @@ export const BatteryCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BatteryChargingStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2141,7 +2129,6 @@ export enum BatteryChargingStatus { Maintaining = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BatteryCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2156,7 +2143,6 @@ export enum BatteryCommand { Report = 3 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BatteryReplacementStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2290,7 +2276,6 @@ export const BinarySensorCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BinarySensorCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2305,7 +2290,6 @@ export enum BinarySensorCommand { SupportedReport = 4 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BinarySensorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2340,7 +2324,6 @@ export enum BinarySensorType { Water = 6 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BinarySensorValueMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2489,7 +2472,6 @@ export const BinarySwitchCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "BinarySwitchCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -2622,6 +2604,10 @@ export interface CCAPIs { // // (undocumented) "Humidity Control Setpoint": HumidityControlSetpointCCAPI; + // Warning: (ae-forgotten-export) The symbol "InclusionControllerCCAPI" needs to be exported by the entry point index.d.ts + // + // (undocumented) + "Inclusion Controller": InclusionControllerCCAPI; // Warning: (ae-forgotten-export) The symbol "ManufacturerProprietaryCCAPI" needs to be exported by the entry point index.d.ts // // (undocumented) @@ -3087,7 +3073,6 @@ export const CentralSceneCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "CentralSceneCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3106,7 +3091,6 @@ export enum CentralSceneCommand { SupportedReport = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "CentralSceneKeys" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3321,7 +3305,6 @@ export const ClimateControlScheduleCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ClimateControlScheduleCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3395,7 +3378,6 @@ export class ClockCCSet extends ClockCC { weekday: Weekday; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ClockCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3408,7 +3390,6 @@ export enum ClockCommand { Set = 4 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ColorComponent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3433,7 +3414,6 @@ export enum ColorComponent { Red = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ColorComponentMap" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3800,7 +3780,6 @@ export const ColorSwitchCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ColorSwitchCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3821,7 +3800,6 @@ export enum ColorSwitchCommand { SupportedReport = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ColorTable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public @@ -4273,7 +4251,6 @@ export const ConfigurationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ConfigurationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -4339,7 +4316,6 @@ export class CRC16CCCommandEncapsulation extends CRC16CC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "CRC16Command" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -4353,7 +4329,6 @@ export enum CRC16Command { // @public (undocumented) export function dataRate2ZWaveDataRate(dataRate: DataRate_2): ZWaveDataRate_2; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DeviceIdType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -4382,7 +4357,6 @@ export class DeviceResetLocallyCC extends CommandClass { export class DeviceResetLocallyCCNotification extends DeviceResetLocallyCC { } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DeviceResetLocallyCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -4391,7 +4365,6 @@ export enum DeviceResetLocallyCommand { Notification = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorHandleStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5250,7 +5223,6 @@ export const DoorLockCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5360,7 +5332,6 @@ export const DoorLockLoggingCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockLoggingCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5375,7 +5346,6 @@ export enum DoorLockLoggingCommand { RecordsSupportedReport = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockLoggingEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5446,7 +5416,6 @@ export enum DoorLockLoggingEventType { UserCodeDeleted = 24 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockLoggingRecord" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5463,7 +5432,6 @@ export interface DoorLockLoggingRecord { userId?: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockLoggingRecordStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5474,7 +5442,6 @@ export enum DoorLockLoggingRecordStatus { HoldsLegalData = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockMode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5497,7 +5464,6 @@ export enum DoorLockMode { UnsecuredWithTimeout = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "DoorLockOperationType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5548,7 +5514,6 @@ export interface EncapsulatingCommandClassStatic { encapsulate(applHost: ZWaveApplicationHost_2, cc: CommandClass): EncapsulatingCommandClass; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "EndpointAddress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5809,7 +5774,6 @@ export const EntryControlCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "EntryControlCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5832,7 +5796,6 @@ export enum EntryControlCommand { Notification = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "EntryControlDataTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -5852,7 +5815,6 @@ export enum EntryControlDataTypes { // @public (undocumented) export const entryControlEventTypeLabels: Record; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "EntryControlEventTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6009,7 +5971,6 @@ export class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareDownloadStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6028,7 +5989,6 @@ export enum FirmwareDownloadStatus { OK = 255 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareUpdateActivationStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6041,7 +6001,6 @@ export enum FirmwareUpdateActivationStatus { OK = 255 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareUpdateCapabilities" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6054,6 +6013,7 @@ export type FirmwareUpdateCapabilities = { readonly supportsActivation: Maybe; }; +// Warning: (ae-missing-release-tag) "FirmwareUpdateMetaData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // Warning: (ae-missing-release-tag) "FirmwareUpdateMetaData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6078,6 +6038,28 @@ export interface FirmwareUpdateMetaData { supportsActivation: Maybe; } +// @public (undocumented) +export interface FirmwareUpdateMetaData { + // (undocumented) + additionalFirmwareIDs: readonly number[]; + // (undocumented) + checksum: number; + // (undocumented) + continuesToFunction: Maybe; + // (undocumented) + firmwareId: number; + // (undocumented) + firmwareUpgradable: boolean; + // (undocumented) + hardwareVersion?: number; + // (undocumented) + manufacturerId: number; + // (undocumented) + maxFragmentSize?: number; + // (undocumented) + supportsActivation: Maybe; +} + // Warning: (ae-missing-release-tag) "FirmwareUpdateMetaDataCC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6387,7 +6369,6 @@ export const FirmwareUpdateMetaDataCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareUpdateMetaDataCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6427,7 +6408,6 @@ export interface FirmwareUpdateProgress { totalFragments: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareUpdateRequestStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6460,7 +6440,6 @@ export interface FirmwareUpdateResult { waitTime?: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "FirmwareUpdateStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6663,7 +6642,6 @@ export class HailCC extends CommandClass { ccCommand: HailCommand.Hail; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HailCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6672,7 +6650,6 @@ export enum HailCommand { Hail = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlMode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6811,7 +6788,6 @@ export const HumidityControlModeCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlModeCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6828,7 +6804,6 @@ export enum HumidityControlModeCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlOperatingState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6907,7 +6882,6 @@ export const HumidityControlOperatingStateCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlOperatingStateCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -6918,7 +6892,6 @@ export enum HumidityControlOperatingStateCommand { Report = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlSetpointCapabilities" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7167,7 +7140,6 @@ export const HumidityControlSetpointCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlSetpointCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7192,7 +7164,6 @@ export enum HumidityControlSetpointCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlSetpointMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7202,7 +7173,6 @@ export type HumidityControlSetpointMetadata = ValueMetadata_2 & { }; }; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlSetpointType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7217,7 +7187,6 @@ export enum HumidityControlSetpointType { "Humidifier" = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "HumidityControlSetpointValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7242,6 +7211,82 @@ export interface ICommandClassContainer { // @public export const implementedVersion: (version: number) => TypedClassDecorator_2; +// Warning: (ae-missing-release-tag) "InclusionControllerCC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class InclusionControllerCC extends CommandClass { + // (undocumented) + ccCommand: InclusionControllerCommand; +} + +// Warning: (ae-missing-release-tag) "InclusionControllerCCComplete" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class InclusionControllerCCComplete extends InclusionControllerCC { + // Warning: (ae-forgotten-export) The symbol "InclusionControllerCCCompleteOptions" needs to be exported by the entry point index.d.ts + constructor(host: ZWaveHost, options: CommandClassDeserializationOptions | InclusionControllerCCCompleteOptions); + // (undocumented) + serialize(): Buffer; + // (undocumented) + status: InclusionControllerStatus; + // (undocumented) + step: InclusionControllerStep; + // (undocumented) + toLogEntry(applHost: ZWaveApplicationHost_2): MessageOrCCLogEntry; +} + +// Warning: (ae-missing-release-tag) "InclusionControllerCCInitiate" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class InclusionControllerCCInitiate extends InclusionControllerCC { + // Warning: (ae-forgotten-export) The symbol "InclusionControllerCCInitiateOptions" needs to be exported by the entry point index.d.ts + constructor(host: ZWaveHost, options: CommandClassDeserializationOptions | InclusionControllerCCInitiateOptions); + // (undocumented) + includedNodeId: number; + // (undocumented) + serialize(): Buffer; + // (undocumented) + step: InclusionControllerStep; + // (undocumented) + toLogEntry(applHost: ZWaveApplicationHost_2): MessageOrCCLogEntry; +} + +// Warning: (ae-missing-release-tag) "InclusionControllerCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export enum InclusionControllerCommand { + // (undocumented) + Complete = 2, + // (undocumented) + Initiate = 1 +} + +// Warning: (ae-missing-release-tag) "InclusionControllerStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export enum InclusionControllerStatus { + // (undocumented) + Failed = 3, + // (undocumented) + NotSupported = 4, + // (undocumented) + OK = 1, + // (undocumented) + UserRejected = 2 +} + +// Warning: (ae-missing-release-tag) "InclusionControllerStep" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export enum InclusionControllerStep { + // (undocumented) + ProxyInclusion = 1, + // (undocumented) + ProxyInclusionReplace = 3, + // (undocumented) + S0Inclusion = 2 +} + // Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "inclusionTimeouts" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -7474,7 +7519,6 @@ export const IndicatorCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "IndicatorCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -7491,7 +7535,6 @@ export enum IndicatorCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "IndicatorMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9064,7 +9107,6 @@ export class IrrigationCCValveTableSet extends IrrigationCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "IrrigationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9107,7 +9149,6 @@ export enum IrrigationCommand { ValveTableSet = 14 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "IrrigationSensorPolarity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9180,7 +9221,6 @@ export enum KEXSchemes { KEXScheme1 = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "KeypadMode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9302,7 +9342,6 @@ export const LanguageCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "LanguageCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9315,7 +9354,6 @@ export enum LanguageCommand { Set = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "LevelChangeDirection" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9326,7 +9364,6 @@ export enum LevelChangeDirection { "up" = 0 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "LocalProtectionState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9415,7 +9452,6 @@ export const LockCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "LockCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9639,7 +9675,6 @@ export const ManufacturerSpecificCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ManufacturerSpecificCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9953,7 +9988,6 @@ export const MeterCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MeterCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -9970,7 +10004,6 @@ export enum MeterCommand { SupportedReport = 4 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MeterMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10246,7 +10279,6 @@ export const MultiChannelAssociationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultiChannelAssociationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10675,7 +10707,6 @@ export const MultiChannelCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultiChannelCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10731,7 +10762,6 @@ export class MultiCommandCCCommandEncapsulation extends MultiCommandCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultiCommandCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10953,7 +10983,6 @@ export const MultilevelSensorCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultilevelSensorCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10972,7 +11001,6 @@ export enum MultilevelSensorCommand { SupportedSensorReport = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultilevelSensorValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -10983,7 +11011,6 @@ export interface MultilevelSensorValue { value: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultilevelSensorValueMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -11349,7 +11376,6 @@ export const MultilevelSwitchCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultilevelSwitchCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -11370,7 +11396,6 @@ export enum MultilevelSwitchCommand { SupportedReport = 7 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "MultilevelSwitchLevelChangeMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -11534,7 +11559,6 @@ export const NodeNamingAndLocationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "NodeNamingAndLocationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -11951,7 +11975,6 @@ export const NotificationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "NotificationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -11972,7 +11995,6 @@ export enum NotificationCommand { SupportedReport = 8 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "NotificationMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12011,7 +12033,6 @@ export const POLL_VALUE: unique symbol; // @public (undocumented) export type PollValueImplementation = (property: ValueIDProperties) => Promise; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "Powerlevel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12120,7 +12141,6 @@ export class PowerlevelCCTestNodeSet extends PowerlevelCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "PowerlevelCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12139,7 +12159,6 @@ export enum PowerlevelCommand { TestNodeSet = 4 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "PowerlevelTestStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12506,7 +12525,6 @@ export const ProtectionCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ProtectionCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12535,7 +12553,6 @@ export enum ProtectionCommand { TimeoutSet = 9 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "RateType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12553,7 +12570,6 @@ export enum RateType { // @public (undocumented) function removeAssociations(applHost: ZWaveApplicationHost, endpoint: IZWaveEndpoint, group: number, destinations: AssociationAddress[]): Promise; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "RFProtectionState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12651,7 +12667,6 @@ export const SceneActivationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SceneActivationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12786,7 +12801,6 @@ export const SceneActuatorConfigurationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SceneActuatorConfigurationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -12930,7 +12944,6 @@ export const SceneControllerConfigurationCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SceneControllerConfigurationCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13358,7 +13371,6 @@ export type ScheduleEntryLockCCYearDayScheduleSetOptions = CCCommandOptions & Sc action: ScheduleEntryLockSetAction.Set; } & ScheduleEntryLockYearDaySchedule)); -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13397,7 +13409,6 @@ export enum ScheduleEntryLockCommand { YearDayScheduleSet = 6 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockDailyRepeatingSchedule" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13414,7 +13425,6 @@ export interface ScheduleEntryLockDailyRepeatingSchedule { weekdays: ScheduleEntryLockWeekday[]; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockSetAction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13425,7 +13435,6 @@ export enum ScheduleEntryLockSetAction { Set = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockSlotId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13436,7 +13445,6 @@ export interface ScheduleEntryLockSlotId { userId: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockWeekday" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13457,7 +13465,6 @@ export enum ScheduleEntryLockWeekday { Wednesday = 3 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockWeekDaySchedule" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13474,7 +13481,6 @@ export interface ScheduleEntryLockWeekDaySchedule { weekday: ScheduleEntryLockWeekday; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleEntryLockYearDaySchedule" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13501,7 +13507,6 @@ export interface ScheduleEntryLockYearDaySchedule { stopYear: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ScheduleOverrideType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13749,7 +13754,6 @@ export class Security2CCTransferEnd extends Security2CC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "Security2Command" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13954,7 +13958,6 @@ export class SecurityCCSchemeReport extends SecurityCC { constructor(host: ZWaveHost_2, options: CommandClassDeserializationOptions); } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SecurityCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -13988,19 +13991,16 @@ export enum SecurityCommand { // @public export const SET_VALUE: unique symbol; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SetbackSpecialState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export type SetbackSpecialState = "Frost Protection" | "Energy Saving" | "Unused"; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SetbackState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export type SetbackState = number | SetbackSpecialState; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SetbackType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14289,7 +14289,6 @@ export const SoundSwitchCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SoundSwitchCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14330,7 +14329,6 @@ export class SPANExtension extends Security2Extension { toLogEntry(): string; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SubsystemState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14341,7 +14339,6 @@ export enum SubsystemState { On = 255 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SubsystemType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14444,7 +14441,6 @@ export const SupervisionCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SupervisionCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14455,7 +14451,6 @@ export enum SupervisionCommand { Report = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "Switchpoint" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14468,7 +14463,6 @@ export interface Switchpoint { state: SetbackState | undefined; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "SwitchType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14491,7 +14485,6 @@ export enum SwitchType { "Reverse/Forward" = 6 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatFanMode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14676,7 +14669,6 @@ export const ThermostatFanModeCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatFanModeCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14693,7 +14685,6 @@ export enum ThermostatFanModeCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatFanState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14784,7 +14775,6 @@ export const ThermostatFanStateCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatFanStateCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14795,7 +14785,6 @@ export enum ThermostatFanStateCommand { Report = 3 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatMode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -14990,7 +14979,6 @@ export const ThermostatModeCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatModeCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15007,7 +14995,6 @@ export enum ThermostatModeCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatOperatingState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15104,7 +15091,6 @@ export const ThermostatOperatingStateCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatOperatingStateCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15221,7 +15207,6 @@ export const ThermostatSetbackCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetbackCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15234,7 +15219,6 @@ export enum ThermostatSetbackCommand { Set = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetpointCapabilities" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15480,7 +15464,6 @@ export const ThermostatSetpointCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetpointCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15501,7 +15484,6 @@ export enum ThermostatSetpointCommand { SupportedReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetpointMetadata" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15511,7 +15493,6 @@ export type ThermostatSetpointMetadata = ValueMetadata_2 & { }; }; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetpointType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15542,7 +15523,6 @@ export enum ThermostatSetpointType { "Heating" = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ThermostatSetpointValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15677,7 +15657,6 @@ export class TimeCCTimeReport extends TimeCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "TimeCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15775,7 +15754,6 @@ export const TimeParametersCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "TimeParametersCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15788,7 +15766,6 @@ export enum TimeParametersCommand { Set = 1 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "Timezone" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15799,7 +15776,6 @@ export interface Timezone { standardOffset: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ToneId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -15939,7 +15915,6 @@ export class TransportServiceCCSubsequentSegment extends TransportServiceCC { toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry_2; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "TransportServiceCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -16581,7 +16556,6 @@ export const UserCodeCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "UserCodeCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -16624,7 +16598,6 @@ export enum UserCodeCommand { UsersNumberReport = 5 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "UserIDStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -16668,13 +16641,11 @@ export { utils } // @public (undocumented) export type ValueIDProperties = Pick; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ValveId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export type ValveId = "master" | number; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ValveTableEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -16685,7 +16656,6 @@ export interface ValveTableEntry { valveId: number; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ValveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17180,7 +17150,6 @@ export class VersionCCZWaveSoftwareReport extends VersionCC { readonly zWaveProtocolVersion: string; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "VersionCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17372,7 +17341,6 @@ export const WakeUpCCValues: Readonly<{ export class WakeUpCCWakeUpNotification extends WakeUpCC { } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "WakeUpCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17410,7 +17378,6 @@ export enum WakeUpTime { // @public (undocumented) export function wakeUpTime2FLiRS(value: WakeUpTime): FLiRS_2; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "Weekday" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17624,7 +17591,6 @@ export const ZWavePlusCCValues: Readonly<{ }; }>; -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ZWavePlusCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17635,7 +17601,6 @@ export enum ZWavePlusCommand { Report = 2 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ZWavePlusNodeType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -17646,7 +17611,6 @@ export enum ZWavePlusNodeType { Node = 0 } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ZWavePlusRoleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -18165,7 +18129,6 @@ export class ZWaveProtocolCCTransferRangeInformation extends ZWaveProtocolCC { serialize(): Buffer; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@publicAPI" is not defined in this configuration // Warning: (ae-missing-release-tag) "ZWaveProtocolCommand" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/packages/cc/src/cc/InclusionControllerCC.ts b/packages/cc/src/cc/InclusionControllerCC.ts new file mode 100644 index 000000000000..65b1dcbc51ec --- /dev/null +++ b/packages/cc/src/cc/InclusionControllerCC.ts @@ -0,0 +1,177 @@ +import { + CommandClasses, + Maybe, + MessageOrCCLogEntry, + validatePayload, +} from "@zwave-js/core"; +import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host"; +import { getEnumMemberName } from "@zwave-js/shared"; +import { CCAPI } from "../lib/API"; +import { + CommandClass, + gotDeserializationOptions, + type CCCommandOptions, + type CommandClassDeserializationOptions, +} from "../lib/CommandClass"; +import { + API, + CCCommand, + commandClass, + 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, + }); + await this.applHost.sendCommand(cc, this.commandOptions); + } + + /** 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(); + } + + public toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry { + return { + ...super.toLogEntry(applHost), + message: { + step: getEnumMemberName(InclusionControllerStep, this.step), + status: getEnumMemberName( + InclusionControllerStatus, + this.status, + ), + }, + }; + } +} + +interface InclusionControllerCCInitiateOptions extends CCCommandOptions { + includedNodeId: number; + step: InclusionControllerStep; +} + +@CCCommand(InclusionControllerCommand.Initiate) +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(); + } + + public toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry { + return { + ...super.toLogEntry(applHost), + message: { + "included node id": this.includedNodeId, + step: getEnumMemberName(InclusionControllerStep, this.step), + }, + }; + } +} diff --git a/packages/cc/src/cc/index.ts b/packages/cc/src/cc/index.ts index 4de0916fb554..a71ddbd146a5 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 f90fd1b1bf3f..7bbb2c6a1c61 100644 --- a/packages/cc/src/lib/API.ts +++ b/packages/cc/src/lib/API.ts @@ -543,6 +543,7 @@ type CCNameMap = { "Humidity Control Mode": typeof CommandClasses["Humidity Control Mode"]; "Humidity Control Operating State": typeof CommandClasses["Humidity Control Operating State"]; "Humidity Control Setpoint": typeof CommandClasses["Humidity Control Setpoint"]; + "Inclusion Controller": typeof CommandClasses["Inclusion Controller"]; Indicator: typeof CommandClasses["Indicator"]; Irrigation: typeof CommandClasses["Irrigation"]; Language: typeof CommandClasses["Language"]; @@ -646,6 +647,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 6b0c11482688..1879b9623e8a 100644 --- a/packages/cc/src/lib/_Types.ts +++ b/packages/cc/src/lib/_Types.ts @@ -8,7 +8,6 @@ import { ZWaveDataRate, } from "@zwave-js/core/safe"; -/** @publicAPI */ export enum AlarmSensorCommand { Get = 0x01, Report = 0x02, @@ -16,7 +15,6 @@ export enum AlarmSensorCommand { SupportedReport = 0x04, } -/** @publicAPI */ export enum AlarmSensorType { "General Purpose" = 0x00, Smoke, @@ -27,14 +25,12 @@ export enum AlarmSensorType { Any = 0xff, } -/** @publicAPI */ export type AlarmSensorValueMetadata = ValueMetadata & { ccSpecific: { sensorType: AlarmSensorType; }; }; -/** @publicAPI */ export enum AssociationCommand { Set = 0x01, Get = 0x02, @@ -57,7 +53,6 @@ export enum AssociationCommand { // association group that represents the most recently detected button } -/** @publicAPI */ export enum AssociationGroupInfoCommand { NameGet = 0x01, NameReport = 0x02, @@ -68,7 +63,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, @@ -250,7 +245,6 @@ export enum AssociationGroupInfoProfile { "Irrigation: Channel 32", } -/** @publicAPI */ export interface AssociationGroup { /** How many nodes this association group supports */ maxNodes: number; @@ -266,7 +260,6 @@ export interface AssociationGroup { issuedCommands?: ReadonlyMap; } -/** @publicAPI */ export enum BarrierOperatorCommand { Set = 0x01, Get = 0x02, @@ -278,7 +271,6 @@ export enum BarrierOperatorCommand { EventSignalingReport = 0x08, } -/** @publicAPI */ export enum BarrierState { Closed = 0x00, Closing = 0xfc, @@ -287,40 +279,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, @@ -328,7 +314,6 @@ export enum BatteryCommand { HealthReport = 0x05, } -/** @publicAPI */ export enum BinarySensorCommand { Get = 0x02, Report = 0x03, @@ -336,7 +321,6 @@ export enum BinarySensorCommand { SupportedReport = 0x04, } -/** @publicAPI */ export enum BinarySensorType { "General Purpose" = 0x01, Smoke = 0x02, @@ -354,21 +338,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, @@ -378,7 +359,6 @@ export enum CentralSceneCommand { ConfigurationReport = 0x06, } -/** @publicAPI */ export enum CentralSceneKeys { KeyPressed = 0x00, KeyReleased = 0x01, @@ -389,7 +369,6 @@ export enum CentralSceneKeys { KeyPressed5x = 0x06, } -/** @publicAPI */ export enum ClimateControlScheduleCommand { Set = 0x01, Get = 0x02, @@ -401,21 +380,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, @@ -427,7 +403,6 @@ export enum Weekday { Sunday = 0x07, } -/** @publicAPI */ export enum ColorSwitchCommand { SupportedGet = 0x01, SupportedReport = 0x02, @@ -438,7 +413,6 @@ export enum ColorSwitchCommand { StopLevelChange = 0x07, } -/** @publicAPI */ export enum ColorComponent { "Warm White" = 0, "Cold White", @@ -451,7 +425,6 @@ export enum ColorComponent { Index, } -/** @publicAPI */ export const ColorComponentMap = { warmWhite: ColorComponent["Warm White"], coldWhite: ColorComponent["Cold White"], @@ -466,14 +439,12 @@ export const ColorComponentMap = { export type ColorKey = keyof typeof ColorComponentMap; /** - * @publicAPI * This type is used to accept both the kebabCase names and numeric components as table keys */ export type ColorTable = | Partial> | Partial>; -/** @publicAPI */ export enum ConfigurationCommand { Set = 0x04, Get = 0x05, @@ -490,20 +461,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, @@ -515,7 +482,6 @@ export enum DoorLockCommand { CapabilitiesReport = 0x08, } -/** @publicAPI */ export enum DoorLockMode { Unsecured = 0x00, UnsecuredWithTimeout = 0x01, @@ -527,16 +493,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, @@ -598,7 +561,6 @@ export const entryControlEventTypeLabels: Record< [EntryControlEventTypes.Cancel]: "Cancel", }; -/** @publicAPI */ export enum DoorLockLoggingCommand { RecordsSupportedGet = 0x01, RecordsSupportedReport = 0x02, @@ -606,7 +568,6 @@ export enum DoorLockLoggingCommand { RecordReport = 0x04, } -/** @publicAPI */ export enum DoorLockLoggingEventType { LockCode = 0x01, UnlockCode = 0x02, @@ -642,7 +603,6 @@ export enum DoorLockLoggingEventType { Unknown = 0x20, } -/** @publicAPI */ export interface DoorLockLoggingRecord { timestamp: string; eventType: DoorLockLoggingEventType; @@ -651,13 +611,11 @@ export interface DoorLockLoggingRecord { userCode?: string | Buffer; } -/** @publicAPI */ export enum DoorLockLoggingRecordStatus { Empty = 0x00, HoldsLegalData = 0x01, } -/** @publicAPI */ export enum EntryControlCommand { Notification = 0x01, KeySupportedGet = 0x02, @@ -669,7 +627,6 @@ export enum EntryControlCommand { ConfigurationReport = 0x08, } -/** @publicAPI */ export enum EntryControlDataTypes { None = 0x00, Raw = 0x01, @@ -677,7 +634,6 @@ export enum EntryControlDataTypes { MD5 = 0x03, } -/** @publicAPI */ export enum FirmwareUpdateMetaDataCommand { MetaDataGet = 0x01, MetaDataReport = 0x02, @@ -704,7 +660,18 @@ export interface FirmwareUpdateMetaData { supportsActivation: Maybe; } -/** @publicAPI */ +export interface FirmwareUpdateMetaData { + manufacturerId: number; + firmwareId: number; + checksum: number; + firmwareUpgradable: boolean; + maxFragmentSize?: number; + additionalFirmwareIDs: readonly number[]; + hardwareVersion?: number; + continuesToFunction: Maybe; + supportsActivation: Maybe; +} + export enum FirmwareUpdateRequestStatus { Error_InvalidManufacturerOrFirmwareID = 0, Error_AuthenticationExpected = 1, @@ -716,7 +683,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 @@ -739,14 +705,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, @@ -756,7 +720,6 @@ export enum FirmwareDownloadStatus { OK = 0xff, } -/** @publicAPI */ export type FirmwareUpdateCapabilities = | { /** Indicates whether the node's firmware can be upgraded */ @@ -797,12 +760,10 @@ export interface FirmwareUpdateResult { reInterview: boolean; } -/** @publicAPI */ export enum HailCommand { Hail = 0x01, } -/** @publicAPI */ export enum HumidityControlModeCommand { Set = 0x01, Get = 0x02, @@ -811,7 +772,6 @@ export enum HumidityControlModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum HumidityControlMode { "Off" = 0x00, "Humidify" = 0x01, @@ -819,20 +779,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, @@ -845,7 +802,6 @@ export enum HumidityControlSetpointCommand { CapabilitiesReport = 0x09, } -/** @publicAPI */ export enum HumidityControlSetpointType { "N/A" = 0x00, "Humidifier" = 0x01, // CC v1 @@ -853,13 +809,11 @@ export enum HumidityControlSetpointType { "Auto" = 0x03, // CC v2 } -/** @publicAPI */ export interface HumidityControlSetpointValue { value: number; scale: number; } -/** @publicAPI */ export interface HumidityControlSetpointCapabilities { minValue: number; minValueScale: number; @@ -867,14 +821,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, @@ -883,7 +853,6 @@ export enum IndicatorCommand { SupportedReport = 0x05, } -/** @publicAPI */ export type IndicatorMetadata = ValueMetadata & { ccSpecific: { indicatorId: number; @@ -892,7 +861,6 @@ export type IndicatorMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum IrrigationCommand { SystemInfoGet = 0x01, SystemInfoReport = 0x02, @@ -914,42 +882,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, @@ -957,14 +918,12 @@ export enum ManufacturerSpecificCommand { DeviceSpecificReport = 0x07, } -/** @publicAPI */ export enum DeviceIdType { FactoryDefault = 0x00, SerialNumber = 0x01, PseudoRandom = 0x02, } -/** @publicAPI */ export enum MeterCommand { Get = 0x01, Report = 0x02, @@ -973,14 +932,12 @@ export enum MeterCommand { Reset = 0x05, } -/** @publicAPI */ export enum RateType { Unspecified = 0x00, Consumed = 0x01, Produced = 0x02, } -/** @publicAPI */ export type MeterMetadata = ValueMetadata & { ccSpecific: { meterType: number; @@ -989,7 +946,6 @@ export type MeterMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum MultiChannelAssociationCommand { Set = 0x01, Get = 0x02, @@ -999,19 +955,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, @@ -1030,12 +983,10 @@ export enum MultiChannelCommand { AggregatedMembersReport = 0x0f, } -/** @publicAPI */ export enum MultiCommandCommand { CommandEncapsulation = 0x01, } -/** @publicAPI */ export enum MultilevelSensorCommand { GetSupportedSensor = 0x01, SupportedSensorReport = 0x02, @@ -1045,13 +996,11 @@ export enum MultilevelSensorCommand { SupportedScaleReport = 0x06, } -/** @publicAPI */ export interface MultilevelSensorValue { value: number; scale: Scale; } -/** @publicAPI */ export type MultilevelSensorValueMetadata = ValueMetadata & { ccSpecific: { sensorType: number; @@ -1059,7 +1008,6 @@ export type MultilevelSensorValueMetadata = ValueMetadata & { }; }; -/** @publicAPI */ export enum MultilevelSwitchCommand { Set = 0x01, Get = 0x02, @@ -1070,14 +1018,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, @@ -1089,14 +1035,12 @@ export enum SwitchType { "Pull/Push" = 0x07, } -/** @publicAPI */ export type MultilevelSwitchLevelChangeMetadata = ValueMetadata & { ccSpecific: { switchType: SwitchType; }; }; -/** @publicAPI */ export enum NodeNamingAndLocationCommand { NameSet = 0x01, NameGet = 0x02, @@ -1106,7 +1050,6 @@ export enum NodeNamingAndLocationCommand { LocationReport = 0x06, } -/** @publicAPI */ export enum NotificationCommand { EventSupportedGet = 0x01, EventSupportedReport = 0x02, @@ -1117,14 +1060,12 @@ export enum NotificationCommand { SupportedReport = 0x08, } -/** @publicAPI */ export type NotificationMetadata = ValueMetadata & { ccSpecific: { notificationType: number; }; }; -/** @publicAPI */ export enum PowerlevelCommand { Set = 0x01, Get = 0x02, @@ -1134,7 +1075,6 @@ export enum PowerlevelCommand { TestNodeReport = 0x06, } -/** @publicAPI */ export enum Powerlevel { "Normal Power" = 0x00, "-1 dBm" = 0x01, @@ -1148,14 +1088,12 @@ export enum Powerlevel { "-9 dBm" = 0x09, } -/** @publicAPI */ export enum PowerlevelTestStatus { Failed = 0x00, Success = 0x01, "In Progress" = 0x02, } -/** @publicAPI */ export enum ProtectionCommand { Set = 0x01, Get = 0x02, @@ -1170,40 +1108,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 ScheduleEntryLockCommand { EnableSet = 0x01, EnableAllSet = 0x02, @@ -1223,19 +1155,16 @@ export enum ScheduleEntryLockCommand { DailyRepeatingScheduleSet = 0x10, } -/** @publicAPI */ export enum ScheduleEntryLockSetAction { Erase, Set, } -/** @publicAPI */ export interface ScheduleEntryLockSlotId { userId: number; slotId: number; } -/** @publicAPI */ export enum ScheduleEntryLockWeekday { // Yay, consistency! Sunday = 0x00, @@ -1247,7 +1176,6 @@ export enum ScheduleEntryLockWeekday { Saturday = 0x06, } -/** @publicAPI */ export interface ScheduleEntryLockDailyRepeatingSchedule { weekdays: ScheduleEntryLockWeekday[]; startHour: number; @@ -1256,7 +1184,6 @@ export interface ScheduleEntryLockDailyRepeatingSchedule { durationMinute: number; } -/** @publicAPI */ export interface ScheduleEntryLockYearDaySchedule { startYear: number; startMonth: number; @@ -1270,7 +1197,6 @@ export interface ScheduleEntryLockYearDaySchedule { stopMinute: number; } -/** @publicAPI */ export interface ScheduleEntryLockWeekDaySchedule { weekday: ScheduleEntryLockWeekday; startHour: number; @@ -1279,7 +1205,6 @@ export interface ScheduleEntryLockWeekDaySchedule { stopMinute: number; } -/** @publicAPI */ export enum Security2Command { NonceGet = 0x01, NonceReport = 0x02, @@ -1297,7 +1222,6 @@ export enum Security2Command { CommandsSupportedReport = 0x0e, } -/** @publicAPI */ export enum SecurityCommand { CommandsSupportedGet = 0x02, CommandsSupportedReport = 0x03, @@ -1312,7 +1236,6 @@ export enum SecurityCommand { CommandEncapsulationNonceGet = 0xc1, } -/** @publicAPI */ export enum SoundSwitchCommand { TonesNumberGet = 0x01, TonesNumberReport = 0x02, @@ -1326,25 +1249,21 @@ export enum SoundSwitchCommand { TonePlayReport = 0x0a, } -/** @publicAPI */ export enum ToneId { Off = 0x00, Default = 0xff, } -/** @publicAPI */ export enum SupervisionCommand { Get = 0x01, Report = 0x02, } -/** @publicAPI */ export interface Timezone { standardOffset: number; dstOffset: number; } -/** @publicAPI */ export enum ThermostatFanModeCommand { Set = 0x01, Get = 0x02, @@ -1353,7 +1272,6 @@ export enum ThermostatFanModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum ThermostatFanMode { "Auto low" = 0x00, "Low" = 0x01, @@ -1369,13 +1287,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, @@ -1388,7 +1304,6 @@ export enum ThermostatFanState { "Quiet circulation mode" = 0x08, } -/** @publicAPI */ export enum ThermostatModeCommand { Set = 0x01, Get = 0x02, @@ -1397,7 +1312,6 @@ export enum ThermostatModeCommand { SupportedReport = 0x05, } -/** @publicAPI */ export enum ThermostatMode { "Off" = 0x00, "Heat" = 0x01, @@ -1417,7 +1331,6 @@ export enum ThermostatMode { "Manufacturer specific" = 0x1f, } -/** @publicAPI */ export enum ThermostatOperatingStateCommand { Get = 0x02, Report = 0x03, @@ -1428,7 +1341,6 @@ export enum ThermostatOperatingStateCommand { // LoggingReport = 0x06, } -/** @publicAPI */ export enum ThermostatOperatingState { "Idle" = 0x00, "Heating" = 0x01, @@ -1444,37 +1356,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, @@ -1485,7 +1391,6 @@ export enum ThermostatSetpointCommand { CapabilitiesReport = 0x0a, } -/** @publicAPI */ export enum ThermostatSetpointType { "N/A" = 0x00, "Heating" = 0x01, // CC v1 @@ -1501,13 +1406,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; @@ -1515,14 +1418,12 @@ export interface ThermostatSetpointCapabilities { maxValueScale: number; } -/** @publicAPI */ export type ThermostatSetpointMetadata = ValueMetadata & { ccSpecific: { setpointType: ThermostatSetpointType; }; }; -/** @publicAPI */ export enum TimeCommand { TimeGet = 0x01, TimeReport = 0x02, @@ -1533,14 +1434,12 @@ export enum TimeCommand { TimeOffsetReport = 0x07, } -/** @publicAPI */ export enum TimeParametersCommand { Set = 0x01, Get = 0x02, Report = 0x03, } -/** @publicAPI */ export enum TransportServiceCommand { FirstSegment = 0xc0, SegmentComplete = 0xe8, @@ -1549,7 +1448,6 @@ export enum TransportServiceCommand { SubsequentSegment = 0xe0, } -/** @publicAPI */ export enum UserCodeCommand { Set = 0x01, Get = 0x02, @@ -1572,7 +1470,6 @@ export enum UserCodeCommand { UserCodeChecksumReport = 0x12, } -/** @publicAPI */ export enum UserIDStatus { Available = 0x00, Enabled, @@ -1582,7 +1479,6 @@ export enum UserIDStatus { StatusNotAvailable = 0xfe, } -/** @publicAPI */ export enum KeypadMode { Normal = 0x00, Vacation, @@ -1590,7 +1486,6 @@ export enum KeypadMode { LockedOut, } -/** @publicAPI */ export enum VersionCommand { Get = 0x11, Report = 0x12, @@ -1602,7 +1497,6 @@ export enum VersionCommand { ZWaveSoftwareReport = 0x18, } -/** @publicAPI */ export enum WakeUpCommand { IntervalSet = 0x04, IntervalGet = 0x05, @@ -1613,13 +1507,11 @@ export enum WakeUpCommand { IntervalCapabilitiesReport = 0x0a, } -/** @publicAPI */ export enum ZWavePlusCommand { Get = 0x01, Report = 0x02, } -/** @publicAPI */ export enum ZWavePlusRoleType { CentralStaticController = 0x00, SubStaticController = 0x01, @@ -1632,13 +1524,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, diff --git a/packages/zwave-js/api.md b/packages/zwave-js/api.md index 7714c2346a69..c0347da41a76 100644 --- a/packages/zwave-js/api.md +++ b/packages/zwave-js/api.md @@ -84,6 +84,7 @@ import { NodeStatus } from '@zwave-js/core/safe'; import type { NodeStatus as NodeStatus_2 } from '@zwave-js/core'; import { NodeType } from '@zwave-js/core/safe'; import { NodeType as NodeType_2 } from '@zwave-js/core'; +import { NodeUpdatePayload } from '@zwave-js/core'; import type { NotificationCCReport } from '@zwave-js/cc/NotificationCC'; import { num2hex } from '@zwave-js/shared/safe'; import { parseQRCodeString } from '@zwave-js/core'; @@ -1148,6 +1149,7 @@ export class ZWaveNode extends Endpoint implements SecurityClassOwner, IZWaveNod get interviewAttempts(): number; interviewCC(cc: CommandClasses_2): Promise; protected interviewCCs(): Promise; + protected interviewNodeInfo(): Promise; get interviewStage(): InterviewStage; set interviewStage(value: InterviewStage); get isControllerNode(): boolean; @@ -1177,12 +1179,13 @@ export class ZWaveNode extends Endpoint implements SecurityClassOwner, IZWaveNod // (undocumented) get productType(): number | undefined; get protocolVersion(): ProtocolVersion_2 | undefined; - protected queryNodeInfo(): Promise; protected queryProtocolInfo(): Promise; get ready(): boolean; refreshCCValues(cc: CommandClasses_2): Promise; refreshInfo(options?: RefreshInfoOptions): Promise; refreshValues(): Promise; + // (undocumented) + requestNodeInfo(): Promise; requiresManualValueRefresh(): boolean; // (undocumented) get sdkVersion(): string | undefined; diff --git a/packages/zwave-js/src/lib/controller/Controller.ts b/packages/zwave-js/src/lib/controller/Controller.ts index 972e52b0df5c..f329a65f4522 100644 --- a/packages/zwave-js/src/lib/controller/Controller.ts +++ b/packages/zwave-js/src/lib/controller/Controller.ts @@ -1,6 +1,10 @@ import { AssociationCC, ECDHProfiles, + InclusionControllerCCComplete, + InclusionControllerCCInitiate, + InclusionControllerStatus, + InclusionControllerStep, inclusionTimeouts, KEXFailType, KEXSchemes, @@ -40,6 +44,7 @@ import { SecurityClass, securityClassIsS2, securityClassOrder, + SinglecastCC, ValueDB, ZWaveError, ZWaveErrorCodes, @@ -78,6 +83,13 @@ import { DeviceClass } from "../node/DeviceClass"; import { ZWaveNode } from "../node/Node"; import { VirtualNode } from "../node/VirtualNode"; import { InterviewStage, LifelineRoutes, NodeStatus } from "../node/_Types"; +import { + ApplicationUpdateRequestNodeAdded, + ApplicationUpdateRequestNodeInfoReceived, + ApplicationUpdateRequestNodeRemoved, + ApplicationUpdateRequestSmartStartHomeIDReceived, + type ApplicationUpdateRequest, +} from "../serialapi/application/ApplicationUpdateRequest"; import { GetControllerCapabilitiesRequest, GetControllerCapabilitiesResponse, @@ -1689,6 +1701,462 @@ export class ZWaveController extends TypedEventEmitter } } + /** @internal */ + public async handleApplicationUpdateRequest( + msg: ApplicationUpdateRequest, + ): Promise { + const nodeId = msg.getNodeId(); + let node: ZWaveNode | undefined; + if (nodeId != undefined) { + node = this.nodes.get(nodeId); + } + + if (msg instanceof ApplicationUpdateRequestNodeInfoReceived) { + if (node) { + this.driver.controllerLog.logNode(node.id, { + message: "Received updated node info", + direction: "inbound", + }); + node.updateNodeInfo(msg.nodeInformation); + + // Tell the send thread that we received a NIF from the node + this.driver["sendThread"].send({ + type: "NIF", + nodeId: node.id, + }); + + if ( + node.canSleep && + node.supportsCC(CommandClasses["Wake Up"]) + ) { + // In case this is a sleeping node and there are no messages in the queue, the node may go back to sleep very soon + this.driver.debounceSendNodeToSleep(node); + } + + return; + } + } else if ( + msg instanceof ApplicationUpdateRequestSmartStartHomeIDReceived + ) { + // the controller is in Smart Start learn mode and a node requests inclusion via Smart Start + this.driver.controllerLog.print( + "Received Smart Start inclusion request", + ); + + if ( + this.inclusionState !== InclusionState.Idle && + this.inclusionState !== InclusionState.SmartStart + ) { + this.driver.controllerLog.print( + "Controller is busy and cannot handle this inclusion request right now...", + ); + return; + } + + // Check if the node is on the provisioning list + const provisioningEntry = this.provisioningList.find((entry) => + nwiHomeIdFromDSK(dskFromString(entry.dsk)).equals( + msg.nwiHomeId, + ), + ); + if (!provisioningEntry) { + this.driver.controllerLog.print( + "NWI Home ID not found in provisioning list, ignoring request...", + ); + return; + } else if ( + provisioningEntry.status === ProvisioningEntryStatus.Inactive + ) { + this.driver.controllerLog.print( + "The provisioning entry for this node is inactive, ignoring request...", + ); + return; + } + + this.driver.controllerLog.print( + "NWI Home ID found in provisioning list, including node...", + ); + try { + const result = await this.beginInclusionSmartStart( + provisioningEntry, + ); + if (!result) { + this.driver.controllerLog.print( + "Smart Start inclusion could not be started", + "error", + ); + } + } catch (e) { + this.driver.controllerLog.print( + `Smart Start inclusion could not be started: ${getErrorMessage( + e, + )}`, + "error", + ); + } + } else if (msg instanceof ApplicationUpdateRequestNodeRemoved) { + // A node was removed by another controller + const node = this.nodes.get(msg.nodeId); + if (node) { + this.driver.controllerLog.logNode( + node.id, + "was removed from the network by another controller", + ); + + this.emit("node removed", node, false); + } + } else if (msg instanceof ApplicationUpdateRequestNodeAdded) { + // A node was included by another controller + const nodeId = msg.nodeId; + const nodeInfo = msg.nodeInformation; + + this.setInclusionState(InclusionState.Busy); + + const deviceClass = new DeviceClass( + this.driver.configManager, + nodeInfo.basicDeviceClass, + nodeInfo.genericDeviceClass, + nodeInfo.specificDeviceClass, + ); + + const newNode = new ZWaveNode( + nodeId, + this.driver, + deviceClass, + nodeInfo.supportedCCs, + undefined, + // Create an empty value DB and specify that it contains no values + // to avoid indexing the existing values + this.createValueDBForNode(nodeId, new Set()), + ); + this._nodes.set(nodeId, newNode); + + this.emit("node found", { + id: nodeId, + deviceClass, + supportedCCs: nodeInfo.supportedCCs, + }); + + this.driver.controllerLog.print( + `Node ${newNode.id} was included by another controller: +basic device class: ${newNode.deviceClass?.basic.label} +generic device class: ${newNode.deviceClass?.generic.label} +specific device class: ${newNode.deviceClass?.specific.label} +supported CCs: ${nodeInfo.supportedCCs + .map((cc) => `\n · ${CommandClasses[cc]} (${num2hex(cc)})`) + .join("")}`, + ); + + this.driver.controllerLog.logNode( + nodeId, + "Waiting for initiate command to bootstrap node...", + ); + + // Handle inclusion in the background + process.nextTick(async () => { + // If an Inclusion Controller that does not support the Inclusion Controller Command Class includes a + // new node in a network, the SIS will never receive an Inclusion Controller Initiate Command. If no + // Initiate Command has been received approximately 10 seconds after a new node has been added to a + // network, the SIS SHOULD start interviewing the newly included node + + const initiate = await this.driver + .waitForCommand< + SinglecastCC + >( + (cc) => + cc instanceof InclusionControllerCCInitiate && + cc.isSinglecast() && + cc.includedNodeId === nodeId && + cc.step === InclusionControllerStep.ProxyInclusion, + 10000, + ) + .catch(() => undefined); + + // Assume the device is alive + // If it is actually a sleeping device, it will be marked as such later + newNode.markAsAlive(); + + let inclCtrlr: ZWaveNode | undefined; + let lowSecurity = false; + + if (initiate) { + inclCtrlr = this.nodes.getOrThrow(initiate.nodeId); + + this.driver.controllerLog.logNode( + nodeId, + `Initiate command received from node ${inclCtrlr.id}`, + ); + + // Inclusion is handled by the inclusion controller, which (hopefully) sets the SUC return route + newNode.hasSUCReturnRoute = true; + + // SIS, A, MUST request a Node Info Frame from Joining Node, B + const requestedNodeInfo = await newNode + .requestNodeInfo() + .catch(() => undefined); + if (requestedNodeInfo) + newNode.updateNodeInfo(requestedNodeInfo); + + // Perform S0/S2 bootstrapping + lowSecurity = ( + await this.proxyBootstrap(newNode, inclCtrlr) + ).lowSecurity; + } else { + // No command received, bootstrap node by ourselves + this.driver.controllerLog.logNode( + nodeId, + "no initiate command received, bootstrapping node...", + ); + + // Assign SUC return route to make sure the node knows where to get its routes from + newNode.hasSUCReturnRoute = await this.assignSUCReturnRoute( + newNode.id, + ); + + // Include using the default inclusion strategy: + // * Use S2 if possible, + // * only use S0 if necessary, + // * use no encryption otherwise + if (newNode.supportsCC(CommandClasses["Security 2"])) { + await this.secureBootstrapS2(newNode); + const actualSecurityClass = + newNode.getHighestSecurityClass(); + if ( + actualSecurityClass == undefined || + actualSecurityClass < + SecurityClass.S2_Unauthenticated + ) { + lowSecurity = true; + } + } else if ( + newNode.supportsCC(CommandClasses.Security) && + (deviceClass.specific ?? deviceClass.generic) + .requiresSecurity + ) { + await this.secureBootstrapS0(newNode); + const actualSecurityClass = + newNode.getHighestSecurityClass(); + if ( + actualSecurityClass == undefined || + actualSecurityClass < SecurityClass.S0_Legacy + ) { + lowSecurity = true; + } + } else { + // Remember that no security classes were granted + for (const secClass of securityClassOrder) { + newNode.securityClasses.set(secClass, false); + } + } + } + + // Bootstrap the node's lifelines, so it knows where the controller is + await this.bootstrapLifelineAndWakeup(newNode); + + // We're done adding this node, notify listeners + const result: InclusionResult = {}; + if (lowSecurity) result.lowSecurity = true; + this.emit("node added", newNode, result); + + this.setInclusionState(InclusionState.Idle); + + if (inclCtrlr && initiate) { + const inclCtrlrId = inclCtrlr.id; + const step = initiate.step; + newNode.once("ready", () => { + this.driver.controllerLog.logNode( + nodeId, + `Notifying node ${inclCtrlrId} of finished inclusion`, + ); + void inclCtrlr!.commandClasses["Inclusion Controller"] + .completeStep(step, InclusionControllerStatus.OK) + // eslint-disable-next-line @typescript-eslint/no-empty-function + .catch(() => {}); + }); + } + }); + } + } + + /** + * @internal + * Handles replace requests from an inclusion controller + */ + public handleInclusionControllerCCInitiateReplace( + initiate: InclusionControllerCCInitiate, + ): void { + if (initiate.step !== InclusionControllerStep.ProxyInclusionReplace) { + throw new ZWaveError( + "Expected an inclusion controller replace request, but got a different step", + ZWaveErrorCodes.Argument_Invalid, + ); + } + this.setInclusionState(InclusionState.Busy); + + const inclCtrlr = this.nodes.getOrThrow(initiate.nodeId as number); + + const replacedNodeId = initiate.includedNodeId; + const oldNode = this.nodes.get(replacedNodeId); + if (oldNode) { + this.emit("node removed", oldNode, true); + this._nodes.delete(oldNode.id); + } + + // Create a fresh node instance and forget the old one + const newNode = new ZWaveNode( + replacedNodeId, + this.driver, + undefined, + undefined, + undefined, + // Create an empty value DB and specify that it contains no values + // to avoid indexing the existing values + this.createValueDBForNode(replacedNodeId, new Set()), + ); + this._nodes.set(newNode.id, newNode); + + this.emit("node found", { + id: newNode.id, + }); + + // Assume the device is alive + // If it is actually a sleeping device, it will be marked as such later + newNode.markAsAlive(); + + // Inclusion is handled by the inclusion controller, which (hopefully) sets the SUC return route + newNode.hasSUCReturnRoute = true; + + // Handle communication with the node in the background + process.nextTick(async () => { + // SIS, A, MUST request a Node Info Frame from Joining Node, B + const requestedNodeInfo = await newNode + .requestNodeInfo() + .catch(() => undefined); + if (requestedNodeInfo) { + newNode.updateNodeInfo(requestedNodeInfo); + + // TODO: Check if this stuff works for a normal replace too + const deviceClass = new DeviceClass( + this.driver.configManager, + requestedNodeInfo.basicDeviceClass, + requestedNodeInfo.genericDeviceClass, + requestedNodeInfo.specificDeviceClass, + ); + newNode["applyDeviceClass"](deviceClass); + } + + // Perform S0/S2 bootstrapping + const lowSecurity = (await this.proxyBootstrap(newNode, inclCtrlr)) + .lowSecurity; + + // Bootstrap the node's lifelines, so it knows where the controller is + await this.bootstrapLifelineAndWakeup(newNode); + + // We're done adding this node, notify listeners + const result: InclusionResult = {}; + if (lowSecurity) result.lowSecurity = true; + this.emit("node added", newNode, result); + + this.setInclusionState(InclusionState.Idle); + + // And notify the inclusion controller after we're done interviewing + newNode.once("ready", () => { + this.driver.controllerLog.logNode( + inclCtrlr.nodeId, + `Notifying inclusion controller of finished inclusion`, + ); + void inclCtrlr.commandClasses["Inclusion Controller"] + .completeStep(initiate.step, InclusionControllerStatus.OK) + // eslint-disable-next-line @typescript-eslint/no-empty-function + .catch(() => {}); + }); + }); + } + + /** + * Handles bootstrapping the security keys for a node that was included by an inclusion controller + */ + private async proxyBootstrap( + newNode: ZWaveNode, + inclCtrlr: ZWaveNode, + ): Promise<{ lowSecurity: boolean }> { + // This part is to be done before the interview + + const deviceClass = newNode.deviceClass!; + let lowSecurity = false; + + // Include using the default inclusion strategy: + // * Use S2 if possible, + // * only use S0 if necessary, + // * use no encryption otherwise + if (newNode.supportsCC(CommandClasses["Security 2"])) { + await this.secureBootstrapS2(newNode); + const actualSecurityClass = newNode.getHighestSecurityClass(); + if ( + actualSecurityClass == undefined || + actualSecurityClass < SecurityClass.S2_Unauthenticated + ) { + lowSecurity = true; + } + } else if ( + newNode.supportsCC(CommandClasses.Security) && + (deviceClass.specific ?? deviceClass.generic).requiresSecurity + ) { + // S0 bootstrapping is deferred to the inclusion controller + this.driver.controllerLog.logNode( + newNode.id, + `Waiting for node ${inclCtrlr.id} to perform S0 bootstrapping...`, + ); + + await inclCtrlr.commandClasses["Inclusion Controller"].initiateStep( + newNode.id, + InclusionControllerStep.S0Inclusion, + ); + // Wait 60s for the S0 bootstrapping to complete + const s0result = await this.driver + .waitForCommand( + (cc) => + cc.nodeId === inclCtrlr.id && + cc instanceof InclusionControllerCCComplete && + cc.step === InclusionControllerStep.S0Inclusion, + 60000, + ) + .catch(() => undefined); + + this.driver.controllerLog.logNode( + newNode.id, + `S0 bootstrapping ${ + s0result == undefined + ? "timed out" + : s0result.status === InclusionControllerStatus.OK + ? "succeeded" + : "failed" + }`, + ); + + // When bootstrapping with S0, no other keys are granted + for (const secClass of securityClassOrder) { + if (secClass !== SecurityClass.S0_Legacy) { + newNode.securityClasses.set(secClass, false); + } + } + // Whether the S0 key is granted depends on the result + // received from the inclusion controller + newNode.securityClasses.set( + SecurityClass.S0_Legacy, + s0result?.status === InclusionControllerStatus.OK, + ); + lowSecurity = !newNode.hasSecurityClass(SecurityClass.S0_Legacy); + } else { + // Remember that no security classes were granted + for (const secClass of securityClassOrder) { + newNode.securityClasses.set(secClass, false); + } + } + + return { lowSecurity }; + } + private async secureBootstrapS0( node: ZWaveNode, assumeSupported: boolean = false, diff --git a/packages/zwave-js/src/lib/controller/NodeInformationFrame.ts b/packages/zwave-js/src/lib/controller/NodeInformationFrame.ts index d1fe3e09e4aa..050a40277ba6 100644 --- a/packages/zwave-js/src/lib/controller/NodeInformationFrame.ts +++ b/packages/zwave-js/src/lib/controller/NodeInformationFrame.ts @@ -35,8 +35,9 @@ export function determineNIF(): { const supportedCCs = [ // Z-Wave Plus Info must be listed first CommandClasses["Z-Wave Plus Info"], - // TODO: Z-Wave Plus v2 Device Type Specification - // Gateway device type MUST **support** Inclusion Controller and Time CC + // Z-Wave Plus v2 Device Type Specification + // -> Gateway device type MUST support Inclusion Controller and Time CC + CommandClasses["Inclusion Controller"], CommandClasses.Time, ...implementedEncapsulationCCs, ]; diff --git a/packages/zwave-js/src/lib/driver/Driver.ts b/packages/zwave-js/src/lib/driver/Driver.ts index 80f990d54683..5b5981cfa2d3 100644 --- a/packages/zwave-js/src/lib/driver/Driver.ts +++ b/packages/zwave-js/src/lib/driver/Driver.ts @@ -43,7 +43,6 @@ import { CommandClasses, ControllerLogger, deserializeCacheValue, - dskFromString, Duration, EncapsulationFlags, highResTimestamp, @@ -55,7 +54,6 @@ import { MessagePriority, MessageRecord, messageRecordToLines, - nwiHomeIdFromDSK, SecurityClass, securityClassIsS2, SecurityManager, @@ -126,10 +124,7 @@ import { URL } from "url"; import * as util from "util"; import { interpret } from "xstate"; import { ZWaveController } from "../controller/Controller"; -import { - InclusionState, - ProvisioningEntryStatus, -} from "../controller/Inclusion"; +import { InclusionState } from "../controller/Inclusion"; import { DriverLogger } from "../log/Driver"; import type { Endpoint } from "../node/Endpoint"; import type { ZWaveNode } from "../node/Node"; @@ -139,11 +134,7 @@ import { ZWaveNotificationCallback, } from "../node/_Types"; import { ApplicationCommandRequest } from "../serialapi/application/ApplicationCommandRequest"; -import { - ApplicationUpdateRequest, - ApplicationUpdateRequestNodeInfoReceived, - ApplicationUpdateRequestSmartStartHomeIDReceived, -} from "../serialapi/application/ApplicationUpdateRequest"; +import { ApplicationUpdateRequest } from "../serialapi/application/ApplicationUpdateRequest"; import { BridgeApplicationCommandRequest } from "../serialapi/application/BridgeApplicationCommandRequest"; import type { SerialAPIStartedRequest } from "../serialapi/application/SerialAPIStartedRequest"; import { GetControllerVersionRequest } from "../serialapi/capability/GetControllerVersionMessages"; @@ -3609,91 +3600,9 @@ ${handlers.length} left`, return; } else if (msg instanceof ApplicationUpdateRequest) { - if (msg instanceof ApplicationUpdateRequestNodeInfoReceived) { - const node = this.getNodeUnsafe(msg); - if (node) { - this.controllerLog.logNode(node.id, { - message: "Received updated node info", - direction: "inbound", - }); - node.updateNodeInfo(msg.nodeInformation); - - // Tell the send thread that we received a NIF from the node - this.sendThread.send({ type: "NIF", nodeId: node.id }); - - if ( - node.canSleep && - node.supportsCC(CommandClasses["Wake Up"]) - ) { - // In case this is a sleeping node and there are no messages in the queue, the node may go back to sleep very soon - this.debounceSendNodeToSleep(node); - } - - return; - } - } else if ( - msg instanceof ApplicationUpdateRequestSmartStartHomeIDReceived - ) { - // the controller is in Smart Start learn mode and a node requests inclusion via Smart Start - this.controllerLog.print( - "Received Smart Start inclusion request", - ); - - if ( - this.controller.inclusionState !== InclusionState.Idle && - this.controller.inclusionState !== InclusionState.SmartStart - ) { - this.controllerLog.print( - "Controller is busy and cannot handle this inclusion request right now...", - ); - return; - } - - // Check if the node is on the provisioning list - const provisioningEntry = this.controller.provisioningList.find( - (entry) => - nwiHomeIdFromDSK(dskFromString(entry.dsk)).equals( - msg.nwiHomeId, - ), - ); - if (!provisioningEntry) { - this.controllerLog.print( - "NWI Home ID not found in provisioning list, ignoring request...", - ); - return; - } else if ( - provisioningEntry.status === - ProvisioningEntryStatus.Inactive - ) { - this.controllerLog.print( - "The provisioning entry for this node is inactive, ignoring request...", - ); - return; - } - - this.controllerLog.print( - "NWI Home ID found in provisioning list, including node...", - ); - try { - const result = - await this.controller.beginInclusionSmartStart( - provisioningEntry, - ); - if (!result) { - this.controllerLog.print( - "Smart Start inclusion could not be started", - "error", - ); - } - } catch (e) { - this.controllerLog.print( - `Smart Start inclusion could not be started: ${getErrorMessage( - e, - )}`, - "error", - ); - } - } + // Make sure we're ready to handle this command + this.ensureReady(true); + return this.controller.handleApplicationUpdateRequest(msg); } else { // TODO: This deserves a nicer formatting this.driverLog.print( diff --git a/packages/zwave-js/src/lib/node/Node.test.ts b/packages/zwave-js/src/lib/node/Node.test.ts index d7f5f13d5c78..2ad5660ba630 100644 --- a/packages/zwave-js/src/lib/node/Node.test.ts +++ b/packages/zwave-js/src/lib/node/Node.test.ts @@ -33,6 +33,7 @@ import { wait } from "alcalzone-shared/async"; import { createDefaultMockControllerBehaviors } from "../../Utils"; import type { Driver } from "../driver/Driver"; import { createAndStartTestingDriver } from "../driver/DriverMock"; +import { ApplicationUpdateRequestNodeInfoReceived } from "../serialapi/application/ApplicationUpdateRequest"; import { GetNodeProtocolInfoRequest, GetNodeProtocolInfoResponse, @@ -53,8 +54,8 @@ class TestNode extends ZWaveNode { public async ping(): Promise { return super.ping(); } - public async queryNodeInfo(): Promise { - return super["queryNodeInfo"](); + public async interviewNodeInfo(): Promise { + return super["interviewNodeInfo"](); } public async interviewCCs(): Promise { return super.interviewCCs(); @@ -348,29 +349,39 @@ describe("lib/node/Node", () => { }); }); - describe(`queryNodeInfo()`, () => { + describe(`interviewNodeInfo()`, () => { beforeAll(() => fakeDriver.sendMessage.mockImplementation(() => - Promise.resolve(), + Promise.resolve( + new ApplicationUpdateRequestNodeInfoReceived( + undefined as any, + { + nodeInformation: { + nodeId: 2, + supportedCCs: [], + }, + } as any, + ), + ), ), ); beforeEach(() => fakeDriver.sendMessage.mockClear()); it(`should set the interview stage to "NodeInfo"`, async () => { - await node["queryNodeInfo"](); + await node["interviewNodeInfo"](); expect(node.interviewStage).toBe(InterviewStage.NodeInfo); }); it("should not send anything if the node is the controller", async () => { // Temporarily make this node the controller node fakeDriver.controller.ownNodeId = node.id; - await node["queryNodeInfo"](); + await node["interviewNodeInfo"](); expect(fakeDriver.sendMessage).not.toBeCalled(); fakeDriver.controller.ownNodeId = 1; }); it("should send a RequestNodeInfoRequest with the node's ID", async () => { - await node["queryNodeInfo"](); + await node["interviewNodeInfo"](); expect(fakeDriver.sendMessage).toBeCalled(); const request: RequestNodeInfoRequest = fakeDriver.sendMessage.mock.calls[0][0]; @@ -597,7 +608,7 @@ describe("lib/node/Node", () => { beforeAll(() => { const interviewStagesAfter: Record = { queryProtocolInfo: InterviewStage.ProtocolInfo, - queryNodeInfo: InterviewStage.NodeInfo, + interviewNodeInfo: InterviewStage.NodeInfo, interviewCCs: InterviewStage.CommandClasses, }; const returnValues: Partial> = { @@ -606,7 +617,7 @@ describe("lib/node/Node", () => { }; originalMethods = { queryProtocolInfo: node["queryProtocolInfo"].bind(node), - queryNodeInfo: node["queryNodeInfo"].bind(node), + interviewNodeInfo: node["interviewNodeInfo"].bind(node), interviewCCs: node["interviewCCs"].bind(node), }; for (const method of Object.keys( diff --git a/packages/zwave-js/src/lib/node/Node.ts b/packages/zwave-js/src/lib/node/Node.ts index 0d548257632b..a2a8a7be6ac8 100644 --- a/packages/zwave-js/src/lib/node/Node.ts +++ b/packages/zwave-js/src/lib/node/Node.ts @@ -12,6 +12,8 @@ import { FirmwareUpdateResult, FirmwareUpdateStatus, getCCValues, + InclusionControllerCCInitiate, + InclusionControllerStep, isCommandClassContainer, MultilevelSwitchCommand, PollValueImplementation, @@ -1494,7 +1496,9 @@ export class ZWaveNode } if (this.interviewStage === InterviewStage.ProtocolInfo) { - if (!(await tryInterviewStage(() => this.queryNodeInfo()))) { + if ( + !(await tryInterviewStage(() => this.interviewNodeInfo())) + ) { return false; } } @@ -1636,7 +1640,7 @@ protocol version: ${this.protocolVersion}`; * Step #5 of the node interview * Request node info */ - protected async queryNodeInfo(): Promise { + protected async interviewNodeInfo(): Promise { if (this.isControllerNode) { this.driver.controllerLog.logNode( this.id, @@ -1650,16 +1654,42 @@ protocol version: ${this.protocolVersion}`; message: "querying node info...", direction: "outbound", }); + try { + const nodeInfo = await this.requestNodeInfo(); + const logLines: string[] = ["node info received", "supported CCs:"]; + for (const cc of nodeInfo.supportedCCs) { + const ccName = CommandClasses[cc]; + logLines.push(`· ${ccName ? ccName : num2hex(cc)}`); + } + this.driver.controllerLog.logNode(this.id, { + message: logLines.join("\n"), + direction: "inbound", + }); + this.updateNodeInfo(nodeInfo); + } catch (e) { + if ( + isZWaveError(e) && + (e.code === ZWaveErrorCodes.Controller_ResponseNOK || + e.code === ZWaveErrorCodes.Controller_CallbackNOK) + ) { + this.driver.controllerLog.logNode( + this.id, + `Querying the node info failed`, + "error", + ); + } + throw e; + } + + this.setInterviewStage(InterviewStage.NodeInfo); + } + + public async requestNodeInfo(): Promise { const resp = await this.driver.sendMessage< RequestNodeInfoResponse | ApplicationUpdateRequest >(new RequestNodeInfoRequest(this.driver, { nodeId: this.id })); if (resp instanceof RequestNodeInfoResponse && !resp.wasSent) { // TODO: handle this in SendThreadMachine - this.driver.controllerLog.logNode( - this.id, - `Querying the node info failed`, - "error", - ); throw new ZWaveError( `Querying the node info failed`, ZWaveErrorCodes.Controller_ResponseNOK, @@ -1668,11 +1698,6 @@ protocol version: ${this.protocolVersion}`; resp instanceof ApplicationUpdateRequestNodeInfoRequestFailed ) { // TODO: handle this in SendThreadMachine - this.driver.controllerLog.logNode( - this.id, - `Querying the node info failed`, - "error", - ); throw new ZWaveError( `Querying the node info failed`, ZWaveErrorCodes.Controller_CallbackNOK, @@ -1687,9 +1712,12 @@ protocol version: ${this.protocolVersion}`; message: logLines.join("\n"), direction: "inbound", }); - this.updateNodeInfo(resp.nodeInformation); + return resp.nodeInformation; } - this.setInterviewStage(InterviewStage.NodeInfo); + throw new ZWaveError( + `Received unexpected response to RequestNodeInfoRequest`, + ZWaveErrorCodes.Controller_CommandError, + ); } /** @@ -2591,6 +2619,15 @@ protocol version: ${this.protocolVersion}`; return this.handleTimeOffsetGet(command); } else if (command instanceof ZWavePlusCCGet) { return this.handleZWavePlusGet(command); + } else if (command instanceof InclusionControllerCCInitiate) { + // Inclusion controller commands are handled by the controller class + if ( + command.step === InclusionControllerStep.ProxyInclusionReplace + ) { + return this.driver.controller.handleInclusionControllerCCInitiateReplace( + command, + ); + } } // Ignore all commands that don't need to be handled diff --git a/packages/zwave-js/src/lib/serialapi/application/ApplicationUpdateRequest.ts b/packages/zwave-js/src/lib/serialapi/application/ApplicationUpdateRequest.ts index 429ffe77410c..3f75475464e3 100644 --- a/packages/zwave-js/src/lib/serialapi/application/ApplicationUpdateRequest.ts +++ b/packages/zwave-js/src/lib/serialapi/application/ApplicationUpdateRequest.ts @@ -31,14 +31,15 @@ export enum ApplicationUpdateTypes { NodeInfo_RequestDone = 0x82, NodeInfo_RequestFailed = 0x81, RoutingPending = 0x80, - NewIdAssigned = 0x40, - DeleteDone = 0x20, + Node_Added = 0x40, // A new node was added to the network by another controller + Node_Removed = 0x20, // A new node was removed from the network by another controller SUC_IdChanged = 0x10, } const { decorator: applicationUpdateType, lookupConstructor: getApplicationUpdateRequestConstructor, + lookupValue: getApplicationUpdateType, } = createSimpleReflectionDecorator< ApplicationUpdateRequest, [updateType: ApplicationUpdateTypes], @@ -47,19 +48,10 @@ const { name: "applicationUpdateType", }); -interface ApplicationUpdateRequestOptions extends MessageBaseOptions { - updateType: ApplicationUpdateTypes; -} - @messageTypes(MessageType.Request, FunctionType.ApplicationUpdateRequest) // this is only received, not sent! export class ApplicationUpdateRequest extends Message { - public constructor( - host: ZWaveHost, - options: - | ApplicationUpdateRequestOptions - | MessageDeserializationOptions, - ) { + public constructor(host: ZWaveHost, options?: MessageOptions) { super(host, options); if (gotDeserializationOptions(options)) { @@ -77,7 +69,7 @@ export class ApplicationUpdateRequest extends Message { this.payload = this.payload.slice(1); } else { - this.updateType = options.updateType; + this.updateType = getApplicationUpdateType(this)!; } } @@ -92,23 +84,19 @@ export class ApplicationUpdateRequest extends Message { } } -interface ApplicationUpdateRequestNodeInfoReceivedOptions +interface ApplicationUpdateRequestWithNodeInfoOptions extends MessageBaseOptions { nodeInformation: NodeUpdatePayload; } -@applicationUpdateType(ApplicationUpdateTypes.NodeInfo_Received) -export class ApplicationUpdateRequestNodeInfoReceived extends ApplicationUpdateRequest { +export class ApplicationUpdateRequestWithNodeInfo extends ApplicationUpdateRequest { public constructor( host: ZWaveHost, options: | MessageDeserializationOptions - | ApplicationUpdateRequestNodeInfoReceivedOptions, + | ApplicationUpdateRequestWithNodeInfoOptions, ) { - super(host, { - ...options, - updateType: ApplicationUpdateTypes.NodeInfo_Received, - }); + super(host, options); if (gotDeserializationOptions(options)) { this.nodeInformation = parseNodeUpdatePayload(this.payload); @@ -128,23 +116,37 @@ export class ApplicationUpdateRequestNodeInfoReceived extends ApplicationUpdateR } } +@applicationUpdateType(ApplicationUpdateTypes.NodeInfo_Received) +export class ApplicationUpdateRequestNodeInfoReceived extends ApplicationUpdateRequestWithNodeInfo {} + @applicationUpdateType(ApplicationUpdateTypes.NodeInfo_RequestFailed) export class ApplicationUpdateRequestNodeInfoRequestFailed extends ApplicationUpdateRequest implements SuccessIndicator { - public constructor(host: ZWaveHost, options?: MessageOptions) { - super(host, { - ...options, - updateType: ApplicationUpdateTypes.NodeInfo_RequestFailed, - }); - } - isOK(): boolean { return false; } } +@applicationUpdateType(ApplicationUpdateTypes.Node_Added) +export class ApplicationUpdateRequestNodeAdded extends ApplicationUpdateRequestWithNodeInfo {} + +@applicationUpdateType(ApplicationUpdateTypes.Node_Removed) +export class ApplicationUpdateRequestNodeRemoved extends ApplicationUpdateRequest { + public constructor( + host: ZWaveHost, + options: MessageDeserializationOptions, + ) { + super(host, options); + + this.nodeId = this.payload[0]; + // byte 1 is 0, meaning unknown + } + + public nodeId: number; +} + @applicationUpdateType(ApplicationUpdateTypes.SmartStart_HomeId_Received) export class ApplicationUpdateRequestSmartStartHomeIDReceived extends ApplicationUpdateRequest { public constructor( diff --git a/packages/zwave-js/src/lib/serialapi/network-mgmt/RequestNodeInfoMessages.ts b/packages/zwave-js/src/lib/serialapi/network-mgmt/RequestNodeInfoMessages.ts index c94db0d71c8a..c4f2f6547af3 100644 --- a/packages/zwave-js/src/lib/serialapi/network-mgmt/RequestNodeInfoMessages.ts +++ b/packages/zwave-js/src/lib/serialapi/network-mgmt/RequestNodeInfoMessages.ts @@ -1,4 +1,4 @@ -import { MessagePriority } from "@zwave-js/core"; +import { MessageOrCCLogEntry, MessagePriority } from "@zwave-js/core"; import type { ZWaveHost } from "@zwave-js/host"; import { expectedCallback, @@ -50,6 +50,13 @@ export class RequestNodeInfoResponse this.payload = Buffer.from([this.wasSent ? 0x01 : 0]); return super.serialize(); } + + public toLogEntry(): MessageOrCCLogEntry { + return { + ...super.toLogEntry(), + message: { "was sent": this.wasSent }, + }; + } } interface RequestNodeInfoRequestOptions extends MessageBaseOptions { @@ -95,4 +102,11 @@ export class RequestNodeInfoRequest extends Message implements INodeQuery { this.payload = Buffer.from([this.nodeId]); return super.serialize(); } + + public toLogEntry(): MessageOrCCLogEntry { + return { + ...super.toLogEntry(), + message: { "node id": this.nodeId }, + }; + } } diff --git a/test/run.ts b/test/run.ts index 026045bf777a..c46a47845c3f 100644 --- a/test/run.ts +++ b/test/run.ts @@ -17,6 +17,9 @@ const driver = new Driver(port, { // logToFile: true, // forceConsole: true, // }, + logConfig: { + level: "verbose", + }, securityKeys: { S0_Legacy: Buffer.from("0102030405060708090a0b0c0d0e0f10", "hex"), S2_Unauthenticated: Buffer.from(