@zwave-js/cc 14.1.0 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +2 -0
- package/build/cjs/cc/AssociationCC.js +5 -0
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CRC16CC.d.ts +4 -0
- package/build/cjs/cc/CRC16CC.js +23 -0
- package/build/cjs/cc/CRC16CC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +4 -0
- package/build/cjs/cc/ConfigurationCC.js +10 -0
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +2 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js +6 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +10 -0
- package/build/cjs/cc/MultiChannelCC.js +65 -0
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultiCommandCC.d.ts +4 -0
- package/build/cjs/cc/MultiCommandCC.js +34 -1
- package/build/cjs/cc/MultiCommandCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +4 -0
- package/build/cjs/cc/Security2CC.js +215 -0
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.d.ts +6 -0
- package/build/cjs/cc/SecurityCC.js +53 -0
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +4 -0
- package/build/cjs/cc/SupervisionCC.js +25 -0
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +5 -0
- package/build/cjs/cc/TransportServiceCC.js +13 -0
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/Decorators.js +6 -5
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +15 -1
- package/build/cjs/lib/CommandClass.js +56 -1
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/CommandClassDecorators.js +7 -6
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.js +2 -2
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +1 -0
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +2 -0
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +14 -0
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +6 -0
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +3 -0
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -0
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +1 -0
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +3 -0
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -0
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +4 -0
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +30 -0
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +1 -0
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +3 -0
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +1 -0
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +6 -0
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +4 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +27 -0
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +2 -0
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +1 -0
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -0
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +1 -0
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +5 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +1 -0
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +4 -0
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +2 -0
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +7 -0
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +9 -0
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +1 -0
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +1 -0
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +2 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -0
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +4 -0
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +2 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +17 -0
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +10 -0
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +94 -0
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +4 -0
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +35 -1
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +5 -0
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +4 -0
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -0
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +9 -0
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +4 -0
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +3 -0
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +1 -0
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +14 -0
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +4 -0
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +301 -0
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +6 -0
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +73 -0
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +7 -0
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +4 -0
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +30 -0
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +1 -0
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +3 -0
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +2 -0
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +6 -0
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +4 -0
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -0
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +5 -0
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +24 -0
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +12 -0
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +4 -0
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +1 -0
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +5 -0
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +1 -0
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +27 -0
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.js +2 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +3 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +15 -1
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +94 -1
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +2 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.js +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/AlarmSensorCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = Object.freeze({\n\t...V.defineDynamicCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t}),\n\t...V.defineStaticCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t}),\n});\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.sensorType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAaO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAAsD;AAEtD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7C,MAAM,sBAAsB,OAAO,OAAO;EAChD,GAAG,gBAAE,sBAAsB,2BAAe,cAAc,GAAG;IAC1D,GAA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CAAA,YAAa;;;;;;AAAnD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA6C;AAE7C,YAAM,OAAO;AACb,WAAK,aAAa,QAAQ,cAAc,6BAAgB;IACzD;IAEO,OAAO,KAAK,MAAa,MAAsB;AAErD,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,UAAU,CAAC;
|
|
4
|
+
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = Object.freeze({\n\t...V.defineDynamicCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t}),\n\t...V.defineStaticCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t}),\n});\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.sensorType]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAaO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAAsD;AAEtD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7C,MAAM,sBAAsB,OAAO,OAAO;EAChD,GAAG,gBAAE,sBAAsB,2BAAe,cAAc,GAAG;IAC1D,GAAG,gBAAE,8BACJ,SACA,SACA,CAAC,eAAgC,YACjC,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,WAAW,OAAO,gBAAgB,UAChD,CAAC,eAA+B;AAC/B,YAAM,gBAAY,gCACjB,8BACA,UAAU;AAEX,aAAO;QACN,GAAG,0BAAc;QACjB,OAAO,GAAG,SAAS;QACnB,aAAa;QACb,YAAY,EAAE,WAAU;;IAE1B,CAAC;IAEF,GAAG,gBAAE,8BACJ,YACA,YACA,CAAC,eAAgC,YACjC,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,cAAc,OAAO,gBAAgB,UACnD,CAAC,eAA+B;AAC/B,YAAM,gBAAY,gCACjB,8BACA,UAAU;AA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A4B,CAAC;;;;oBACF;iDAAA,YAAa;;;;;;AAA5D,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": ["import_safe"]
|
|
7
7
|
}
|
|
@@ -212,7 +212,9 @@ export declare class AssociationCCReport extends AssociationCC {
|
|
|
212
212
|
reportsToFollow: number;
|
|
213
213
|
getPartialCCSessionId(): Record<string, any> | undefined;
|
|
214
214
|
expectMoreMessages(): boolean;
|
|
215
|
+
/** @deprecated Use {@link mergePartialCCsAsync} instead */
|
|
215
216
|
mergePartialCCs(partials: AssociationCCReport[], _ctx: CCParsingContext): void;
|
|
217
|
+
mergePartialCCsAsync(partials: AssociationCCReport[], _ctx: CCParsingContext): Promise<void>;
|
|
216
218
|
serialize(ctx: CCEncodingContext): Bytes;
|
|
217
219
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
218
220
|
}
|
|
@@ -662,9 +662,14 @@ let AssociationCCReport = (() => {
|
|
|
662
662
|
expectMoreMessages() {
|
|
663
663
|
return this.reportsToFollow > 0;
|
|
664
664
|
}
|
|
665
|
+
/** @deprecated Use {@link mergePartialCCsAsync} instead */
|
|
665
666
|
mergePartialCCs(partials, _ctx) {
|
|
666
667
|
this.nodeIds = [...partials, this].map((report) => report.nodeIds).reduce((prev, cur) => prev.concat(...cur), []);
|
|
667
668
|
}
|
|
669
|
+
mergePartialCCsAsync(partials, _ctx) {
|
|
670
|
+
this.nodeIds = [...partials, this].map((report) => report.nodeIds).reduce((prev, cur) => prev.concat(...cur), []);
|
|
671
|
+
return Promise.resolve();
|
|
672
|
+
}
|
|
668
673
|
serialize(ctx) {
|
|
669
674
|
this.payload = import_safe2.Bytes.from([
|
|
670
675
|
this.groupId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/AssociationCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n\tEndpointId,\n\tMaybeNotKnown,\n\tMessageRecord,\n\tSupervisionResult,\n\tWithAddress,\n} from \"@zwave-js/core/safe\";\nimport {\n\tCommandClasses,\n\tMAX_NODES,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type AssociationAddress, AssociationCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const AssociationCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses.Association, {\n\t\t/** Whether the node has a lifeline association */\n\t\t...V.staticProperty(\"hasLifeline\", undefined, { internal: true }),\n\t\t/** How many association groups the node has */\n\t\t...V.staticProperty(\"groupCount\", undefined, { internal: true }),\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses.Association, {\n\t\t/** The maximum number of nodes in an association group */\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"maxNodes\",\n\t\t\t\"maxNodes\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"maxNodes\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t/** The node IDs currently belonging to an association group */\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"nodeIds\",\n\t\t\t\"nodeIds\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"nodeIds\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t}),\n});\n\n// @noSetValueAPI\n\n@API(CommandClasses.Association)\nexport class AssociationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AssociationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationCommand.Get:\n\t\t\tcase AssociationCommand.Set:\n\t\t\tcase AssociationCommand.Report:\n\t\t\tcase AssociationCommand.Remove:\n\t\t\tcase AssociationCommand.SupportedGroupingsGet:\n\t\t\tcase AssociationCommand.SupportedGroupingsReport:\n\t\t\t\treturn true;\n\t\t\tcase AssociationCommand.SpecificGroupGet:\n\t\t\tcase AssociationCommand.SpecificGroupReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Returns the number of association groups a node supports.\n\t * Association groups are consecutive, starting at 1.\n\t */\n\tpublic async getGroupCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationCCSupportedGroupingsReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.groupCount;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupCount(groupCount: number): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupCount,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Returns information about an association group.\n\t */\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getGroup(groupId: number) {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);\n\n\t\tconst cc = new AssociationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AssociationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\tmaxNodes: response.maxNodes,\n\t\t\t\tnodeIds: response.nodeIds,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: AssociationCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Report,\n\t\t);\n\n\t\tconst cc = new AssociationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Adds new nodes to an association group\n\t */\n\t@validateArgs()\n\tpublic async addNodeIds(\n\t\tgroupId: number,\n\t\t...nodeIds: number[]\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);\n\n\t\tconst cc = new AssociationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from an association group\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIds(\n\t\toptions: AssociationCCRemoveOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\t// Validate options\n\t\tif (!options.groupId) {\n\t\t\tif (this.version === 1) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (options.groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new AssociationCCRemove({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from all association groups\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIdsFromAllGroups(\n\t\tnodeIds: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\tif (this.version >= 2) {\n\t\t\t// The node supports bulk removal\n\t\t\treturn this.removeNodeIds({ nodeIds, groupId: 0 });\n\t\t} else {\n\t\t\t// We have to remove the node manually from all groups\n\t\t\tconst groupCount = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(\n\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t),\n\t\t\t) ?? 0;\n\t\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\t\t// TODO: evaluate intermediate supervision results\n\t\t\t\tawait this.removeNodeIds({ nodeIds, groupId });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Request the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async getSpecificGroup(): Promise<number | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationCCSpecificGroupReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.group;\n\t}\n\n\t/**\n\t * Report the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async reportSpecificGroup(\n\t\tgroup: number,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroup,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Association)\n@implementedVersion(4)\n@ccValues(AssociationCCValues)\nexport class AssociationCC extends CommandClass {\n\tdeclare ccCommand: AssociationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses[\"Z-Wave Plus Info\"],\n\t\t\t// We need information about endpoints to correctly configure the lifeline associations\n\t\t\tCommandClasses[\"Multi Channel\"],\n\t\t];\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(endpoint.index),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of nodes an association group supports.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getMaxNodesCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): number {\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tAssociationCCValues.maxNodes(groupId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t// If the information is not available, fall back to the configuration file if possible\n\t\t\t\t// This can happen on some legacy devices which have \"hidden\" association groups\n\t\t\t\t?? ctx\n\t\t\t\t\t.getDeviceConfig?.(endpoint.nodeId)\n\t\t\t\t\t?.getAssociationConfigForEndpoint(endpoint.index, groupId)\n\t\t\t\t\t?.maxNodes\n\t\t\t\t?? 0\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the destinations of all association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getAllDestinationsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): ReadonlyMap<number, readonly AssociationAddress[]> {\n\t\tconst ret = new Map<number, AssociationAddress[]>();\n\t\tconst groupCount = this.getGroupCountCached(ctx, endpoint);\n\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\t\tfor (let i = 1; i <= groupCount; i++) {\n\t\t\t// Add all root destinations\n\t\t\tconst nodes = valueDB.getValue<number[]>(\n\t\t\t\tAssociationCCValues.nodeIds(i).endpoint(endpoint.index),\n\t\t\t) ?? [];\n\n\t\t\tret.set(\n\t\t\t\ti,\n\t\t\t\t// Filter out duplicates\n\t\t\t\tdistinct(nodes).map((nodeId) => ({ nodeId })),\n\t\t\t);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Even if Multi Channel Association is supported, we still need to query the number of\n\t\t// normal association groups since some devices report more association groups than\n\t\t// multi channel association groups\n\n\t\t// Find out how many groups are supported\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying number of association groups...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst groupCount = await api.getGroupCount();\n\t\tif (groupCount != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `supports ${groupCount} association groups`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying association groups timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query each association group for its members\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Skip the remaining Association CC interview in favor of Multi Channel Association if possible\n\t\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// And set up lifeline associations\n\t\tawait ccUtils.configureLifelineAssociations(ctx, endpoint);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst groupCount = AssociationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\t// Query each association group\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying association group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.getGroup(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received information for association group #${groupId}:\nmaximum # of nodes: ${group.maxNodes}\ncurrently assigned nodes: ${group.nodeIds.map(String).join(\", \")}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCSetOptions {\n\tgroupId: number;\n\tnodeIds: number[];\n}\n\n@CCCommand(AssociationCommand.Set)\n@useSupervision()\nexport class AssociationCCSet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tif (options.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`All node IDs must be between 1 and ${MAX_NODES}!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\tpublic nodeIds: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId, ...this.nodeIds]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\n\t\t};\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCRemoveOptions {\n\t/** The group from which to remove the nodes. If none is specified, the nodes will be removed from all nodes. */\n\tgroupId?: number;\n\t/** The nodes to remove. If none are specified, ALL nodes will be removed. */\n\tnodeIds?: number[];\n}\n\n@CCCommand(AssociationCommand.Remove)\n@useSupervision()\nexport class AssociationCCRemove extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCRemoveOptions>,\n\t) {\n\t\tsuper(options);\n\t\t// When removing associations, we allow invalid node IDs.\n\t\t// See GH#3606 - it is possible that those exist.\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCRemove {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tlet groupId: number | undefined;\n\t\tif (raw.payload[0] !== 0) {\n\t\t\tgroupId = raw.payload[0];\n\t\t}\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId?: number;\n\tpublic nodeIds?: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId || 0,\n\t\t\t...(this.nodeIds || []),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds && this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\n\t\t};\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCReportOptions {\n\tgroupId: number;\n\tmaxNodes: number;\n\tnodeIds: number[];\n\treportsToFollow: number;\n}\n\n@CCCommand(AssociationCommand.Report)\n@ccValueProperty(\n\t\"maxNodes\",\n\tAssociationCCValues.maxNodes,\n\t(self) => [self.groupId],\n)\n@ccValueProperty(\n\t\"nodeIds\",\n\tAssociationCCValues.nodeIds,\n\t(self) => [self.groupId],\n)\nexport class AssociationCCReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.maxNodes = options.maxNodes;\n\t\tthis.nodeIds = options.nodeIds;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst maxNodes = raw.payload[1];\n\t\tconst reportsToFollow = raw.payload[2];\n\t\tconst nodeIds = [...raw.payload.subarray(3)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tmaxNodes,\n\t\t\treportsToFollow,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic maxNodes: number;\n\n\tpublic nodeIds: number[];\n\n\tpublic reportsToFollow: number;\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the association group ID\n\t\treturn { groupId: this.groupId };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic mergePartialCCs(\n\t\tpartials: AssociationCCReport[],\n\t\t_ctx: CCParsingContext,\n\t): void {\n\t\t// Concat the list of nodes\n\t\tthis.nodeIds = [...partials, this]\n\t\t\t.map((report) => report.nodeIds)\n\t\t\t.reduce((prev, cur) => prev.concat(...cur), []);\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.maxNodes,\n\t\t\tthis.reportsToFollow,\n\t\t\t...this.nodeIds,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"max # of nodes\": this.maxNodes,\n\t\t\t\t\"node IDs\": this.nodeIds.join(\", \"),\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationCommand.Get)\n@expectedCCResponse(AssociationCCReport)\nexport class AssociationCCGet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCSupportedGroupingsReportOptions {\n\tgroupCount: number;\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsReport)\n@ccValueProperty(\"groupCount\", AssociationCCValues.groupCount)\nexport class AssociationCCSupportedGroupingsReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSupportedGroupingsReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupCount = options.groupCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSupportedGroupingsReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupCount = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupCount,\n\t\t});\n\t}\n\n\tpublic groupCount: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupCount]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group count\": this.groupCount },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsGet)\n@expectedCCResponse(AssociationCCSupportedGroupingsReport)\nexport class AssociationCCSupportedGroupingsGet extends AssociationCC {}\n\n// @publicAPI\nexport interface AssociationCCSpecificGroupReportOptions {\n\tgroup: number;\n}\n\n@CCCommand(AssociationCommand.SpecificGroupReport)\nexport class AssociationCCSpecificGroupReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSpecificGroupReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.group = options.group;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSpecificGroupReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst group = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroup,\n\t\t});\n\t}\n\n\tpublic group: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.group]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { group: this.group },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SpecificGroupGet)\n@expectedCCResponse(AssociationCCSpecificGroupReport)\nexport class AssociationCCSpecificGroupGet extends AssociationCC {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,kBAQO;AAOP,IAAAA,eAAsB;AAEtB,oBAAyB;AACzB,iBAAqC;AACrC,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAA4D;AAC5D,cAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElB,MAAM,sBAAsB,OAAO,OAAO;EAChD,GAAG,gBAAE,qBAAqB,2BAAe,aAAa;;IAErD,GAAG,gBAAE,eAAe,eAAe,QAAW,EAAE,UAAU,KAAI,CAAE;;IAEhE,GAAG,gBAAE,eAAe,cAAc,QAAW,EAAE,UAAU,KAAI,CAAE;GAC/D;EAED,GAAG,gBAAE,sBAAsB,2BAAe,aAAa;;IAEtD,GAAG,gBAAE,8BACJ,YACA,YACA,CAAC,YAAoB,SACrB,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,cAAc,OAAO,gBAAgB,UACnD,QACA,EAAE,UAAU,KAAI,CAAE;;IAGnB,GAAG,gBAAE,8BACJ,WACA,WACA,CAAC,YAAoB,SACrB,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,aAAa,OAAO,gBAAgB,UAClD,QACA,EAAE,UAAU,KAAI,CAAE;GAEnB;CACD;IAKY,oBA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AAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;IAQA,oCAAgC,MAAA;8BAD5C,yCAAU,gCAAmB,mBAAmB,CAAC;;;;oBACI;wDAAA,YAAa;;;;;;AAAnE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA6D;AAE7D,YAAM,OAAO;AAEb,WAAK,QAAQ,QAAQ;IACtB;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,QAAQ,IAAI,QAAQ,CAAC;AAE3B,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,KAAK,CAAC;AACtC,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,OAAO,KAAK,MAAK;;IAE9B;;;;IAKY,iCAA6B,MAAA;8BAFzC,yCAAU,gCAAmB,gBAAgB,OAC7C,kDAAmB,gCAAgC,CAAC;;;;oBACF;qDAAA,YAAa;;;;;;AAAhE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
4
|
+
"sourcesContent": ["import type {\n\tEndpointId,\n\tMaybeNotKnown,\n\tMessageRecord,\n\tSupervisionResult,\n\tWithAddress,\n} from \"@zwave-js/core/safe\";\nimport {\n\tCommandClasses,\n\tMAX_NODES,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type AssociationAddress, AssociationCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const AssociationCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses.Association, {\n\t\t/** Whether the node has a lifeline association */\n\t\t...V.staticProperty(\"hasLifeline\", undefined, { internal: true }),\n\t\t/** How many association groups the node has */\n\t\t...V.staticProperty(\"groupCount\", undefined, { internal: true }),\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses.Association, {\n\t\t/** The maximum number of nodes in an association group */\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"maxNodes\",\n\t\t\t\"maxNodes\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"maxNodes\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t/** The node IDs currently belonging to an association group */\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"nodeIds\",\n\t\t\t\"nodeIds\",\n\t\t\t(groupId: number) => groupId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"nodeIds\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t}),\n});\n\n// @noSetValueAPI\n\n@API(CommandClasses.Association)\nexport class AssociationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AssociationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationCommand.Get:\n\t\t\tcase AssociationCommand.Set:\n\t\t\tcase AssociationCommand.Report:\n\t\t\tcase AssociationCommand.Remove:\n\t\t\tcase AssociationCommand.SupportedGroupingsGet:\n\t\t\tcase AssociationCommand.SupportedGroupingsReport:\n\t\t\t\treturn true;\n\t\t\tcase AssociationCommand.SpecificGroupGet:\n\t\t\tcase AssociationCommand.SpecificGroupReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Returns the number of association groups a node supports.\n\t * Association groups are consecutive, starting at 1.\n\t */\n\tpublic async getGroupCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationCCSupportedGroupingsReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.groupCount;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupCount(groupCount: number): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SupportedGroupingsReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSupportedGroupingsReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupCount,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Returns information about an association group.\n\t */\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getGroup(groupId: number) {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);\n\n\t\tconst cc = new AssociationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AssociationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\tmaxNodes: response.maxNodes,\n\t\t\t\tnodeIds: response.nodeIds,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: AssociationCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Report,\n\t\t);\n\n\t\tconst cc = new AssociationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Adds new nodes to an association group\n\t */\n\t@validateArgs()\n\tpublic async addNodeIds(\n\t\tgroupId: number,\n\t\t...nodeIds: number[]\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);\n\n\t\tconst cc = new AssociationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from an association group\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIds(\n\t\toptions: AssociationCCRemoveOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\t// Validate options\n\t\tif (!options.groupId) {\n\t\t\tif (this.version === 1) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (options.groupId < 0) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new AssociationCCRemove({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Removes nodes from all association groups\n\t */\n\t@validateArgs()\n\tpublic async removeNodeIdsFromAllGroups(\n\t\tnodeIds: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.Remove,\n\t\t);\n\n\t\tif (this.version >= 2) {\n\t\t\t// The node supports bulk removal\n\t\t\treturn this.removeNodeIds({ nodeIds, groupId: 0 });\n\t\t} else {\n\t\t\t// We have to remove the node manually from all groups\n\t\t\tconst groupCount = this.tryGetValueDB()?.getValue<number>(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(\n\t\t\t\t\tthis.endpoint.index,\n\t\t\t\t),\n\t\t\t) ?? 0;\n\t\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\t\t// TODO: evaluate intermediate supervision results\n\t\t\t\tawait this.removeNodeIds({ nodeIds, groupId });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Request the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async getSpecificGroup(): Promise<number | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupGet,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationCCSpecificGroupReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.group;\n\t}\n\n\t/**\n\t * Report the association group that represents the most recently detected button press\n\t */\n\t@validateArgs()\n\tpublic async reportSpecificGroup(\n\t\tgroup: number,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationCommand,\n\t\t\tAssociationCommand.SpecificGroupReport,\n\t\t);\n\n\t\tconst cc = new AssociationCCSpecificGroupReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroup,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Association)\n@implementedVersion(4)\n@ccValues(AssociationCCValues)\nexport class AssociationCC extends CommandClass {\n\tdeclare ccCommand: AssociationCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses[\"Z-Wave Plus Info\"],\n\t\t\t// We need information about endpoints to correctly configure the lifeline associations\n\t\t\tCommandClasses[\"Multi Channel\"],\n\t\t];\n\t}\n\n\t/**\n\t * Returns the number of association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationCCValues.groupCount.endpoint(endpoint.index),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of nodes an association group supports.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getMaxNodesCached(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): number {\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tAssociationCCValues.maxNodes(groupId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t// If the information is not available, fall back to the configuration file if possible\n\t\t\t\t// This can happen on some legacy devices which have \"hidden\" association groups\n\t\t\t\t?? ctx\n\t\t\t\t\t.getDeviceConfig?.(endpoint.nodeId)\n\t\t\t\t\t?.getAssociationConfigForEndpoint(endpoint.index, groupId)\n\t\t\t\t\t?.maxNodes\n\t\t\t\t?? 0\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the destinations of all association groups reported by the node/endpoint.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getAllDestinationsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): ReadonlyMap<number, readonly AssociationAddress[]> {\n\t\tconst ret = new Map<number, AssociationAddress[]>();\n\t\tconst groupCount = this.getGroupCountCached(ctx, endpoint);\n\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\t\tfor (let i = 1; i <= groupCount; i++) {\n\t\t\t// Add all root destinations\n\t\t\tconst nodes = valueDB.getValue<number[]>(\n\t\t\t\tAssociationCCValues.nodeIds(i).endpoint(endpoint.index),\n\t\t\t) ?? [];\n\n\t\t\tret.set(\n\t\t\t\ti,\n\t\t\t\t// Filter out duplicates\n\t\t\t\tdistinct(nodes).map((nodeId) => ({ nodeId })),\n\t\t\t);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Even if Multi Channel Association is supported, we still need to query the number of\n\t\t// normal association groups since some devices report more association groups than\n\t\t// multi channel association groups\n\n\t\t// Find out how many groups are supported\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying number of association groups...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst groupCount = await api.getGroupCount();\n\t\tif (groupCount != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `supports ${groupCount} association groups`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying association groups timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query each association group for its members\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Skip the remaining Association CC interview in favor of Multi Channel Association if possible\n\t\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// And set up lifeline associations\n\t\tawait ccUtils.configureLifelineAssociations(ctx, endpoint);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst groupCount = AssociationCC.getGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\n\t\t// Query each association group\n\t\tfor (let groupId = 1; groupId <= groupCount; groupId++) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying association group #${groupId}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst group = await api.getGroup(groupId);\n\t\t\tif (group != undefined) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received information for association group #${groupId}:\nmaximum # of nodes: ${group.maxNodes}\ncurrently assigned nodes: ${group.nodeIds.map(String).join(\", \")}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCSetOptions {\n\tgroupId: number;\n\tnodeIds: number[];\n}\n\n@CCCommand(AssociationCommand.Set)\n@useSupervision()\nexport class AssociationCCSet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tif (options.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`All node IDs must be between 1 and ${MAX_NODES}!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\tpublic nodeIds: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId, ...this.nodeIds]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\n\t\t};\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCRemoveOptions {\n\t/** The group from which to remove the nodes. If none is specified, the nodes will be removed from all nodes. */\n\tgroupId?: number;\n\t/** The nodes to remove. If none are specified, ALL nodes will be removed. */\n\tnodeIds?: number[];\n}\n\n@CCCommand(AssociationCommand.Remove)\n@useSupervision()\nexport class AssociationCCRemove extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCRemoveOptions>,\n\t) {\n\t\tsuper(options);\n\t\t// When removing associations, we allow invalid node IDs.\n\t\t// See GH#3606 - it is possible that those exist.\n\t\tthis.groupId = options.groupId;\n\t\tthis.nodeIds = options.nodeIds;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCRemove {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tlet groupId: number | undefined;\n\t\tif (raw.payload[0] !== 0) {\n\t\t\tgroupId = raw.payload[0];\n\t\t}\n\t\tconst nodeIds = [...raw.payload.subarray(1)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId?: number;\n\tpublic nodeIds?: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId || 0,\n\t\t\t...(this.nodeIds || []),\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"group id\": this.groupId || \"all groups\",\n\t\t\t\"node ids\": this.nodeIds && this.nodeIds.length\n\t\t\t\t? this.nodeIds.join(\", \")\n\t\t\t\t: \"all nodes\",\n\t\t};\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCReportOptions {\n\tgroupId: number;\n\tmaxNodes: number;\n\tnodeIds: number[];\n\treportsToFollow: number;\n}\n\n@CCCommand(AssociationCommand.Report)\n@ccValueProperty(\n\t\"maxNodes\",\n\tAssociationCCValues.maxNodes,\n\t(self) => [self.groupId],\n)\n@ccValueProperty(\n\t\"nodeIds\",\n\tAssociationCCValues.nodeIds,\n\t(self) => [self.groupId],\n)\nexport class AssociationCCReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.maxNodes = options.maxNodes;\n\t\tthis.nodeIds = options.nodeIds;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst groupId = raw.payload[0];\n\t\tconst maxNodes = raw.payload[1];\n\t\tconst reportsToFollow = raw.payload[2];\n\t\tconst nodeIds = [...raw.payload.subarray(3)];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tmaxNodes,\n\t\t\treportsToFollow,\n\t\t\tnodeIds,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic maxNodes: number;\n\n\tpublic nodeIds: number[];\n\n\tpublic reportsToFollow: number;\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the association group ID\n\t\treturn { groupId: this.groupId };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\t/** @deprecated Use {@link mergePartialCCsAsync} instead */\n\tpublic mergePartialCCs(\n\t\tpartials: AssociationCCReport[],\n\t\t_ctx: CCParsingContext,\n\t): void {\n\t\t// Concat the list of nodes\n\t\tthis.nodeIds = [...partials, this]\n\t\t\t.map((report) => report.nodeIds)\n\t\t\t.reduce((prev, cur) => prev.concat(...cur), []);\n\t}\n\n\tpublic mergePartialCCsAsync(\n\t\tpartials: AssociationCCReport[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the list of nodes\n\t\tthis.nodeIds = [...partials, this]\n\t\t\t.map((report) => report.nodeIds)\n\t\t\t.reduce((prev, cur) => prev.concat(...cur), []);\n\t\treturn Promise.resolve();\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.groupId,\n\t\t\tthis.maxNodes,\n\t\t\tthis.reportsToFollow,\n\t\t\t...this.nodeIds,\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"max # of nodes\": this.maxNodes,\n\t\t\t\t\"node IDs\": this.nodeIds.join(\", \"),\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationCommand.Get)\n@expectedCCResponse(AssociationCCReport)\nexport class AssociationCCGet extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (options.groupId < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The group id must be positive!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AssociationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationCCSupportedGroupingsReportOptions {\n\tgroupCount: number;\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsReport)\n@ccValueProperty(\"groupCount\", AssociationCCValues.groupCount)\nexport class AssociationCCSupportedGroupingsReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSupportedGroupingsReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupCount = options.groupCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSupportedGroupingsReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupCount = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupCount,\n\t\t});\n\t}\n\n\tpublic groupCount: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupCount]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group count\": this.groupCount },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SupportedGroupingsGet)\n@expectedCCResponse(AssociationCCSupportedGroupingsReport)\nexport class AssociationCCSupportedGroupingsGet extends AssociationCC {}\n\n// @publicAPI\nexport interface AssociationCCSpecificGroupReportOptions {\n\tgroup: number;\n}\n\n@CCCommand(AssociationCommand.SpecificGroupReport)\nexport class AssociationCCSpecificGroupReport extends AssociationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationCCSpecificGroupReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.group = options.group;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationCCSpecificGroupReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst group = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroup,\n\t\t});\n\t}\n\n\tpublic group: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.group]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { group: this.group },\n\t\t};\n\t}\n}\n\n@CCCommand(AssociationCommand.SpecificGroupGet)\n@expectedCCResponse(AssociationCCSpecificGroupReport)\nexport class AssociationCCSpecificGroupGet extends AssociationCC {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,kBAQO;AAOP,IAAAA,eAAsB;AAEtB,oBAAyB;AACzB,iBAAqC;AACrC,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAA4D;AAC5D,cAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElB,MAAM,sBAAsB,OAAO,OAAO;EAChD,GAAG,gBAAE,qBAAqB,2BAAe,aAAa;;IAErD,GAAG,gBAAE,eAAe,eAAe,QAAW,EAAE,UAAU,KAAI,CAAE;;IAEhE,GAAG,gBAAE,eAAe,cAAc,QAAW,EAAE,UAAU,KAAI,CAAE;GAC/D;EAED,GAAG,gBAAE,sBAAsB,2BAAe,aAAa;;IAEtD,GAAG,gBAAE,8BACJ,YACA,YACA,CAAC,YAAoB,SACrB,CAAC,EAAE,UAAU,YAAW,MACvB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zC,yCAAU,gCAAmB,gBAAgB,OAC7C,kDAAmB,gCAAgC,CAAC;;;;oBACF;qDAAA,YAAa;;;;;;AAAhE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": ["import_safe", "AssociationCC"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/AssociationGroupInfoCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupportsCC,\n\ttype WithAddress,\n\tencodeCCId,\n\tgetCCName,\n\tparseCCId,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { cpp2js, getEnumMemberName, num2hex } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tAssociationGroupInfoCommand,\n\tAssociationGroupInfoProfile,\n} from \"../lib/_Types.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\nimport { MultiChannelAssociationCC } from \"./MultiChannelAssociationCC.js\";\n\nexport const AssociationGroupInfoCCValues = Object.freeze({\n\t// Defines values that do not depend on anything else\n\t...V.defineStaticCCValues(CommandClasses[\"Association Group Information\"], {\n\t\t...V.staticProperty(\"hasDynamicInfo\", undefined, { internal: true }),\n\t}),\n\n\t// Defines values that depend on one or more arguments and need to be called as a function\n\t...V.defineDynamicCCValues(\n\t\tCommandClasses[\"Association Group Information\"],\n\t\t{\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"groupName\",\n\t\t\t\t\"name\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"name\" && typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"groupInfo\",\n\t\t\t\t\"info\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"info\" && typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"commands\",\n\t\t\t\t\"issuedCommands\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"issuedCommands\"\n\t\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t},\n\t),\n});\n\n// @noSetValueAPI This CC only has get-type commands\n\n@API(CommandClasses[\"Association Group Information\"])\nexport class AssociationGroupInfoCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: AssociationGroupInfoCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationGroupInfoCommand.NameGet:\n\t\t\tcase AssociationGroupInfoCommand.NameReport:\n\t\t\tcase AssociationGroupInfoCommand.InfoGet:\n\t\t\tcase AssociationGroupInfoCommand.InfoReport:\n\t\t\tcase AssociationGroupInfoCommand.CommandListGet:\n\t\t\tcase AssociationGroupInfoCommand.CommandListReport:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t@validateArgs()\n\tpublic async getGroupName(groupId: number): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.name;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupName(groupId: number, name: string): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.NameReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCNameReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tname,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getGroupInfo(groupId: number, refreshCache: boolean = false) {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.InfoGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCInfoGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\trefreshCache,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCInfoReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\t// SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.\n\t\t// But that's not always the case. Apparently some endpoints return 0 groups\n\t\t// although they support AGI CC\n\t\tif (response && response.groups.length > 0) {\n\t\t\tconst { groupId: _, ...info } = response.groups[0];\n\t\t\treturn {\n\t\t\t\thasDynamicInfo: response.hasDynamicInfo,\n\t\t\t\t...info,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupInfo(\n\t\toptions: AssociationGroupInfoCCInfoReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.InfoReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCInfoReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async getCommands(\n\t\tgroupId: number,\n\t\tallowCache: boolean = true,\n\t): Promise<\n\t\tMaybeNotKnown<AssociationGroupInfoCCCommandListReport[\"commands\"]>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.CommandListGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCCommandListGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tallowCache,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCCommandListReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.commands;\n\t}\n\n\t@validateArgs()\n\tpublic async reportCommands(\n\t\tgroupId: number,\n\t\tcommands: ReadonlyMap<CommandClasses, readonly number[]>,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.CommandListReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCCommandListReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tcommands,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Association Group Information\"])\n@implementedVersion(3)\n@ccValues(AssociationGroupInfoCCValues)\nexport class AssociationGroupInfoCC extends CommandClass {\n\tdeclare ccCommand: AssociationGroupInfoCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t];\n\t}\n\n\t/** Returns the name of an association group */\n\tpublic static getGroupNameCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<string> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationGroupInfoCCValues.groupName(groupId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\t/** Returns the association profile for an association group */\n\tpublic static getGroupProfileCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<AssociationGroupInfoProfile> {\n\t\treturn ctx.getValueDB(endpoint.nodeId).getValue<{\n\t\t\tprofile: AssociationGroupInfoProfile;\n\t\t}>(\n\t\t\tAssociationGroupInfoCCValues.groupInfo(groupId).endpoint(\n\t\t\t\tendpoint.index,\n\t\t\t),\n\t\t)\n\t\t\t?.profile;\n\t}\n\n\t/** Returns the dictionary of all commands issued by the given association group */\n\tpublic static getIssuedCommandsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<ReadonlyMap<CommandClasses, readonly number[]>> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationGroupInfoCCValues.commands(groupId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tpublic static findGroupsForIssuedCommand(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId & SupportsCC,\n\t\tccId: CommandClasses,\n\t\tcommand: number,\n\t): number[] {\n\t\tconst ret: number[] = [];\n\t\tconst associationGroupCount = this.getAssociationGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// Scan the issued commands of all groups if there's a match\n\t\t\tconst issuedCommands = this.getIssuedCommandsCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tgroupId,\n\t\t\t);\n\t\t\tif (!issuedCommands) continue;\n\t\t\tif (\n\t\t\t\tissuedCommands.has(ccId)\n\t\t\t\t&& issuedCommands.get(ccId)!.includes(command)\n\t\t\t) {\n\t\t\t\tret.push(groupId);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate static getAssociationGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId & SupportsCC,\n\t): number {\n\t\t// The association group count is either determined by the\n\t\t// Association CC or the Multi Channel Association CC\n\n\t\treturn (\n\t\t\t// First query the Multi Channel Association CC\n\t\t\t// And fall back to 0\n\t\t\t(endpoint.supportsCC(\n\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t)\n\t\t\t\t&& MultiChannelAssociationCC.getGroupCountCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t))\n\t\t\t// Then the Association CC\n\t\t\t|| (endpoint.supportsCC(CommandClasses.Association)\n\t\t\t\t&& AssociationCC.getGroupCountCached(ctx, endpoint))\n\t\t\t|| 0\n\t\t);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst associationGroupCount = AssociationGroupInfoCC\n\t\t\t.getAssociationGroupCountCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// First get the group's name\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Association group #${groupId}: Querying name...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst name = await api.getGroupName(groupId);\n\t\t\tif (name) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`Association group #${groupId} has name \"${name}\"`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Then the command list\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`Association group #${groupId}: Querying command list...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getCommands(groupId);\n\t\t\t// Not sure how to log this\n\t\t}\n\n\t\t// Finally query each group for its information\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\t// Query the information for each group (this is the only thing that could be dynamic)\n\t\tconst associationGroupCount = AssociationGroupInfoCC\n\t\t\t.getAssociationGroupCountCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\t\tconst hasDynamicInfo = this.getValue<boolean>(\n\t\t\tctx,\n\t\t\tAssociationGroupInfoCCValues.hasDynamicInfo,\n\t\t);\n\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// Then its information\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Association group #${groupId}: Querying info...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst info = await api.getGroupInfo(groupId, !!hasDynamicInfo);\n\t\t\tif (info) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`Received info for association group #${groupId}:\ninfo is dynamic: ${info.hasDynamicInfo}\nprofile: ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tAssociationGroupInfoProfile,\n\t\t\t\t\t\t\tinfo.profile,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCNameReportOptions {\n\tgroupId: number;\n\tname: string;\n}\n\n@CCCommand(AssociationGroupInfoCommand.NameReport)\nexport class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nameLength = raw.payload[1];\n\t\tvalidatePayload(raw.payload.length >= 2 + nameLength);\n\t\t// The specs don't allow 0-terminated string, but some devices use them\n\t\t// So we need to cut them off\n\t\tconst name = cpp2js(\n\t\t\traw.payload.subarray(2, 2 + nameLength).toString(\"utf8\"),\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\tpublic readonly name: string;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tvalueDB.setValue(\n\t\t\tAssociationGroupInfoCCValues.groupName(this.groupId).endpoint(\n\t\t\t\tthis.endpointIndex,\n\t\t\t),\n\t\t\tthis.name,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.groupId, this.name.length]),\n\t\t\tBytes.from(this.name, \"utf8\"),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\tname: this.name,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCNameGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationGroupInfoCommand.NameGet)\n@expectedCCResponse(AssociationGroupInfoCCNameReport)\nexport class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCNameGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCNameGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n\nexport interface AssociationGroupInfo {\n\tgroupId: number;\n\tmode: number;\n\tprofile: number;\n\teventCode: number;\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCInfoReportOptions {\n\tisListMode: boolean;\n\thasDynamicInfo: boolean;\n\tgroups: AssociationGroupInfo[];\n}\n\n@CCCommand(AssociationGroupInfoCommand.InfoReport)\n@ccValueProperty(\"hasDynamicInfo\", AssociationGroupInfoCCValues.hasDynamicInfo)\nexport class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.isListMode = options.isListMode;\n\t\tthis.hasDynamicInfo = options.hasDynamicInfo;\n\t\tthis.groups = options.groups;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst isListMode = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);\n\t\tconst groupCount = raw.payload[0] & 0b0011_1111;\n\t\t// each group requires 7 bytes of payload\n\t\tvalidatePayload(raw.payload.length >= 1 + groupCount * 7);\n\t\tconst groups: AssociationGroupInfo[] = [];\n\t\tfor (let i = 0; i < groupCount; i++) {\n\t\t\tconst offset = 1 + i * 7;\n\t\t\t// Parse the payload\n\t\t\tconst groupBytes = raw.payload.subarray(offset, offset + 7);\n\t\t\tconst groupId = groupBytes[0];\n\t\t\tconst mode = 0; // groupBytes[1];\n\t\t\tconst profile = groupBytes.readUInt16BE(2);\n\t\t\tconst eventCode = 0; // groupBytes.readUInt16BE(5);\n\t\t\tgroups.push({ groupId, mode, profile, eventCode });\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tisListMode,\n\t\t\thasDynamicInfo,\n\t\t\tgroups,\n\t\t});\n\t}\n\n\tpublic readonly isListMode: boolean;\n\n\tpublic readonly hasDynamicInfo: boolean;\n\n\tpublic readonly groups: readonly AssociationGroupInfo[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tfor (const group of this.groups) {\n\t\t\tconst { groupId, mode, profile, eventCode } = group;\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tAssociationGroupInfoCCValues.groupInfo(groupId),\n\t\t\t\t{\n\t\t\t\t\tmode,\n\t\t\t\t\tprofile,\n\t\t\t\t\teventCode,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.alloc(1 + this.groups.length * 7, 0);\n\n\t\tthis.payload[0] = (this.isListMode ? 0b1000_0000 : 0)\n\t\t\t| (this.hasDynamicInfo ? 0b0100_0000 : 0)\n\t\t\t| (this.groups.length & 0b0011_1111);\n\n\t\tfor (let i = 0; i < this.groups.length; i++) {\n\t\t\tconst offset = 1 + i * 7;\n\t\t\tthis.payload[offset] = this.groups[i].groupId;\n\t\t\tthis.payload.writeUInt16BE(this.groups[i].profile, offset + 2);\n\t\t\t// The remaining bytes are zero\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"is list mode\": this.isListMode,\n\t\t\t\t\"has dynamic info\": this.hasDynamicInfo,\n\t\t\t\tgroups: `${\n\t\t\t\t\tthis.groups\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(g) => `\n\u00B7 Group #${g.groupId}\n mode: ${g.mode}\n profile: ${g.profile}\n event code: ${g.eventCode}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type AssociationGroupInfoCCInfoGetOptions =\n\t& {\n\t\trefreshCache: boolean;\n\t}\n\t& (\n\t\t| {\n\t\t\tlistMode: boolean;\n\t\t}\n\t\t| {\n\t\t\tgroupId: number;\n\t\t}\n\t);\n\n@CCCommand(AssociationGroupInfoCommand.InfoGet)\n@expectedCCResponse(AssociationGroupInfoCCInfoReport)\nexport class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCInfoGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.refreshCache = options.refreshCache;\n\t\tif (\"listMode\" in options) this.listMode = options.listMode;\n\t\tif (\"groupId\" in options) this.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCInfoGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst optionByte = raw.payload[0];\n\t\tconst refreshCache = !!(optionByte & 0b1000_0000);\n\t\tconst listMode: boolean | undefined = !!(optionByte & 0b0100_0000);\n\t\tlet groupId: number | undefined;\n\n\t\tif (!listMode) {\n\t\t\tgroupId = raw.payload[1];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trefreshCache,\n\t\t\tlistMode,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic refreshCache: boolean;\n\tpublic listMode?: boolean;\n\tpublic groupId?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tconst isListMode = this.listMode === true;\n\t\tconst optionByte = (this.refreshCache ? 0b1000_0000 : 0)\n\t\t\t| (isListMode ? 0b0100_0000 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\toptionByte,\n\t\t\tisListMode ? 0 : this.groupId!,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.groupId != undefined) {\n\t\t\tmessage[\"group id\"] = this.groupId;\n\t\t}\n\t\tif (this.listMode != undefined) {\n\t\t\tmessage[\"list mode\"] = this.listMode;\n\t\t}\n\t\tmessage[\"refresh cache\"] = this.refreshCache;\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCCommandListReportOptions {\n\tgroupId: number;\n\tcommands: ReadonlyMap<CommandClasses, readonly number[]>;\n}\n\n@CCCommand(AssociationGroupInfoCommand.CommandListReport)\n@ccValueProperty(\n\t\"commands\",\n\tAssociationGroupInfoCCValues.commands,\n\t(self) => [self.groupId],\n)\nexport class AssociationGroupInfoCCCommandListReport\n\textends AssociationGroupInfoCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCCommandListReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.commands = options.commands;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCCommandListReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst listLength = raw.payload[1];\n\t\tvalidatePayload(raw.payload.length >= 2 + listLength);\n\t\tconst listBytes = raw.payload.subarray(2, 2 + listLength);\n\t\t// Parse all CC ids and commands\n\t\tlet offset = 0;\n\t\tconst commands = new Map<CommandClasses, number[]>();\n\t\twhile (offset < listLength) {\n\t\t\tconst { ccId, bytesRead } = parseCCId(listBytes, offset);\n\t\t\tconst command = listBytes[offset + bytesRead];\n\t\t\tif (!commands.has(ccId)) commands.set(ccId, []);\n\t\t\tcommands.get(ccId)!.push(command);\n\t\t\toffset += bytesRead + 1;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tcommands,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\n\tpublic readonly commands: ReadonlyMap<CommandClasses, readonly number[]>;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\t// To make it easier to encode possible extended CCs, we first\n\t\t// allocate as much space as we may need, then trim it again\n\t\tthis.payload = new Bytes(2 + this.commands.size * 3);\n\t\tthis.payload[0] = this.groupId;\n\t\tlet offset = 2;\n\t\tfor (const [ccId, commands] of this.commands) {\n\t\t\tfor (const command of commands) {\n\t\t\t\toffset += encodeCCId(ccId, this.payload, offset);\n\t\t\t\tthis.payload[offset] = command;\n\t\t\t\toffset++;\n\t\t\t}\n\t\t}\n\t\tthis.payload[1] = offset - 2; // list length\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\tcommands: `${\n\t\t\t\t\t[...this.commands]\n\t\t\t\t\t\t.map(([cc, cmds]) => {\n\t\t\t\t\t\t\treturn `\\n\u00B7 ${getCCName(cc)}: ${\n\t\t\t\t\t\t\t\tcmds\n\t\t\t\t\t\t\t\t\t.map((cmd) => num2hex(cmd))\n\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCCommandListGetOptions {\n\tallowCache: boolean;\n\tgroupId: number;\n}\n\n@CCCommand(AssociationGroupInfoCommand.CommandListGet)\n@expectedCCResponse(AssociationGroupInfoCCCommandListReport)\nexport class AssociationGroupInfoCCCommandListGet\n\textends AssociationGroupInfoCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCCommandListGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.allowCache = options.allowCache;\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCCommandListGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst allowCache = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst groupId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tallowCache,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic allowCache: boolean;\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.allowCache ? 0b1000_0000 : 0,\n\t\t\tthis.groupId,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"allow cache\": this.allowCache,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAaO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAAmD;AAEnD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAGO;AACP,2BAA8B;AAC9B,uCAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnC,MAAM,+BAA+B,OAAO,OAAO;;EAEzD,GAAG,gBAAE,qBAAqB,2BAAe,+BAA+B,GAAG;IAC1E,GAAG,gBAAE,eAAe,kBAAkB,QAAW,EAAE,UAAU,KAAI,CAAE;GACnE;;EAGD,GAAG,gBAAE,sBACJ,2BAAe,+BAA+B,GAC9C;IACC,GAAG,gBAAE,8BACJ,aACA,QACA,CAAC,YAAoB,SACrB,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,UAAU,OAAO,gBAAgB,UAC/C,QACA,EAAE,UAAU,KAAI,CAAE;IAEnB,GAAG,gBAAE,8BACJ,aACA,QACA,CAAC,YAAoB,SACrB,CAAC,E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AC;;;;oBAEnD;4DAAA,YAAsB;;;;;;AAD/B,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IAGZ,YACC,SAAiE;AAEjE,YAAM,OAAO;AACb,WAAK,aAAa,QAAQ;AAC1B,WAAK,UAAU,QAAQ;IACxB;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,aAAa,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI;AACvC,YAAM,UAAU,IAAI,QAAQ,CAAC;AAE7B,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;QACA;OACA;IACF;IAEO;IACA;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK;QACzB,KAAK,aAAa,MAAc;QAChC,KAAK;OACL;AACD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,YAAY,KAAK;UACjB,eAAe,KAAK;;;IAGvB;;;;",
|
|
4
|
+
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupportsCC,\n\ttype WithAddress,\n\tencodeCCId,\n\tgetCCName,\n\tparseCCId,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { cpp2js, getEnumMemberName, num2hex } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tAssociationGroupInfoCommand,\n\tAssociationGroupInfoProfile,\n} from \"../lib/_Types.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\nimport { MultiChannelAssociationCC } from \"./MultiChannelAssociationCC.js\";\n\nexport const AssociationGroupInfoCCValues = Object.freeze({\n\t// Defines values that do not depend on anything else\n\t...V.defineStaticCCValues(CommandClasses[\"Association Group Information\"], {\n\t\t...V.staticProperty(\"hasDynamicInfo\", undefined, { internal: true }),\n\t}),\n\n\t// Defines values that depend on one or more arguments and need to be called as a function\n\t...V.defineDynamicCCValues(\n\t\tCommandClasses[\"Association Group Information\"],\n\t\t{\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"groupName\",\n\t\t\t\t\"name\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"name\" && typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"groupInfo\",\n\t\t\t\t\"info\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"info\" && typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\t\"commands\",\n\t\t\t\t\"issuedCommands\",\n\t\t\t\t(groupId: number) => groupId,\n\t\t\t\t({ property, propertyKey }) =>\n\t\t\t\t\tproperty === \"issuedCommands\"\n\t\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t\tundefined,\n\t\t\t\t{ internal: true },\n\t\t\t),\n\t\t},\n\t),\n});\n\n// @noSetValueAPI This CC only has get-type commands\n\n@API(CommandClasses[\"Association Group Information\"])\nexport class AssociationGroupInfoCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: AssociationGroupInfoCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AssociationGroupInfoCommand.NameGet:\n\t\t\tcase AssociationGroupInfoCommand.NameReport:\n\t\t\tcase AssociationGroupInfoCommand.InfoGet:\n\t\t\tcase AssociationGroupInfoCommand.InfoReport:\n\t\t\tcase AssociationGroupInfoCommand.CommandListGet:\n\t\t\tcase AssociationGroupInfoCommand.CommandListReport:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t@validateArgs()\n\tpublic async getGroupName(groupId: number): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.name;\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupName(groupId: number, name: string): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.NameReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCNameReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tname,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getGroupInfo(groupId: number, refreshCache: boolean = false) {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.InfoGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCInfoGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\trefreshCache,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCInfoReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\t// SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.\n\t\t// But that's not always the case. Apparently some endpoints return 0 groups\n\t\t// although they support AGI CC\n\t\tif (response && response.groups.length > 0) {\n\t\t\tconst { groupId: _, ...info } = response.groups[0];\n\t\t\treturn {\n\t\t\t\thasDynamicInfo: response.hasDynamicInfo,\n\t\t\t\t...info,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async reportGroupInfo(\n\t\toptions: AssociationGroupInfoCCInfoReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.InfoReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCInfoReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async getCommands(\n\t\tgroupId: number,\n\t\tallowCache: boolean = true,\n\t): Promise<\n\t\tMaybeNotKnown<AssociationGroupInfoCCCommandListReport[\"commands\"]>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.CommandListGet,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCCommandListGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tallowCache,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAssociationGroupInfoCCCommandListReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.commands;\n\t}\n\n\t@validateArgs()\n\tpublic async reportCommands(\n\t\tgroupId: number,\n\t\tcommands: ReadonlyMap<CommandClasses, readonly number[]>,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tAssociationGroupInfoCommand,\n\t\t\tAssociationGroupInfoCommand.CommandListReport,\n\t\t);\n\n\t\tconst cc = new AssociationGroupInfoCCCommandListReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tgroupId,\n\t\t\tcommands,\n\t\t});\n\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Association Group Information\"])\n@implementedVersion(3)\n@ccValues(AssociationGroupInfoCCValues)\nexport class AssociationGroupInfoCC extends CommandClass {\n\tdeclare ccCommand: AssociationGroupInfoCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// AssociationCC must be interviewed after Z-Wave+ if that is supported\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t];\n\t}\n\n\t/** Returns the name of an association group */\n\tpublic static getGroupNameCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<string> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationGroupInfoCCValues.groupName(groupId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\t/** Returns the association profile for an association group */\n\tpublic static getGroupProfileCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<AssociationGroupInfoProfile> {\n\t\treturn ctx.getValueDB(endpoint.nodeId).getValue<{\n\t\t\tprofile: AssociationGroupInfoProfile;\n\t\t}>(\n\t\t\tAssociationGroupInfoCCValues.groupInfo(groupId).endpoint(\n\t\t\t\tendpoint.index,\n\t\t\t),\n\t\t)\n\t\t\t?.profile;\n\t}\n\n\t/** Returns the dictionary of all commands issued by the given association group */\n\tpublic static getIssuedCommandsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tgroupId: number,\n\t): MaybeNotKnown<ReadonlyMap<CommandClasses, readonly number[]>> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAssociationGroupInfoCCValues.commands(groupId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tpublic static findGroupsForIssuedCommand(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId & SupportsCC,\n\t\tccId: CommandClasses,\n\t\tcommand: number,\n\t): number[] {\n\t\tconst ret: number[] = [];\n\t\tconst associationGroupCount = this.getAssociationGroupCountCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// Scan the issued commands of all groups if there's a match\n\t\t\tconst issuedCommands = this.getIssuedCommandsCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tgroupId,\n\t\t\t);\n\t\t\tif (!issuedCommands) continue;\n\t\t\tif (\n\t\t\t\tissuedCommands.has(ccId)\n\t\t\t\t&& issuedCommands.get(ccId)!.includes(command)\n\t\t\t) {\n\t\t\t\tret.push(groupId);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate static getAssociationGroupCountCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId & SupportsCC,\n\t): number {\n\t\t// The association group count is either determined by the\n\t\t// Association CC or the Multi Channel Association CC\n\n\t\treturn (\n\t\t\t// First query the Multi Channel Association CC\n\t\t\t// And fall back to 0\n\t\t\t(endpoint.supportsCC(\n\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t)\n\t\t\t\t&& MultiChannelAssociationCC.getGroupCountCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t))\n\t\t\t// Then the Association CC\n\t\t\t|| (endpoint.supportsCC(CommandClasses.Association)\n\t\t\t\t&& AssociationCC.getGroupCountCached(ctx, endpoint))\n\t\t\t|| 0\n\t\t);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst associationGroupCount = AssociationGroupInfoCC\n\t\t\t.getAssociationGroupCountCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// First get the group's name\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Association group #${groupId}: Querying name...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst name = await api.getGroupName(groupId);\n\t\t\tif (name) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`Association group #${groupId} has name \"${name}\"`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Then the command list\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`Association group #${groupId}: Querying command list...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getCommands(groupId);\n\t\t\t// Not sure how to log this\n\t\t}\n\n\t\t// Finally query each group for its information\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\t// Query the information for each group (this is the only thing that could be dynamic)\n\t\tconst associationGroupCount = AssociationGroupInfoCC\n\t\t\t.getAssociationGroupCountCached(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\t\tconst hasDynamicInfo = this.getValue<boolean>(\n\t\t\tctx,\n\t\t\tAssociationGroupInfoCCValues.hasDynamicInfo,\n\t\t);\n\n\t\tfor (let groupId = 1; groupId <= associationGroupCount; groupId++) {\n\t\t\t// Then its information\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Association group #${groupId}: Querying info...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst info = await api.getGroupInfo(groupId, !!hasDynamicInfo);\n\t\t\tif (info) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`Received info for association group #${groupId}:\ninfo is dynamic: ${info.hasDynamicInfo}\nprofile: ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tAssociationGroupInfoProfile,\n\t\t\t\t\t\t\tinfo.profile,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCNameReportOptions {\n\tgroupId: number;\n\tname: string;\n}\n\n@CCCommand(AssociationGroupInfoCommand.NameReport)\nexport class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst nameLength = raw.payload[1];\n\t\tvalidatePayload(raw.payload.length >= 2 + nameLength);\n\t\t// The specs don't allow 0-terminated string, but some devices use them\n\t\t// So we need to cut them off\n\t\tconst name = cpp2js(\n\t\t\traw.payload.subarray(2, 2 + nameLength).toString(\"utf8\"),\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\tpublic readonly name: string;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tvalueDB.setValue(\n\t\t\tAssociationGroupInfoCCValues.groupName(this.groupId).endpoint(\n\t\t\t\tthis.endpointIndex,\n\t\t\t),\n\t\t\tthis.name,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.groupId, this.name.length]),\n\t\t\tBytes.from(this.name, \"utf8\"),\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\tname: this.name,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCNameGetOptions {\n\tgroupId: number;\n}\n\n@CCCommand(AssociationGroupInfoCommand.NameGet)\n@expectedCCResponse(AssociationGroupInfoCCNameReport)\nexport class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCNameGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCNameGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst groupId = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.groupId]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"group id\": this.groupId },\n\t\t};\n\t}\n}\n\nexport interface AssociationGroupInfo {\n\tgroupId: number;\n\tmode: number;\n\tprofile: number;\n\teventCode: number;\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCInfoReportOptions {\n\tisListMode: boolean;\n\thasDynamicInfo: boolean;\n\tgroups: AssociationGroupInfo[];\n}\n\n@CCCommand(AssociationGroupInfoCommand.InfoReport)\n@ccValueProperty(\"hasDynamicInfo\", AssociationGroupInfoCCValues.hasDynamicInfo)\nexport class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.isListMode = options.isListMode;\n\t\tthis.hasDynamicInfo = options.hasDynamicInfo;\n\t\tthis.groups = options.groups;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst isListMode = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);\n\t\tconst groupCount = raw.payload[0] & 0b0011_1111;\n\t\t// each group requires 7 bytes of payload\n\t\tvalidatePayload(raw.payload.length >= 1 + groupCount * 7);\n\t\tconst groups: AssociationGroupInfo[] = [];\n\t\tfor (let i = 0; i < groupCount; i++) {\n\t\t\tconst offset = 1 + i * 7;\n\t\t\t// Parse the payload\n\t\t\tconst groupBytes = raw.payload.subarray(offset, offset + 7);\n\t\t\tconst groupId = groupBytes[0];\n\t\t\tconst mode = 0; // groupBytes[1];\n\t\t\tconst profile = groupBytes.readUInt16BE(2);\n\t\t\tconst eventCode = 0; // groupBytes.readUInt16BE(5);\n\t\t\tgroups.push({ groupId, mode, profile, eventCode });\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tisListMode,\n\t\t\thasDynamicInfo,\n\t\t\tgroups,\n\t\t});\n\t}\n\n\tpublic readonly isListMode: boolean;\n\n\tpublic readonly hasDynamicInfo: boolean;\n\n\tpublic readonly groups: readonly AssociationGroupInfo[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tfor (const group of this.groups) {\n\t\t\tconst { groupId, mode, profile, eventCode } = group;\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tAssociationGroupInfoCCValues.groupInfo(groupId),\n\t\t\t\t{\n\t\t\t\t\tmode,\n\t\t\t\t\tprofile,\n\t\t\t\t\teventCode,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.alloc(1 + this.groups.length * 7, 0);\n\n\t\tthis.payload[0] = (this.isListMode ? 0b1000_0000 : 0)\n\t\t\t| (this.hasDynamicInfo ? 0b0100_0000 : 0)\n\t\t\t| (this.groups.length & 0b0011_1111);\n\n\t\tfor (let i = 0; i < this.groups.length; i++) {\n\t\t\tconst offset = 1 + i * 7;\n\t\t\tthis.payload[offset] = this.groups[i].groupId;\n\t\t\tthis.payload.writeUInt16BE(this.groups[i].profile, offset + 2);\n\t\t\t// The remaining bytes are zero\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"is list mode\": this.isListMode,\n\t\t\t\t\"has dynamic info\": this.hasDynamicInfo,\n\t\t\t\tgroups: `${\n\t\t\t\t\tthis.groups\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(g) => `\n\u00B7 Group #${g.groupId}\n mode: ${g.mode}\n profile: ${g.profile}\n event code: ${g.eventCode}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type AssociationGroupInfoCCInfoGetOptions =\n\t& {\n\t\trefreshCache: boolean;\n\t}\n\t& (\n\t\t| {\n\t\t\tlistMode: boolean;\n\t\t}\n\t\t| {\n\t\t\tgroupId: number;\n\t\t}\n\t);\n\n@CCCommand(AssociationGroupInfoCommand.InfoGet)\n@expectedCCResponse(AssociationGroupInfoCCInfoReport)\nexport class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCInfoGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.refreshCache = options.refreshCache;\n\t\tif (\"listMode\" in options) this.listMode = options.listMode;\n\t\tif (\"groupId\" in options) this.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCInfoGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst optionByte = raw.payload[0];\n\t\tconst refreshCache = !!(optionByte & 0b1000_0000);\n\t\tconst listMode: boolean | undefined = !!(optionByte & 0b0100_0000);\n\t\tlet groupId: number | undefined;\n\n\t\tif (!listMode) {\n\t\t\tgroupId = raw.payload[1];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trefreshCache,\n\t\t\tlistMode,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic refreshCache: boolean;\n\tpublic listMode?: boolean;\n\tpublic groupId?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tconst isListMode = this.listMode === true;\n\t\tconst optionByte = (this.refreshCache ? 0b1000_0000 : 0)\n\t\t\t| (isListMode ? 0b0100_0000 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\toptionByte,\n\t\t\tisListMode ? 0 : this.groupId!,\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.groupId != undefined) {\n\t\t\tmessage[\"group id\"] = this.groupId;\n\t\t}\n\t\tif (this.listMode != undefined) {\n\t\t\tmessage[\"list mode\"] = this.listMode;\n\t\t}\n\t\tmessage[\"refresh cache\"] = this.refreshCache;\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCCommandListReportOptions {\n\tgroupId: number;\n\tcommands: ReadonlyMap<CommandClasses, readonly number[]>;\n}\n\n@CCCommand(AssociationGroupInfoCommand.CommandListReport)\n@ccValueProperty(\n\t\"commands\",\n\tAssociationGroupInfoCCValues.commands,\n\t(self) => [self.groupId],\n)\nexport class AssociationGroupInfoCCCommandListReport\n\textends AssociationGroupInfoCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCCommandListReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.groupId = options.groupId;\n\t\tthis.commands = options.commands;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCCommandListReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst groupId = raw.payload[0];\n\t\tconst listLength = raw.payload[1];\n\t\tvalidatePayload(raw.payload.length >= 2 + listLength);\n\t\tconst listBytes = raw.payload.subarray(2, 2 + listLength);\n\t\t// Parse all CC ids and commands\n\t\tlet offset = 0;\n\t\tconst commands = new Map<CommandClasses, number[]>();\n\t\twhile (offset < listLength) {\n\t\t\tconst { ccId, bytesRead } = parseCCId(listBytes, offset);\n\t\t\tconst command = listBytes[offset + bytesRead];\n\t\t\tif (!commands.has(ccId)) commands.set(ccId, []);\n\t\t\tcommands.get(ccId)!.push(command);\n\t\t\toffset += bytesRead + 1;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tgroupId,\n\t\t\tcommands,\n\t\t});\n\t}\n\n\tpublic readonly groupId: number;\n\n\tpublic readonly commands: ReadonlyMap<CommandClasses, readonly number[]>;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\t// To make it easier to encode possible extended CCs, we first\n\t\t// allocate as much space as we may need, then trim it again\n\t\tthis.payload = new Bytes(2 + this.commands.size * 3);\n\t\tthis.payload[0] = this.groupId;\n\t\tlet offset = 2;\n\t\tfor (const [ccId, commands] of this.commands) {\n\t\t\tfor (const command of commands) {\n\t\t\t\toffset += encodeCCId(ccId, this.payload, offset);\n\t\t\t\tthis.payload[offset] = command;\n\t\t\t\toffset++;\n\t\t\t}\n\t\t}\n\t\tthis.payload[1] = offset - 2; // list length\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\tcommands: `${\n\t\t\t\t\t[...this.commands]\n\t\t\t\t\t\t.map(([cc, cmds]) => {\n\t\t\t\t\t\t\treturn `\\n\u00B7 ${getCCName(cc)}: ${\n\t\t\t\t\t\t\t\tcmds\n\t\t\t\t\t\t\t\t\t.map((cmd) => num2hex(cmd))\n\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AssociationGroupInfoCCCommandListGetOptions {\n\tallowCache: boolean;\n\tgroupId: number;\n}\n\n@CCCommand(AssociationGroupInfoCommand.CommandListGet)\n@expectedCCResponse(AssociationGroupInfoCCCommandListReport)\nexport class AssociationGroupInfoCCCommandListGet\n\textends AssociationGroupInfoCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<AssociationGroupInfoCCCommandListGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.allowCache = options.allowCache;\n\t\tthis.groupId = options.groupId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AssociationGroupInfoCCCommandListGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst allowCache = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst groupId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tallowCache,\n\t\t\tgroupId,\n\t\t});\n\t}\n\n\tpublic allowCache: boolean;\n\tpublic groupId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.allowCache ? 0b1000_0000 : 0,\n\t\t\tthis.groupId,\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"group id\": this.groupId,\n\t\t\t\t\"allow cache\": this.allowCache,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAaO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAAmD;AAEnD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAGO;AACP,2BAA8B;AAC9B,uCAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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