@zwave-js/cc 15.25.1 → 15.25.3
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 +15 -17
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +1 -1
- package/build/cjs/cc/AssociationCC.js +5 -2
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.js +23 -18
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.js +9 -7
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.js +3 -2
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.js +3 -2
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.js +8 -6
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.js +3 -2
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.js +9 -7
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.js +3 -2
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.js +9 -6
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.js +27 -27
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.js +49 -63
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.js +3 -2
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.js +3 -2
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.js +5 -3
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +2 -1
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +9 -8
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +3 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.js +19 -17
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.js +5 -2
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.js +26 -27
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.js +3 -2
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.js +3 -2
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +4 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.js +14 -13
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js +5 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +1 -1
- package/build/cjs/cc/MultiChannelCC.js +19 -22
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js +13 -8
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.js +5 -3
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +3 -2
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.js +11 -11
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.js +16 -15
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js +2 -1
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.js +2 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.js +15 -24
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.js +10 -17
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.js +2 -1
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.js +9 -7
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.js +3 -2
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.js +9 -7
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.js +4 -4
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.js +3 -2
- package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.js +9 -5
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.js +2 -1
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.js +2 -1
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.js +6 -6
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/UserCredentialCC.js +5 -2
- package/build/cjs/cc/UserCredentialCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.js +2 -1
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.js +2 -1
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.js +10 -7
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +2 -1
- package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +4 -4
- package/build/cjs/cc/_CCValues.generated.js +2 -2
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/cc/index.d.ts +3 -3
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +1 -1
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +3 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +5 -1
- package/build/cjs/lib/CommandClass.js +25 -3
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/CommandClassDecorators.d.ts +4 -4
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +6 -4
- package/build/cjs/lib/Security2/Extension.js +22 -20
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/cjs/lib/_Types.js.map +1 -1
- package/build/cjs/lib/utils.js +14 -8
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +14 -18
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +3 -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 +24 -22
- 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 +8 -8
- 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 -1
- 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 +2 -1
- 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 +7 -7
- 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 -1
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +9 -8
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +2 -1
- 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 +8 -7
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +32 -29
- 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 +73 -74
- 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 +2 -1
- 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 -1
- 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 +3 -1
- 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 +1 -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 +8 -9
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +18 -23
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +3 -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 +29 -24
- 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 +2 -1
- 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 +2 -1
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +4 -1
- 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 +15 -19
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +3 -0
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +19 -23
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +14 -19
- 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 +3 -1
- 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 -1
- 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 +11 -14
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +15 -22
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +1 -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 +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +15 -32
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +10 -21
- 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 +1 -0
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +8 -8
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -1
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +8 -8
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +4 -5
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +2 -1
- 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 +8 -9
- 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 +1 -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/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +5 -7
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
- package/build/esm/cc/UserCredentialCC.js +4 -1
- package/build/esm/cc/UserCredentialCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +1 -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 +9 -9
- 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/_CCValues.generated.d.ts +4 -4
- package/build/esm/cc/_CCValues.generated.js +2 -2
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/index.d.ts +3 -3
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -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 +2 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +5 -1
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +30 -4
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +4 -4
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +6 -4
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +23 -21
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/_Types.js +1 -1
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js +15 -9
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src_gen/cc/ProtectionCC.ts"],
|
|
4
|
-
"sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\"\n && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = `received protection capabilities:\nexclusive control: ${resp.supportsExclusiveControl}\ntimeout: ${resp.supportsTimeout}\nlocal protection states: ${resp.supportedLocalStates\n .map((local) => getEnumMemberName(LocalProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\")}\nRF protection states: ${resp.supportedRFStates\n .map((local) => getEnumMemberName(RFProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\")}`;\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx);\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0\n ? `Node ${nodeId.toString().padStart(3, \"0\")}`\n : `no node`) + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": this.supportedLocalStates\n .map((local) => getEnumMemberName(LocalProtectionState, local))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\"),\n \"RF protection states\": this.supportedRFStates\n .map((rf) => getEnumMemberName(RFProtectionState, rf))\n .map((str) => `\\n\u00B7 ${str}`)\n .join(\"\"),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAyS;AACzS,oBAA+C;AAC/C,iBAAkN;AAClN,0BAAyK;AACzK,oCAAiI;AAEjI,mBAA4E;AAE5E,gCAAmC;AATnC,MAAM,EAAE,kCAAkC,kDAAkD,wCAAuC,IAAK;IAY3H,mBAAe,MAAA;8BAD3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BAAA;;;;;IASA,0BAAsB,MAAA;8BAHlC,yCAAU,+BAAkB,UAAU,OACtC,kDAAmB,kBAAkB,OACrC,8CAAc,CAAE;;;;oBAC2B;8CAAA,YAAY;WAAA;;;;;;;;AAAxD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAAmD;AAClE,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,oBAAQ,MAAM,IAAI,QAAQ,CAAC,CAAC;OACxC;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,UAAS,CAAE,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, getNodeTag, logDict, logList, logText, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\"\n && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = logText(\"received protection capabilities:\", {\n nested: logDict({\n \"exclusive control\": resp.supportsExclusiveControl,\n timeout: resp.supportsTimeout,\n \"local protection states\": logList(resp.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(resp.supportedRFStates.map((local) => getEnumMemberName(RFProtectionState, local))),\n }),\n });\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0\n ? getNodeTag(nodeId)\n : `no node`) + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": logList(this.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(this.supportedRFStates.map((rf) => getEnumMemberName(RFProtectionState, rf))),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(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,MAAA;8BAFlC,yCAAU,+BAAkB,UAAU,OACtC,kDAAmB,yBAAyB,CAAC;;;;oBACF;8CAAA,YAAY;WAAA;;;;;;;;AAAxD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;IASA,0BAAsB,MAAA;8BAHlC,yCAAU,+BAAkB,UAAU,OACtC,kDAAmB,kBAAkB,OACrC,8CAAc,CAAE;;;;oBAC2B;8CAAA,YAAY;WAAA;;;;;;;;AAAxD,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAAmD;AAClE,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,oBAAQ,MAAM,IAAI,QAAQ,CAAC,CAAC;OACxC;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,UAAS,CAAE,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -259,7 +259,8 @@ let SceneControllerConfigurationCC = (() => {
|
|
|
259
259
|
const node = this.getNode(ctx);
|
|
260
260
|
const endpoint = this.getEndpoint(ctx);
|
|
261
261
|
const api = import_API.CCAPI.create(import_core.CommandClasses["Scene Controller Configuration"], ctx, endpoint).withOptions({
|
|
262
|
-
priority: options?.priority ?? import_core.MessagePriority.NodeQuery
|
|
262
|
+
priority: options?.priority ?? import_core.MessagePriority.NodeQuery,
|
|
263
|
+
tag: options?.tag
|
|
263
264
|
});
|
|
264
265
|
const groupCount = SceneControllerConfigurationCC2.getGroupCountCached(ctx, endpoint);
|
|
265
266
|
ctx.logNode(node.id, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src_gen/cc/SceneControllerConfigurationCC.ts"],
|
|
4
|
-
"sourcesContent": ["import * as __validateArgs from \"./SceneControllerConfigurationCC._validateArgs.js\";\nconst { validateArgs_SceneControllerConfigurationCCAPI_disable, validateArgs_SceneControllerConfigurationCCAPI_set, validateArgs_SceneControllerConfigurationCCAPI_get } = __validateArgs;\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, Duration, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type SupervisionResult, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, getCCName, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneControllerConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\nimport { SceneControllerConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { SceneControllerConfigurationCCValues };\n@API(CommandClasses[\"Scene Controller Configuration\"])\nexport class SceneControllerConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: SceneControllerConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case SceneControllerConfigurationCommand.Get:\n return this.isSinglecast();\n case SceneControllerConfigurationCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: SceneControllerConfigurationCCAPI, { property, propertyKey }, value, options) {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (property === \"sceneId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n if (value === 0) {\n // Disable Group ID / Scene ID\n return this.disable(propertyKey);\n }\n else {\n // We need to set the dimming duration along with the scene ID\n // Dimming duration is chosen with the following precedence:\n // 1. options.transitionDuration\n // 2. current stored value\n // 3. default value\n const dimmingDuration = Duration.from(options?.transitionDuration)\n ?? this.tryGetValueDB()?.getValue<Duration>(SceneControllerConfigurationCCValues\n .dimmingDuration(propertyKey).endpoint(this.endpoint.index))\n ?? Duration.default();\n return this.set(propertyKey, value, dimmingDuration);\n }\n }\n else if (property === \"dimmingDuration\") {\n if (typeof value !== \"string\" && !Duration.isDuration(value)) {\n throwWrongValueType(this.ccId, property, \"duration\", typeof value);\n }\n const dimmingDuration = Duration.from(value);\n if (dimmingDuration == undefined) {\n throw new ZWaveError(`${getCCName(this.ccId)}: \"${property}\" could not be set. ${JSON.stringify(value)} is not a valid duration.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const valueDB = this.tryGetValueDB();\n const sceneId = valueDB?.getValue<number>(SceneControllerConfigurationCCValues.sceneId(propertyKey).endpoint(this.endpoint.index));\n if (sceneId == undefined || sceneId === 0) {\n if (valueDB) {\n // Can't actually send dimmingDuration without valid sceneId\n // So we save it in the valueDB without sending it to the node\n const dimmingDurationValueId = SceneControllerConfigurationCCValues\n .dimmingDuration(propertyKey).endpoint(this.endpoint.index);\n valueDB.setValue(dimmingDurationValueId, dimmingDuration);\n }\n return;\n }\n return this.set(propertyKey, sceneId, dimmingDuration);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: SceneControllerConfigurationCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"sceneId\":\n case \"dimmingDuration\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_SceneControllerConfigurationCCAPI_disable()\n public async disable(groupId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Set);\n return this.set(groupId, 0, new Duration(0, \"seconds\"));\n }\n @validateArgs_SceneControllerConfigurationCCAPI_set()\n public async set(groupId: number, sceneId: number, dimmingDuration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Set);\n if (!this.endpoint.virtual) {\n const groupCount = SceneControllerConfigurationCC\n .getGroupCountCached(this.host, this.endpoint);\n // The client SHOULD NOT specify group 1 (the life-line group).\n // We don't block it here, because the specs don't forbid it,\n // and it may be needed for some devices.\n if (groupId < 1 || groupId > groupCount) {\n throw new ZWaveError(`${this.constructor.name}: The group ID must be between 1 and the number of supported groups ${groupCount}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else if (groupId < 1) {\n throw new ZWaveError(`The group ID must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneControllerConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId,\n sceneId,\n dimmingDuration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getLastActivated(): Promise<MaybeNotKnown<Pick<SceneControllerConfigurationCCReport, \"groupId\" | \"sceneId\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Get);\n const cc = new SceneControllerConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId: 0,\n });\n const response = await this.host.sendCommand<SceneControllerConfigurationCCReport>(cc, this.commandOptions);\n // Return value includes \"groupId\", because\n // the returned report will include the actual groupId of the\n // last activated groupId / sceneId\n if (response) {\n return pick(response, [\"groupId\", \"sceneId\", \"dimmingDuration\"]);\n }\n }\n @validateArgs_SceneControllerConfigurationCCAPI_get()\n public async get(groupId: number): Promise<MaybeNotKnown<Pick<SceneControllerConfigurationCCReport, \"sceneId\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Get);\n if (groupId === 0) {\n throw new ZWaveError(`Invalid group ID 0. To get the last activated group / scene, use getLastActivated() instead.`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (groupId < 0) {\n throw new ZWaveError(`The group ID must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneControllerConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId,\n });\n const response = await this.host.sendCommand<SceneControllerConfigurationCCReport>(cc, this.commandOptions);\n // Since groupId is not allowed to be 0, only Reports with\n // groupId equal to the requested groupId will be accepted,\n // so we can omit groupId from the return.\n if (response) {\n return pick(response, [\"sceneId\", \"dimmingDuration\"]);\n }\n }\n}\n@commandClass(CommandClasses[\"Scene Controller Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneControllerConfigurationCCValues)\nexport class SceneControllerConfigurationCC extends CommandClass {\n declare ccCommand: SceneControllerConfigurationCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n // AssociationCC is required and MUST be interviewed\n // before SceneControllerConfigurationCC to supply groupCount\n return [\n ...super.determineRequiredCCInterviews(),\n CommandClasses.Association,\n ];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n const groupCount = SceneControllerConfigurationCC.getGroupCountCached(ctx, endpoint);\n if (groupCount === 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `skipping Scene Controller Configuration interview because Association group count is unknown`,\n direction: \"none\",\n level: \"warn\",\n });\n return;\n }\n // Create metadata for each scene, but don't query their actual configuration\n // since some devices only support setting scenes\n for (let groupId = 1; groupId <= groupCount; groupId++) {\n const sceneIdValue = SceneControllerConfigurationCCValues.sceneId(groupId);\n this.ensureMetadata(ctx, sceneIdValue);\n const dimmingDurationValue = SceneControllerConfigurationCCValues\n .dimmingDuration(groupId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Scene Controller Configuration\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n });\n const groupCount = SceneControllerConfigurationCC.getGroupCountCached(ctx, endpoint);\n ctx.logNode(node.id, {\n message: \"querying all scene controller configurations...\",\n direction: \"outbound\",\n });\n for (let groupId = 1; groupId <= groupCount; groupId++) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying scene configuration for group #${groupId}...`,\n direction: \"outbound\",\n });\n const group = await api.get(groupId);\n if (group != undefined) {\n const logMessage = `received scene configuration for group #${groupId}:\nscene ID: ${group.sceneId}\ndimming duration: ${group.dimmingDuration.toString()}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n options?.onProgress?.(groupId, groupCount);\n }\n }\n /**\n * Returns the number of association groups reported by the node.\n * This only works AFTER the node has been interviewed by this CC\n * or the AssociationCC.\n */\n public static getGroupCountCached(ctx: GetValueDB & GetDeviceConfig, endpoint: EndpointId): number {\n return ctx.getDeviceConfig?.(endpoint.nodeId)?.compat\n ?.forceSceneControllerGroupCount\n ?? AssociationCC.getGroupCountCached(ctx, endpoint)\n ?? 0;\n }\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCSetOptions {\n groupId: number;\n sceneId: number;\n dimmingDuration?: Duration | string;\n}\n@CCCommand(SceneControllerConfigurationCommand.Set)\n@useSupervision()\nexport class SceneControllerConfigurationCCSet extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCSetOptions>) {\n super(options);\n this.groupId = options.groupId;\n this.sceneId = options.sceneId;\n // if dimmingDuration was missing, use default duration.\n this.dimmingDuration = Duration.from(options.dimmingDuration)\n ?? Duration.default();\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneControllerConfigurationCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public groupId: number;\n public sceneId: number;\n public dimmingDuration: Duration;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.groupId,\n this.sceneId,\n this.dimmingDuration.serializeSet(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"group id\": this.groupId,\n \"scene id\": this.sceneId,\n \"dimming duration\": this.dimmingDuration.toString(),\n },\n };\n }\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCReportOptions {\n groupId: number;\n sceneId: number;\n dimmingDuration: Duration;\n}\n@CCCommand(SceneControllerConfigurationCommand.Report)\nexport class SceneControllerConfigurationCCReport extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.groupId = options.groupId;\n this.sceneId = options.sceneId;\n this.dimmingDuration = options.dimmingDuration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneControllerConfigurationCCReport {\n validatePayload(raw.payload.length >= 3);\n const groupId = raw.payload[0];\n const sceneId = raw.payload[1];\n const dimmingDuration: Duration = Duration.parseReport(raw.payload[2])\n ?? Duration.unknown();\n return new this({\n nodeId: ctx.sourceNodeId,\n groupId,\n sceneId,\n dimmingDuration,\n });\n }\n public readonly groupId: number;\n public readonly sceneId: number;\n public readonly dimmingDuration: Duration;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // If groupId = 0, values are meaningless\n if (this.groupId === 0)\n return false;\n const sceneIdValue = SceneControllerConfigurationCCValues.sceneId(this.groupId);\n this.ensureMetadata(ctx, sceneIdValue);\n const dimmingDurationValue = SceneControllerConfigurationCCValues\n .dimmingDuration(this.groupId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n this.setValue(ctx, sceneIdValue, this.sceneId);\n this.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n return true;\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"group id\": this.groupId,\n \"scene id\": this.sceneId,\n \"dimming duration\": this.dimmingDuration.toString(),\n },\n };\n }\n}\nfunction testResponseForSceneControllerConfigurationGet(sent: SceneControllerConfigurationCCGet, received: SceneControllerConfigurationCCReport) {\n // We expect a Scene Controller Configuration Report that matches\n // the requested groupId, unless groupId 0 was requested\n return sent.groupId === 0 || received.groupId === sent.groupId;\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCGetOptions {\n groupId: number;\n}\n@CCCommand(SceneControllerConfigurationCommand.Get)\n@expectedCCResponse(SceneControllerConfigurationCCReport, testResponseForSceneControllerConfigurationGet)\nexport class SceneControllerConfigurationCCGet extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCGetOptions>) {\n super(options);\n this.groupId = options.groupId;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneControllerConfigurationCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public groupId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.groupId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"group id\": this.groupId },\n };\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAA6P;AAC7P,oBAA4B;AAC5B,iBAA8M;AAC9M,0BAAkJ;AAClJ,oCAAgH;AAEhH,mBAAoD;AAEpD,2BAA8B;AAC9B,gCAAqD;AAXrD,MAAM,EAAE,wDAAwD,oDAAoD,mDAAkD,IAAK;IAc9J,qCAAiC,MAAA;8BAD7C,mCAAI,2BAAe,gCAAgC,CAAC,CAAC;;;;oBACC;;;;;yDAAA,YAAK;WAAA;;;;;;;;6BAoFvD,uDAAsD,CAAE;yBAKxD,mDAAkD,CAAE;yBAwCpD,mDAAkD,CAAE;AA5CrD,qCAAA,MAAA,MAAA,qBAAA,EAAA,MAAA,UAAA,MAAA,WAAA,QAAA,OAAA,SA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cAAM,uBAAuB,+DACxB,gBAAgB,OAAO;AAC5B,aAAK,eAAe,KAAK,oBAAoB;MACjD;AAEA,WAAK,qBAAqB,KAAK,IAAI;IACvC;IACO,MAAM,cAAc,KAA2B,SAA8B;AAChF,YAAM,OAAO,KAAK,QAAQ,GAAG;AAC7B,YAAM,WAAW,KAAK,YAAY,GAAG;AACrC,YAAM,MAAM,iBAAM,OAAO,2BAAe,gCAAgC,GAAG,KAAK,QAAQ,EAAE,YAAY;QAClG,UAAU,SAAS,YAAY,4BAAgB;
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./SceneControllerConfigurationCC._validateArgs.js\";\nconst { validateArgs_SceneControllerConfigurationCCAPI_disable, validateArgs_SceneControllerConfigurationCCAPI_set, validateArgs_SceneControllerConfigurationCCAPI_get } = __validateArgs;\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, Duration, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type SupervisionResult, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, getCCName, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneControllerConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { AssociationCC } from \"./AssociationCC.js\";\nimport { SceneControllerConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { SceneControllerConfigurationCCValues };\n@API(CommandClasses[\"Scene Controller Configuration\"])\nexport class SceneControllerConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: SceneControllerConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case SceneControllerConfigurationCommand.Get:\n return this.isSinglecast();\n case SceneControllerConfigurationCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: SceneControllerConfigurationCCAPI, { property, propertyKey }, value, options) {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (property === \"sceneId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n if (value === 0) {\n // Disable Group ID / Scene ID\n return this.disable(propertyKey);\n }\n else {\n // We need to set the dimming duration along with the scene ID\n // Dimming duration is chosen with the following precedence:\n // 1. options.transitionDuration\n // 2. current stored value\n // 3. default value\n const dimmingDuration = Duration.from(options?.transitionDuration)\n ?? this.tryGetValueDB()?.getValue<Duration>(SceneControllerConfigurationCCValues\n .dimmingDuration(propertyKey).endpoint(this.endpoint.index))\n ?? Duration.default();\n return this.set(propertyKey, value, dimmingDuration);\n }\n }\n else if (property === \"dimmingDuration\") {\n if (typeof value !== \"string\" && !Duration.isDuration(value)) {\n throwWrongValueType(this.ccId, property, \"duration\", typeof value);\n }\n const dimmingDuration = Duration.from(value);\n if (dimmingDuration == undefined) {\n throw new ZWaveError(`${getCCName(this.ccId)}: \"${property}\" could not be set. ${JSON.stringify(value)} is not a valid duration.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const valueDB = this.tryGetValueDB();\n const sceneId = valueDB?.getValue<number>(SceneControllerConfigurationCCValues.sceneId(propertyKey).endpoint(this.endpoint.index));\n if (sceneId == undefined || sceneId === 0) {\n if (valueDB) {\n // Can't actually send dimmingDuration without valid sceneId\n // So we save it in the valueDB without sending it to the node\n const dimmingDurationValueId = SceneControllerConfigurationCCValues\n .dimmingDuration(propertyKey).endpoint(this.endpoint.index);\n valueDB.setValue(dimmingDurationValueId, dimmingDuration);\n }\n return;\n }\n return this.set(propertyKey, sceneId, dimmingDuration);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: SceneControllerConfigurationCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"sceneId\":\n case \"dimmingDuration\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_SceneControllerConfigurationCCAPI_disable()\n public async disable(groupId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Set);\n return this.set(groupId, 0, new Duration(0, \"seconds\"));\n }\n @validateArgs_SceneControllerConfigurationCCAPI_set()\n public async set(groupId: number, sceneId: number, dimmingDuration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Set);\n if (!this.endpoint.virtual) {\n const groupCount = SceneControllerConfigurationCC\n .getGroupCountCached(this.host, this.endpoint);\n // The client SHOULD NOT specify group 1 (the life-line group).\n // We don't block it here, because the specs don't forbid it,\n // and it may be needed for some devices.\n if (groupId < 1 || groupId > groupCount) {\n throw new ZWaveError(`${this.constructor.name}: The group ID must be between 1 and the number of supported groups ${groupCount}.`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n else if (groupId < 1) {\n throw new ZWaveError(`The group ID must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneControllerConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId,\n sceneId,\n dimmingDuration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getLastActivated(): Promise<MaybeNotKnown<Pick<SceneControllerConfigurationCCReport, \"groupId\" | \"sceneId\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Get);\n const cc = new SceneControllerConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId: 0,\n });\n const response = await this.host.sendCommand<SceneControllerConfigurationCCReport>(cc, this.commandOptions);\n // Return value includes \"groupId\", because\n // the returned report will include the actual groupId of the\n // last activated groupId / sceneId\n if (response) {\n return pick(response, [\"groupId\", \"sceneId\", \"dimmingDuration\"]);\n }\n }\n @validateArgs_SceneControllerConfigurationCCAPI_get()\n public async get(groupId: number): Promise<MaybeNotKnown<Pick<SceneControllerConfigurationCCReport, \"sceneId\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneControllerConfigurationCommand, SceneControllerConfigurationCommand.Get);\n if (groupId === 0) {\n throw new ZWaveError(`Invalid group ID 0. To get the last activated group / scene, use getLastActivated() instead.`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (groupId < 0) {\n throw new ZWaveError(`The group ID must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneControllerConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n groupId,\n });\n const response = await this.host.sendCommand<SceneControllerConfigurationCCReport>(cc, this.commandOptions);\n // Since groupId is not allowed to be 0, only Reports with\n // groupId equal to the requested groupId will be accepted,\n // so we can omit groupId from the return.\n if (response) {\n return pick(response, [\"sceneId\", \"dimmingDuration\"]);\n }\n }\n}\n@commandClass(CommandClasses[\"Scene Controller Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneControllerConfigurationCCValues)\nexport class SceneControllerConfigurationCC extends CommandClass {\n declare ccCommand: SceneControllerConfigurationCommand;\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n // AssociationCC is required and MUST be interviewed\n // before SceneControllerConfigurationCC to supply groupCount\n return [\n ...super.determineRequiredCCInterviews(),\n CommandClasses.Association,\n ];\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n const groupCount = SceneControllerConfigurationCC.getGroupCountCached(ctx, endpoint);\n if (groupCount === 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `skipping Scene Controller Configuration interview because Association group count is unknown`,\n direction: \"none\",\n level: \"warn\",\n });\n return;\n }\n // Create metadata for each scene, but don't query their actual configuration\n // since some devices only support setting scenes\n for (let groupId = 1; groupId <= groupCount; groupId++) {\n const sceneIdValue = SceneControllerConfigurationCCValues.sceneId(groupId);\n this.ensureMetadata(ctx, sceneIdValue);\n const dimmingDurationValue = SceneControllerConfigurationCCValues\n .dimmingDuration(groupId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Scene Controller Configuration\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const groupCount = SceneControllerConfigurationCC.getGroupCountCached(ctx, endpoint);\n ctx.logNode(node.id, {\n message: \"querying all scene controller configurations...\",\n direction: \"outbound\",\n });\n for (let groupId = 1; groupId <= groupCount; groupId++) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying scene configuration for group #${groupId}...`,\n direction: \"outbound\",\n });\n const group = await api.get(groupId);\n if (group != undefined) {\n const logMessage = `received scene configuration for group #${groupId}:\nscene ID: ${group.sceneId}\ndimming duration: ${group.dimmingDuration.toString()}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n options?.onProgress?.(groupId, groupCount);\n }\n }\n /**\n * Returns the number of association groups reported by the node.\n * This only works AFTER the node has been interviewed by this CC\n * or the AssociationCC.\n */\n public static getGroupCountCached(ctx: GetValueDB & GetDeviceConfig, endpoint: EndpointId): number {\n return ctx.getDeviceConfig?.(endpoint.nodeId)?.compat\n ?.forceSceneControllerGroupCount\n ?? AssociationCC.getGroupCountCached(ctx, endpoint)\n ?? 0;\n }\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCSetOptions {\n groupId: number;\n sceneId: number;\n dimmingDuration?: Duration | string;\n}\n@CCCommand(SceneControllerConfigurationCommand.Set)\n@useSupervision()\nexport class SceneControllerConfigurationCCSet extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCSetOptions>) {\n super(options);\n this.groupId = options.groupId;\n this.sceneId = options.sceneId;\n // if dimmingDuration was missing, use default duration.\n this.dimmingDuration = Duration.from(options.dimmingDuration)\n ?? Duration.default();\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneControllerConfigurationCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public groupId: number;\n public sceneId: number;\n public dimmingDuration: Duration;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.groupId,\n this.sceneId,\n this.dimmingDuration.serializeSet(),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"group id\": this.groupId,\n \"scene id\": this.sceneId,\n \"dimming duration\": this.dimmingDuration.toString(),\n },\n };\n }\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCReportOptions {\n groupId: number;\n sceneId: number;\n dimmingDuration: Duration;\n}\n@CCCommand(SceneControllerConfigurationCommand.Report)\nexport class SceneControllerConfigurationCCReport extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.groupId = options.groupId;\n this.sceneId = options.sceneId;\n this.dimmingDuration = options.dimmingDuration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneControllerConfigurationCCReport {\n validatePayload(raw.payload.length >= 3);\n const groupId = raw.payload[0];\n const sceneId = raw.payload[1];\n const dimmingDuration: Duration = Duration.parseReport(raw.payload[2])\n ?? Duration.unknown();\n return new this({\n nodeId: ctx.sourceNodeId,\n groupId,\n sceneId,\n dimmingDuration,\n });\n }\n public readonly groupId: number;\n public readonly sceneId: number;\n public readonly dimmingDuration: Duration;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // If groupId = 0, values are meaningless\n if (this.groupId === 0)\n return false;\n const sceneIdValue = SceneControllerConfigurationCCValues.sceneId(this.groupId);\n this.ensureMetadata(ctx, sceneIdValue);\n const dimmingDurationValue = SceneControllerConfigurationCCValues\n .dimmingDuration(this.groupId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n this.setValue(ctx, sceneIdValue, this.sceneId);\n this.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n return true;\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"group id\": this.groupId,\n \"scene id\": this.sceneId,\n \"dimming duration\": this.dimmingDuration.toString(),\n },\n };\n }\n}\nfunction testResponseForSceneControllerConfigurationGet(sent: SceneControllerConfigurationCCGet, received: SceneControllerConfigurationCCReport) {\n // We expect a Scene Controller Configuration Report that matches\n // the requested groupId, unless groupId 0 was requested\n return sent.groupId === 0 || received.groupId === sent.groupId;\n}\n// @publicAPI\nexport interface SceneControllerConfigurationCCGetOptions {\n groupId: number;\n}\n@CCCommand(SceneControllerConfigurationCommand.Get)\n@expectedCCResponse(SceneControllerConfigurationCCReport, testResponseForSceneControllerConfigurationGet)\nexport class SceneControllerConfigurationCCGet extends SceneControllerConfigurationCC {\n public constructor(options: WithAddress<SceneControllerConfigurationCCGetOptions>) {\n super(options);\n this.groupId = options.groupId;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneControllerConfigurationCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public groupId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.groupId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"group id\": this.groupId },\n };\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAA6P;AAC7P,oBAA4B;AAC5B,iBAA8M;AAC9M,0BAAkJ;AAClJ,oCAAgH;AAEhH,mBAAoD;AAEpD,2BAA8B;AAC9B,gCAAqD;AAXrD,MAAM,EAAE,wDAAwD,oDAAoD,mDAAkD,IAAK;IAc9J,qCAAiC,MAAA;8BAD7C,mCAAI,2BAAe,gCAAgC,CAAC,CAAC;;;;oBACC;;;;;yDAAA,YAAK;WAAA;;;;;;;;6BAoFvD,uDAAsD,CAAE;yBAKxD,mDAAkD,CAAE;yBAwCpD,mDAAkD,CAAE;AA5CrD,qCAAA,MAAA,MAAA,qBAAA,EAAA,MAAA,UAAA,MAAA,WAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA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AC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAE3C;;;;",
|
|
6
6
|
"names": ["SceneControllerConfigurationCC"]
|
|
7
7
|
}
|
|
@@ -409,7 +409,8 @@ let ScheduleEntryLockCC = (() => {
|
|
|
409
409
|
const node = this.getNode(ctx);
|
|
410
410
|
const endpoint = this.getEndpoint(ctx);
|
|
411
411
|
const api = import_API.CCAPI.create(import_core.CommandClasses["Schedule Entry Lock"], ctx, endpoint).withOptions({
|
|
412
|
-
priority: import_core.MessagePriority.NodeQuery
|
|
412
|
+
priority: import_core.MessagePriority.NodeQuery,
|
|
413
|
+
tag: "interview"
|
|
413
414
|
});
|
|
414
415
|
ctx.logNode(node.id, {
|
|
415
416
|
endpoint: this.endpointIndex,
|