@zwave-js/cc 14.3.10 → 15.0.0-beta.1
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.d.ts +68 -68
- package/build/cjs/cc/AlarmSensorCC.js +12 -50
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +72 -73
- package/build/cjs/cc/AssociationCC.js +9 -26
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +71 -71
- package/build/cjs/cc/AssociationGroupInfoCC.js +11 -22
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +66 -72
- package/build/cjs/cc/BarrierOperatorCC.js +12 -44
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +64 -65
- package/build/cjs/cc/BasicCC.js +15 -46
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.d.ts +162 -165
- package/build/cjs/cc/BatteryCC.js +7 -84
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +36 -36
- package/build/cjs/cc/BinarySensorCC.js +9 -29
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +34 -34
- package/build/cjs/cc/BinarySwitchCC.js +6 -22
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CRC16CC.d.ts +4 -8
- package/build/cjs/cc/CRC16CC.js +4 -27
- package/build/cjs/cc/CRC16CC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +74 -74
- package/build/cjs/cc/CentralSceneCC.js +7 -30
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +38 -40
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -24
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.d.ts +3 -3
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +117 -117
- package/build/cjs/cc/ColorSwitchCC.js +23 -75
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC._validateArgs.js +1 -1
- package/build/cjs/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/ConfigurationCC.d.ts +48 -52
- package/build/cjs/cc/ConfigurationCC.js +11 -39
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC._validateArgs.js +1 -1
- package/build/cjs/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/DoorLockCC.d.ts +362 -361
- package/build/cjs/cc/DoorLockCC.js +51 -156
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +14 -14
- package/build/cjs/cc/DoorLockLoggingCC.js +4 -8
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +16 -16
- package/build/cjs/cc/EnergyProductionCC.js +5 -17
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +71 -71
- package/build/cjs/cc/EntryControlCC.js +9 -36
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js +26 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +101 -88
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +159 -34
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +31 -33
- package/build/cjs/cc/HumidityControlModeCC.js +6 -15
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +9 -11
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -12
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +50 -50
- package/build/cjs/cc/HumidityControlSetpointCC.js +10 -28
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/InclusionControllerCC.d.ts +4 -4
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +119 -119
- package/build/cjs/cc/IndicatorCC.js +15 -61
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +581 -585
- package/build/cjs/cc/IrrigationCC.js +29 -233
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +21 -21
- package/build/cjs/cc/LanguageCC.js +4 -15
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +9 -9
- package/build/cjs/cc/LockCC.js +4 -12
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +67 -67
- package/build/cjs/cc/ManufacturerSpecificCC.js +5 -26
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +120 -119
- package/build/cjs/cc/MeterCC.js +25 -69
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +71 -73
- package/build/cjs/cc/MultiChannelAssociationCC.js +10 -28
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +136 -146
- package/build/cjs/cc/MultiChannelCC.js +26 -118
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultiCommandCC.d.ts +4 -8
- package/build/cjs/cc/MultiCommandCC.js +4 -37
- package/build/cjs/cc/MultiCommandCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +50 -49
- package/build/cjs/cc/MultilevelSensorCC.js +12 -33
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +146 -146
- package/build/cjs/cc/MultilevelSwitchCC.js +13 -107
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +30 -30
- package/build/cjs/cc/NodeNamingCC.js +5 -16
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +210 -208
- package/build/cjs/cc/NotificationCC.js +41 -113
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC.d.ts +6 -6
- package/build/cjs/cc/PowerlevelCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +117 -121
- package/build/cjs/cc/ProtectionCC.js +15 -50
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +29 -29
- package/build/cjs/cc/SceneActivationCC.js +4 -17
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +35 -35
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +9 -21
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +36 -35
- package/build/cjs/cc/SceneControllerConfigurationCC.js +10 -22
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +109 -109
- package/build/cjs/cc/ScheduleEntryLockCC.js +13 -30
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +15 -21
- package/build/cjs/cc/Security2CC.js +32 -347
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +12 -19
- package/build/cjs/cc/SecurityCC.js +12 -106
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +58 -58
- package/build/cjs/cc/SoundSwitchCC.js +11 -43
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +21 -25
- package/build/cjs/cc/SupervisionCC.js +8 -38
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +37 -39
- package/build/cjs/cc/ThermostatFanModeCC.js +8 -21
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +9 -11
- package/build/cjs/cc/ThermostatFanStateCC.js +4 -12
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +39 -41
- package/build/cjs/cc/ThermostatModeCC.js +8 -21
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +9 -11
- package/build/cjs/cc/ThermostatOperatingStateCC.js +4 -12
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +4 -4
- package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +51 -51
- package/build/cjs/cc/ThermostatSetpointCC.js +10 -25
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.d.ts +6 -6
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +9 -9
- package/build/cjs/cc/TimeParametersCC.js +4 -11
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +7 -12
- package/build/cjs/cc/TransportServiceCC.js +3 -20
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC._validateArgs.js +1 -1
- package/build/cjs/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/UserCodeCC.d.ts +236 -236
- package/build/cjs/cc/UserCodeCC.js +33 -98
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +210 -212
- package/build/cjs/cc/VersionCC.js +7 -98
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +44 -44
- package/build/cjs/cc/WakeUpCC.js +6 -26
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +118 -122
- package/build/cjs/cc/WindowCoveringCC.js +16 -128
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +74 -74
- package/build/cjs/cc/ZWavePlusCC.js +4 -25
- package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +28 -28
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +15814 -0
- package/build/cjs/cc/_CCValues.generated.js +8723 -0
- package/build/cjs/cc/_CCValues.generated.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_browser.d.ts +9 -0
- package/build/cjs/index_browser.js +41 -1
- package/build/cjs/index_browser.js.map +2 -2
- package/build/cjs/lib/API.d.ts +7 -5
- package/build/cjs/lib/API.js +1 -1
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CCValueUtils.d.ts +14 -0
- package/build/cjs/lib/CCValueUtils.js +93 -0
- package/build/cjs/lib/CCValueUtils.js.map +7 -0
- package/build/cjs/lib/CommandClass.d.ts +10 -21
- package/build/cjs/lib/CommandClass.js +51 -106
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +1 -1
- package/build/cjs/lib/CommandClassDecorators.js +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Values.d.ts +7 -106
- package/build/cjs/lib/Values.js +13 -107
- package/build/cjs/lib/Values.js.map +3 -3
- package/build/cjs/lib/traits.d.ts +94 -0
- package/build/cjs/lib/traits.js +17 -0
- package/build/cjs/lib/traits.js.map +7 -0
- package/build/cjs/lib/utils.d.ts +2 -2
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.d.ts +68 -68
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -40
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +72 -73
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -27
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +71 -71
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -19
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +66 -72
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -37
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +64 -65
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -34
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +162 -165
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +3 -80
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +36 -36
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -19
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +34 -34
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -19
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +4 -8
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +4 -34
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +74 -74
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -27
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +38 -40
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -26
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -3
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +0 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +117 -117
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -58
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +48 -52
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -40
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +362 -361
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +9 -129
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +14 -14
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -6
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +16 -16
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -15
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +71 -71
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -29
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js +20 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +101 -88
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +160 -53
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +31 -33
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -11
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +9 -11
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -9
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +50 -50
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -23
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +4 -4
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +0 -2
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +119 -119
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -50
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +581 -585
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -231
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +21 -21
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -13
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +9 -9
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -10
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +0 -2
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +67 -67
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -26
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +120 -119
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -53
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +71 -73
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -30
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +136 -146
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +10 -131
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +4 -8
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +4 -38
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +50 -49
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -27
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +146 -146
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +5 -105
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +30 -30
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -14
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +210 -208
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +21 -97
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +6 -6
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +0 -4
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +117 -121
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -39
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +29 -29
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -15
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +35 -35
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -16
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +36 -35
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -16
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +109 -109
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +2 -31
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +15 -21
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +27 -475
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +12 -19
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +13 -138
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +58 -58
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -40
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +21 -25
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +6 -41
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +37 -39
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -15
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +9 -11
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -9
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +39 -41
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -17
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +9 -11
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -9
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +4 -4
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +0 -2
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +51 -51
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -22
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +6 -6
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +0 -4
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +9 -9
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +2 -9
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +7 -12
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +5 -38
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +236 -236
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -72
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +210 -212
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -96
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +44 -44
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -22
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +118 -122
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +3 -108
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +74 -74
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -26
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +28 -28
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +0 -27
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +15814 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -0
- package/build/esm/cc/_CCValues.generated.js +9187 -0
- package/build/esm/cc/_CCValues.generated.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +0 -3
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index_browser.d.ts +9 -0
- package/build/esm/index_browser.d.ts.map +1 -1
- package/build/esm/index_browser.js +8 -1
- package/build/esm/index_browser.js.map +1 -1
- package/build/esm/lib/API.d.ts +7 -5
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CCValueUtils.d.ts +14 -0
- package/build/esm/lib/CCValueUtils.d.ts.map +1 -0
- package/build/esm/lib/CCValueUtils.js +62 -0
- package/build/esm/lib/CCValueUtils.js.map +1 -0
- package/build/esm/lib/CommandClass.d.ts +10 -21
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +8 -101
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Values.d.ts +7 -106
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +7 -104
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/traits.d.ts +94 -0
- package/build/esm/lib/traits.d.ts.map +1 -0
- package/build/esm/lib/traits.js +2 -0
- package/build/esm/lib/traits.js.map +1 -0
- package/build/esm/lib/utils.d.ts +2 -2
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +16 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/CommandClass.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\ttype BroadcastCC,\n\ttype CCAddress,\n\ttype CCId,\n\tCommandClasses,\n\ttype ControlsCC,\n\tEncapsulationFlags,\n\ttype EndpointId,\n\ttype FrameType,\n\ttype GetAllEndpoints,\n\ttype GetCCs,\n\ttype GetEndpoint,\n\ttype ListenBehavior,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ModifyCCs,\n\ttype MulticastCC,\n\ttype MulticastDestination,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\ttype NodeId,\n\ttype QueryNodeStatus,\n\ttype QuerySecurityClasses,\n\ttype SetSecurityClass,\n\ttype SinglecastCC,\n\ttype SupportsCC,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype ValueMetadata,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tisZWaveError,\n\tparseCCId,\n\tvalueIdToString,\n} from \"@zwave-js/core\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetInterviewOptions,\n\tGetNode,\n\tGetSupportedCCVersion,\n\tGetValueDB,\n\tHostIDs,\n\tLogNode,\n\tLookupManufacturer,\n} from \"@zwave-js/host\";\nimport {\n\tBytes,\n\ttype JSONObject,\n\tbuffer2hex,\n\tgetEnumMemberName,\n\tnum2hex,\n\tstaticExtends,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport type { CCAPIHost, CCAPINode, ValueIDProperties } from \"./API.js\";\nimport {\n\tgetCCCommand,\n\tgetCCCommandConstructor,\n\tgetCCConstructor,\n\tgetCCResponsePredicate,\n\tgetCCValueProperties,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetExpectedCCResponse,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport {\n\ttype EncapsulatingCommandClass,\n\tisEncapsulatingCommandClass,\n\tisMultiEncapsulatingCommandClass,\n} from \"./EncapsulatingCommandClass.js\";\nimport {\n\ttype CCValue,\n\ttype DynamicCCValue,\n\ttype StaticCCValue,\n\tdefaultCCValueOptions,\n} from \"./Values.js\";\n\nexport interface CommandClassOptions extends CCAddress {\n\tccId?: number; // Used to overwrite the declared CC ID\n\tccCommand?: number; // undefined = NoOp\n\tpayload?: Uint8Array;\n}\n\n// Defines the necessary traits an endpoint passed to a CC instance must have\nexport type CCEndpoint =\n\t& EndpointId\n\t& SupportsCC\n\t& ControlsCC\n\t& GetCCs\n\t& ModifyCCs;\n\n// Defines the necessary traits a node passed to a CC instance must have\nexport type CCNode =\n\t& NodeId\n\t& SupportsCC\n\t& ControlsCC\n\t& GetCCs\n\t& GetEndpoint<CCEndpoint>\n\t& GetAllEndpoints<CCEndpoint>\n\t& QuerySecurityClasses\n\t& SetSecurityClass\n\t& ListenBehavior\n\t& QueryNodeStatus;\n\nexport type InterviewContext =\n\t& CCAPIHost<\n\t\t& CCAPINode\n\t\t& GetCCs\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& QuerySecurityClasses\n\t\t& SetSecurityClass\n\t\t& GetEndpoint<EndpointId & GetCCs & SupportsCC & ControlsCC & ModifyCCs>\n\t\t& GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>\n\t>\n\t& GetInterviewOptions\n\t& LookupManufacturer;\n\nexport type RefreshValuesContext = CCAPIHost<\n\tCCAPINode & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n>;\n\nexport type PersistValuesContext =\n\t& HostIDs\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetDeviceConfig\n\t& GetNode<\n\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t>\n\t& LogNode;\n\nexport function getEffectiveCCVersion(\n\tctx: GetSupportedCCVersion,\n\tcc: CCId,\n\tdefaultVersion?: number,\n): number {\n\t// For multicast and broadcast CCs, just use the highest implemented version to serialize\n\t// Older nodes will ignore the additional fields\n\tif (\n\t\ttypeof cc.nodeId !== \"number\"\n\t\t|| cc.nodeId === NODE_ID_BROADCAST\n\t\t|| cc.nodeId === NODE_ID_BROADCAST_LR\n\t) {\n\t\treturn getImplementedVersion(cc.ccId);\n\t}\n\t// For singlecast CCs, set the CC version as high as possible\n\treturn ctx.getSupportedCCVersion(cc.ccId, cc.nodeId, cc.endpointIndex)\n\t\t|| (defaultVersion ?? getImplementedVersion(cc.ccId));\n}\n\nexport class CCRaw {\n\tpublic constructor(\n\t\tpublic ccId: CommandClasses,\n\t\tpublic ccCommand: number | undefined,\n\t\tpublic payload: Bytes,\n\t) {}\n\n\tpublic static parse(data: Uint8Array): CCRaw {\n\t\tconst { ccId, bytesRead: ccIdLength } = parseCCId(data);\n\t\t// There are so few exceptions that we can handle them here manually\n\t\tif (ccId === CommandClasses[\"No Operation\"]) {\n\t\t\treturn new CCRaw(ccId, undefined, new Bytes());\n\t\t}\n\t\tlet ccCommand: number | undefined = data[ccIdLength];\n\t\tlet payload = Bytes.view(data.subarray(ccIdLength + 1));\n\t\tif (ccId === CommandClasses[\"Transport Service\"]) {\n\t\t\t// Transport Service only uses the higher 5 bits for the command\n\t\t\t// and re-uses the lower 3 bits of the ccCommand as payload\n\t\t\tpayload = Bytes.concat([\n\t\t\t\tBytes.from([ccCommand & 0b111]),\n\t\t\t\tpayload,\n\t\t\t]);\n\t\t\tccCommand = ccCommand & 0b11111_000;\n\t\t} else if (ccId === CommandClasses[\"Manufacturer Proprietary\"]) {\n\t\t\t// ManufacturerProprietaryCC has no CC command, so the first\n\t\t\t// payload byte is stored in ccCommand.\n\t\t\tpayload = Bytes.concat([\n\t\t\t\tBytes.from([ccCommand]),\n\t\t\t\tpayload,\n\t\t\t]);\n\t\t\tccCommand = undefined;\n\t\t}\n\n\t\treturn new CCRaw(ccId, ccCommand, payload);\n\t}\n\n\tpublic withPayload(payload: Bytes): CCRaw {\n\t\treturn new CCRaw(this.ccId, this.ccCommand, payload);\n\t}\n}\n\n// @publicAPI\nexport class CommandClass implements CCId {\n\t// empty constructor to parse messages\n\tpublic constructor(options: CommandClassOptions) {\n\t\tconst {\n\t\t\tnodeId,\n\t\t\tendpointIndex = 0,\n\t\t\tccId = getCommandClass(this),\n\t\t\tccCommand = getCCCommand(this),\n\t\t\tpayload = new Uint8Array(),\n\t\t} = options;\n\n\t\tthis.nodeId = nodeId;\n\t\tthis.endpointIndex = endpointIndex;\n\t\tthis.ccId = ccId;\n\t\tthis.ccCommand = ccCommand;\n\t\tthis.payload = Bytes.view(payload);\n\t}\n\n\t/** @deprecated Use {@link parseAsync} instead */\n\tpublic static parse(\n\t\tdata: Uint8Array,\n\t\tctx: CCParsingContext,\n\t): CommandClass {\n\t\tconst raw = CCRaw.parse(data);\n\n\t\t// Find the correct subclass constructor to invoke\n\t\tconst CCConstructor = getCCConstructor(raw.ccId);\n\t\tif (!CCConstructor) {\n\t\t\t// None -> fall back to the default constructor\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\treturn CommandClass.from(raw, ctx);\n\t\t}\n\n\t\tlet CommandConstructor: CCConstructor<CommandClass> | undefined;\n\t\tif (raw.ccCommand != undefined) {\n\t\t\tCommandConstructor = getCCCommandConstructor(\n\t\t\t\traw.ccId,\n\t\t\t\traw.ccCommand,\n\t\t\t);\n\t\t}\n\t\t// Not every CC has a constructor for its commands. In that case,\n\t\t// call the CC constructor directly\n\t\ttry {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\treturn (CommandConstructor ?? CCConstructor).from(raw, ctx);\n\t\t} catch (e) {\n\t\t\t// Indicate invalid payloads with a special CC type\n\t\t\tif (\n\t\t\t\tisZWaveError(e)\n\t\t\t\t&& e.code === ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t) {\n\t\t\t\tconst ccName = CommandConstructor?.name\n\t\t\t\t\t?? `${getCCName(raw.ccId)} CC`;\n\n\t\t\t\t// Preserve why the command was invalid\n\t\t\t\tlet reason: string | ZWaveErrorCodes | undefined;\n\t\t\t\tif (\n\t\t\t\t\ttypeof e.context === \"string\"\n\t\t\t\t\t|| (typeof e.context === \"number\"\n\t\t\t\t\t\t&& ZWaveErrorCodes[e.context] != undefined)\n\t\t\t\t) {\n\t\t\t\t\treason = e.context;\n\t\t\t\t}\n\n\t\t\t\tconst ret = new InvalidCC({\n\t\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\t\tccId: raw.ccId,\n\t\t\t\t\tccCommand: raw.ccCommand,\n\t\t\t\t\tccName,\n\t\t\t\t\treason,\n\t\t\t\t});\n\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tpublic static async parseAsync(\n\t\tdata: Uint8Array,\n\t\tctx: CCParsingContext,\n\t): Promise<CommandClass> {\n\t\tconst raw = CCRaw.parse(data);\n\n\t\t// Find the correct subclass constructor to invoke\n\t\tconst CCConstructor = getCCConstructor(raw.ccId);\n\t\tif (!CCConstructor) {\n\t\t\t// None -> fall back to the default constructor\n\t\t\treturn CommandClass.fromAsync(raw, ctx);\n\t\t}\n\n\t\tlet CommandConstructor: CCConstructor<CommandClass> | undefined;\n\t\tif (raw.ccCommand != undefined) {\n\t\t\tCommandConstructor = getCCCommandConstructor(\n\t\t\t\traw.ccId,\n\t\t\t\traw.ccCommand,\n\t\t\t);\n\t\t}\n\t\t// Not every CC has a constructor for its commands. In that case,\n\t\t// call the CC constructor directly\n\t\ttry {\n\t\t\treturn await (CommandConstructor ?? CCConstructor).fromAsync(\n\t\t\t\traw,\n\t\t\t\tctx,\n\t\t\t);\n\t\t} catch (e) {\n\t\t\t// Indicate invalid payloads with a special CC type\n\t\t\tif (\n\t\t\t\tisZWaveError(e)\n\t\t\t\t&& e.code === ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t) {\n\t\t\t\tconst ccName = CommandConstructor?.name\n\t\t\t\t\t?? `${getCCName(raw.ccId)} CC`;\n\n\t\t\t\t// Preserve why the command was invalid\n\t\t\t\tlet reason: string | ZWaveErrorCodes | undefined;\n\t\t\t\tif (\n\t\t\t\t\ttypeof e.context === \"string\"\n\t\t\t\t\t|| (typeof e.context === \"number\"\n\t\t\t\t\t\t&& ZWaveErrorCodes[e.context] != undefined)\n\t\t\t\t) {\n\t\t\t\t\treason = e.context;\n\t\t\t\t}\n\n\t\t\t\tconst ret = new InvalidCC({\n\t\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\t\tccId: raw.ccId,\n\t\t\t\t\tccCommand: raw.ccCommand,\n\t\t\t\t\tccName,\n\t\t\t\t\treason,\n\t\t\t\t});\n\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\t/** @deprecated Use {@link fromAsync} instead */\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): CommandClass {\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tccId: raw.ccId,\n\t\t\tccCommand: raw.ccCommand,\n\t\t\tpayload: raw.payload,\n\t\t});\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic static async fromAsync(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): Promise<CommandClass> {\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn this.from(raw, ctx);\n\n\t\t// TODO: Plan for next major release:\n\t\t// - CommandClass ONLY exposes `public static async from` (renamed!)\n\t\t// - CommandClass internally implements `protected static fromSync` and `protected static async fromAsync`\n\t\t// - The default implementation of `fromAsync` just calls `fromSync`\n\t\t// - Sub-classes override either `fromSync` OR `fromAsync` as needed\n\t}\n\n\t/** This CC's identifier */\n\tpublic ccId!: CommandClasses;\n\tpublic ccCommand?: number;\n\tpublic get ccName(): string {\n\t\treturn getCCName(this.ccId);\n\t}\n\n\t/** The ID of the target node(s) */\n\tpublic nodeId!: number | MulticastDestination;\n\n\tpublic payload: Bytes;\n\n\t/** Which endpoint of the node this CC belongs to. 0 for the root device. */\n\tpublic endpointIndex: number;\n\n\t/**\n\t * Which encapsulation CCs this CC is/was/should be encapsulated with.\n\t *\n\t * Don't use this directly, this is used internally.\n\t */\n\tpublic encapsulationFlags: EncapsulationFlags = EncapsulationFlags.None;\n\n\t/** Activates or deactivates the given encapsulation flag(s) */\n\tpublic toggleEncapsulationFlag(\n\t\tflag: EncapsulationFlags,\n\t\tactive: boolean,\n\t): void {\n\t\tif (active) {\n\t\t\tthis.encapsulationFlags |= flag;\n\t\t} else {\n\t\t\tthis.encapsulationFlags &= ~flag;\n\t\t}\n\t}\n\n\t/** Contains a reference to the encapsulating CC if this CC is encapsulated */\n\tpublic encapsulatingCC?: EncapsulatingCommandClass;\n\n\t/** The type of Z-Wave frame this CC was sent with */\n\tpublic readonly frameType?: FrameType;\n\n\t/** Returns true if this CC is an extended CC (0xF100..0xFFFF) */\n\tpublic isExtended(): boolean {\n\t\treturn this.ccId >= 0xf100;\n\t}\n\n\t/** Whether the interview for this CC was previously completed */\n\tpublic isInterviewComplete(host: GetValueDB): boolean {\n\t\treturn !!this.getValueDB(host).getValue<boolean>({\n\t\t\tcommandClass: this.ccId,\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tproperty: \"interviewComplete\",\n\t\t});\n\t}\n\n\t/** Marks the interview for this CC as complete or not */\n\tpublic setInterviewComplete(\n\t\thost: GetValueDB,\n\t\tcomplete: boolean,\n\t): void {\n\t\tthis.getValueDB(host).setValue(\n\t\t\t{\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty: \"interviewComplete\",\n\t\t\t},\n\t\t\tcomplete,\n\t\t);\n\t}\n\n\t/**\n\t * Serializes this CommandClass to be embedded in a message payload or another CC\n\t * @deprecated Use {@link serializeAsync} instead\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\t// NoOp CCs have no command and no payload\n\t\tif (this.ccId === CommandClasses[\"No Operation\"]) {\n\t\t\treturn Bytes.from([this.ccId]);\n\t\t} else if (this.ccCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Command Class without a command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst payloadLength = this.payload.length;\n\t\tconst ccIdLength = this.isExtended() ? 2 : 1;\n\t\tconst data = new Bytes(ccIdLength + 1 + payloadLength);\n\t\tdata.writeUIntBE(this.ccId, 0, ccIdLength);\n\t\tdata[ccIdLength] = this.ccCommand;\n\t\tif (payloadLength > 0 /* implies payload != undefined */) {\n\t\t\tdata.set(this.payload, 1 + ccIdLength);\n\t\t}\n\t\treturn data;\n\t}\n\n\t/**\n\t * Serializes this CommandClass to be embedded in a message payload or another CC\n\t */\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async serializeAsync(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// This call is for backwards compatibility purposes. Not all\n\t\t// CC subclasses implement serializeAsync, so those need to internally\n\t\t// call serialize()\n\t\t// For those that do, we MUST not call the subclass' serialize method\n\t\t// directly, or the side effects may run twice.\n\t\tif (this.serializeAsync !== CommandClass.prototype.serializeAsync) {\n\t\t\t// Subclass implements serializeAsync, and we've reached the top\n\t\t\t// of the inheritance chain. Call CommandClass.serialize to finish.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\treturn CommandClass.prototype.serialize.call(this, ctx);\n\t\t} else {\n\t\t\t// Subclass does not implement serializeAsync, call its\n\t\t\t// serialize method instead\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\treturn this.serialize(ctx);\n\t\t}\n\n\t\t// TODO: Plan for next major release:\n\t\t// - CommandClass ONLY exposes `public async serialize` (renamed!)\n\t\t// - CommandClass internally implements `protected serializeSync` and `protected async serializeAsync`\n\t\t// - The default implementation of `serializeAsync` just calls `serializeSync`\n\t\t// - Sub-classes override either `serializeSync` OR `serializeAsync` as needed\n\t}\n\n\tpublic prepareRetransmission(): void {\n\t\t// Do nothing by default\n\t}\n\n\t/**\n\t * Create an instance of the given CC without checking whether it is supported.\n\t * If the CC is implemented, this returns an instance of the given CC which is linked to the given endpoint.\n\t *\n\t * **INTERNAL:** Applications should not use this directly.\n\t */\n\tpublic static createInstanceUnchecked<T extends CommandClass>(\n\t\tendpoint: EndpointId,\n\t\tcc: CommandClasses | CCConstructor<T>,\n\t): T | undefined {\n\t\tconst Constructor = typeof cc === \"number\" ? getCCConstructor(cc) : cc;\n\t\tif (Constructor) {\n\t\t\treturn new Constructor({\n\t\t\t\tnodeId: endpoint.nodeId,\n\t\t\t\tendpointIndex: endpoint.index,\n\t\t\t}) as T;\n\t\t}\n\t}\n\n\t/** Generates a representation of this CC for the log */\n\tpublic toLogEntry(_ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet tag = this.constructor.name;\n\t\tconst message: MessageRecord = {};\n\t\tif (this.constructor === CommandClass) {\n\t\t\ttag = `${\n\t\t\t\tgetEnumMemberName(\n\t\t\t\t\tCommandClasses,\n\t\t\t\t\tthis.ccId,\n\t\t\t\t)\n\t\t\t} CC (not implemented)`;\n\t\t\tif (this.ccCommand != undefined) {\n\t\t\t\tmessage.command = num2hex(this.ccCommand);\n\t\t\t}\n\t\t}\n\t\tif (this.payload.length > 0) {\n\t\t\tmessage.payload = buffer2hex(this.payload);\n\t\t}\n\t\treturn {\n\t\t\ttags: [tag],\n\t\t\tmessage,\n\t\t};\n\t}\n\n\t/** Generates the JSON representation of this CC */\n\tpublic toJSON(): JSONObject {\n\t\treturn this.toJSONInternal();\n\t}\n\n\tprivate toJSONInternal(): JSONObject {\n\t\tconst ret: JSONObject = {\n\t\t\tnodeId: this.nodeId,\n\t\t\tccId: CommandClasses[this.ccId] || num2hex(this.ccId),\n\t\t};\n\t\tif (this.ccCommand != undefined) {\n\t\t\tret.ccCommand = num2hex(this.ccCommand);\n\t\t}\n\t\tif (this.payload.length > 0) {\n\t\t\tret.payload = buffer2hex(this.payload);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprotected throwMissingCriticalInterviewResponse(): never {\n\t\tthrow new ZWaveError(\n\t\t\t`The node did not respond to a critical interview query in time.`,\n\t\t\tZWaveErrorCodes.Controller_NodeTimeout,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the interview procedure for this CC according to SDS14223\n\t */\n\tpublic async interview(_ctx: InterviewContext): Promise<void> {\n\t\t// This needs to be overwritten per command class. In the default implementation, don't do anything\n\t}\n\n\t/**\n\t * Refreshes all dynamic values of this CC\n\t */\n\tpublic async refreshValues(_ctx: RefreshValuesContext): Promise<void> {\n\t\t// This needs to be overwritten per command class. In the default implementation, don't do anything\n\t}\n\n\t/**\n\t * Checks if the CC values need to be manually refreshed.\n\t * This should be called regularly and when sleeping nodes wake up\n\t */\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\t_ctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// This needs to be overwritten per command class.\n\t\t// In the default implementation, don't require a refresh\n\t\treturn false;\n\t}\n\n\t/** Determines which CC interviews must be performed before this CC can be interviewed */\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// By default, all CCs require the VersionCC interview\n\n\t\t// There are two exceptions to this rule:\n\t\t// * ManufacturerSpecific must be interviewed first\n\t\t// * VersionCC itself must be done after that\n\t\t// These exceptions are defined in the overrides of this method of each corresponding CC\n\n\t\treturn [CommandClasses.Version];\n\t}\n\n\t/**\n\t * Whether the endpoint interview may be skipped by a CC. Can be overwritten by a subclass.\n\t */\n\tpublic skipEndpointInterview(): boolean {\n\t\t// By default no interview may be skipped\n\t\treturn false;\n\t}\n\n\t/**\n\t * Maps a BasicCC value to a more specific CC implementation. Returns true if the value was mapped, false otherwise.\n\t * @param _value The value of the received BasicCC\n\t */\n\tpublic setMappedBasicValue(\n\t\t_ctx: GetValueDB,\n\t\t_value: number,\n\t): boolean {\n\t\t// By default, don't map\n\t\treturn false;\n\t}\n\n\tpublic isSinglecast(): this is SinglecastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"singlecast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined\n\t\t\t\t&& typeof this.nodeId === \"number\"\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\tpublic isMulticast(): this is MulticastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"multicast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined && isArray(this.nodeId))\n\t\t);\n\t}\n\n\tpublic isBroadcast(): this is BroadcastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"broadcast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined\n\t\t\t\t&& (this.nodeId === NODE_ID_BROADCAST\n\t\t\t\t\t|| this.nodeId === NODE_ID_BROADCAST_LR))\n\t\t);\n\t}\n\n\t/**\n\t * Returns the node this CC is linked to. Throws if the controller is not yet ready.\n\t */\n\tpublic getNode<T extends NodeId>(\n\t\tctx: GetNode<T>,\n\t): T | undefined {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn ctx.getNode(this.nodeId);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t * Returns the node this CC is linked to (or undefined if the node doesn't exist)\n\t */\n\tpublic tryGetNode<T extends NodeId>(\n\t\tctx: GetNode<T>,\n\t): T | undefined {\n\t\ttry {\n\t\t\treturn this.getNode(ctx);\n\t\t} catch (e) {\n\t\t\t// This was expected\n\t\t\tif (isZWaveError(e) && e.code === ZWaveErrorCodes.Driver_NotReady) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// Something else happened\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tpublic getEndpoint<T extends EndpointId>(\n\t\tctx: GetNode<NodeId & GetEndpoint<T>>,\n\t): T | undefined {\n\t\treturn this.getNode(ctx)?.getEndpoint(this.endpointIndex);\n\t}\n\n\t/** Returns the value DB for this CC's node */\n\tprotected getValueDB(ctx: GetValueDB): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn ctx.getValueDB(this.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n\n\t/**\n\t * Ensures that the metadata for the given CC value exists in the Value DB or creates it if it does not.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t * @param meta Will be used in place of the predefined metadata when given\n\t */\n\tprotected ensureMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tmeta?: ValueMetadata,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tif (!valueDB.hasMetadata(valueId)) {\n\t\t\tvalueDB.setMetadata(valueId, meta ?? ccValue.meta);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the metadata for the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected removeMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setMetadata(valueId, undefined);\n\t}\n\n\t/**\n\t * Writes the metadata for the given CC value into the Value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t * @param meta Will be used in place of the predefined metadata when given\n\t */\n\tprotected setMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tmeta?: ValueMetadata,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setMetadata(valueId, meta ?? ccValue.meta);\n\t}\n\n\t/**\n\t * Reads the metadata for the given CC value from the Value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getMetadata<T extends ValueMetadata>(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): T | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getMetadata(valueId) as any;\n\t}\n\n\t/**\n\t * Stores the given value under the value ID for the given CC value in the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected setValue(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tvalue: unknown,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setValue(valueId, value);\n\t}\n\n\t/**\n\t * Removes the value for the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected removeValue(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.removeValue(valueId);\n\t}\n\n\t/**\n\t * Reads the value stored for the value ID of the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getValue<T>(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): T | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getValue(valueId);\n\t}\n\n\t/**\n\t * Reads when the value stored for the value ID of the given CC value was last updated in the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getValueTimestamp(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): number | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getTimestamp(valueId);\n\t}\n\n\t/** Returns the CC value definition for the current CC which matches the given value ID */\n\tprotected getCCValue(\n\t\tvalueId: ValueID,\n\t): StaticCCValue | DynamicCCValue | undefined {\n\t\tconst ccValues = getCCValues(this);\n\t\tif (!ccValues) return;\n\n\t\tfor (const value of Object.values(ccValues)) {\n\t\t\tif (value?.is(valueId)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getAllCCValues(): (StaticCCValue | DynamicCCValue)[] {\n\t\treturn Object.values(getCCValues(this) ?? {}) as (\n\t\t\t| StaticCCValue\n\t\t\t| DynamicCCValue\n\t\t)[];\n\t}\n\n\tprivate getCCValueForValueId(\n\t\tproperties: ValueIDProperties,\n\t): StaticCCValue | DynamicCCValue | undefined {\n\t\treturn this.getAllCCValues().find((value) =>\n\t\t\tvalue.is({\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t...properties,\n\t\t\t})\n\t\t);\n\t}\n\n\tprivate shouldAutoCreateValue(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tvalue: StaticCCValue,\n\t): boolean {\n\t\treturn (\n\t\t\tvalue.options.autoCreate === true\n\t\t\t|| (typeof value.options.autoCreate === \"function\"\n\t\t\t\t&& value.options.autoCreate(\n\t\t\t\t\tctx,\n\t\t\t\t\t{\n\t\t\t\t\t\tvirtual: false,\n\t\t\t\t\t\tnodeId: this.nodeId as number,\n\t\t\t\t\t\tindex: this.endpointIndex,\n\t\t\t\t\t},\n\t\t\t\t))\n\t\t);\n\t}\n\n\t/** Returns a list of all value names that are defined for this CommandClass */\n\tpublic getDefinedValueIDs(\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t\tincludeInternal: boolean = false,\n\t): ValueID[] {\n\t\t// In order to compare value ids, we need them to be strings\n\t\tconst ret = new Map<string, ValueID>();\n\n\t\tconst addValueId = (\n\t\t\tproperty: string | number,\n\t\t\tpropertyKey?: string | number,\n\t\t): void => {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tconst dbKey = valueIdToString(valueId);\n\t\t\tif (!ret.has(dbKey)) ret.set(dbKey, valueId);\n\t\t};\n\n\t\t// Return all value IDs for this CC...\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\t// ...which either have metadata or a value\n\t\tconst existingValueIds: ValueID[] = [\n\t\t\t...valueDB.getValues(this.ccId),\n\t\t\t...valueDB.getAllMetadata(this.ccId),\n\t\t];\n\n\t\t// To determine which value IDs to expose, we need to know the CC version\n\t\t// that we're doing this for\n\t\tconst supportedVersion = typeof this.nodeId === \"number\"\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST_LR\n\t\t\t// On singlecast CCs, use the version the node reported support for,\n\t\t\t? ctx.getSupportedCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.nodeId,\n\t\t\t\tthis.endpointIndex,\n\t\t\t)\n\t\t\t// on multicast/broadcast, use the highest version we implement\n\t\t\t: getImplementedVersion(this.ccId);\n\n\t\t// ...or which are statically defined using @ccValues(...)\n\t\tfor (const value of Object.values(getCCValues(this) ?? {})) {\n\t\t\t// Skip dynamic CC values - they need a specific subclass instance to be evaluated\n\t\t\tif (!value || typeof value === \"function\") continue;\n\n\t\t\t// Skip those values that are only supported in higher versions of the CC\n\t\t\tif (\n\t\t\t\tvalue.options.minVersion != undefined\n\t\t\t\t&& value.options.minVersion > supportedVersion\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip internal values\n\t\t\tif (value.options.internal && !includeInternal) continue;\n\n\t\t\t// And determine if this value should be automatically \"created\"\n\t\t\tif (!this.shouldAutoCreateValue(ctx, value)) continue;\n\n\t\t\texistingValueIds.push(value.endpoint(this.endpointIndex));\n\t\t}\n\n\t\t// TODO: this is a bit awkward for the statically defined ones\n\t\tconst ccValues = this.getAllCCValues();\n\t\tfor (const valueId of existingValueIds) {\n\t\t\t// ...belonging to the current endpoint\n\t\t\tif ((valueId.endpoint ?? 0) !== this.endpointIndex) continue;\n\n\t\t\t// Hard-coded: interviewComplete is always internal\n\t\t\tif (valueId.property === \"interviewComplete\") continue;\n\n\t\t\t// ... which don't have a CC value definition\n\t\t\t// ... or one that does not mark the value ID as internal\n\t\t\tconst ccValue = ccValues.find((value) => value.is(valueId));\n\t\t\tif (!ccValue || !ccValue.options.internal || includeInternal) {\n\t\t\t\taddValueId(valueId.property, valueId.propertyKey);\n\t\t\t}\n\t\t}\n\n\t\treturn [...ret.values()];\n\t}\n\n\t/** Determines if the given value is an internal value */\n\tpublic isInternalValue(properties: ValueIDProperties): boolean {\n\t\t// Hard-coded: interviewComplete is always internal\n\t\tif (properties.property === \"interviewComplete\") return true;\n\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.internal ?? defaultCCValueOptions.internal;\n\t}\n\n\t/** Determines if the given value is an secret value */\n\tpublic isSecretValue(properties: ValueIDProperties): boolean {\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.secret ?? defaultCCValueOptions.secret;\n\t}\n\n\t/** Determines if the given value should be persisted or represents an event */\n\tpublic isStatefulValue(properties: ValueIDProperties): boolean {\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.stateful ?? defaultCCValueOptions.stateful;\n\t}\n\n\t/**\n\t * Persists all values for this CC instance into the value DB which are annotated with @ccValue.\n\t * Returns `true` if the process succeeded, `false` if the value DB cannot be accessed.\n\t */\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tlet valueDB: ValueDB;\n\t\ttry {\n\t\t\tvalueDB = this.getValueDB(ctx);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\n\t\t// To determine which value IDs to expose, we need to know the CC version\n\t\t// that we're doing this for\n\t\tconst supportedVersion = ctx.getSupportedCCVersion(\n\t\t\tthis.ccId,\n\t\t\t// Values are only persisted for singlecast, so we know nodeId is a number\n\t\t\tthis.nodeId as number,\n\t\t\tthis.endpointIndex,\n\t\t\t// If the version isn't known yet, limit the created values to V1\n\t\t) || 1;\n\n\t\t// Get all properties of this CC which are annotated with a @ccValue decorator and store them.\n\t\tfor (const [prop, _value] of getCCValueProperties(this)) {\n\t\t\t// Evaluate dynamic CC values first\n\t\t\tconst value = typeof _value === \"function\" ? _value(this) : _value;\n\n\t\t\t// Skip those values that are only supported in higher versions of the CC\n\t\t\tif (\n\t\t\t\tvalue.options.minVersion != undefined\n\t\t\t\t&& value.options.minVersion > supportedVersion\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst valueId: ValueID = value.endpoint(this.endpointIndex);\n\t\t\tconst sourceValue = this[prop as keyof this];\n\n\t\t\t// Metadata gets created for non-internal values...\n\t\t\tconst createMetadata = !value.options.internal\n\t\t\t\t// ... but only if the value is included in the report we are persisting\n\t\t\t\t&& (sourceValue != undefined\n\t\t\t\t\t// ... or if we know which CC version the node supports\n\t\t\t\t\t// and the value may be automatically created\n\t\t\t\t\t|| (supportedVersion >= value.options.minVersion\n\t\t\t\t\t\t&& this.shouldAutoCreateValue(ctx, value)));\n\n\t\t\tif (createMetadata && !valueDB.hasMetadata(valueId)) {\n\t\t\t\tvalueDB.setMetadata(valueId, value.meta);\n\t\t\t}\n\n\t\t\t// The value only gets written if it is not undefined. null is a valid value!\n\t\t\tif (sourceValue === undefined) continue;\n\n\t\t\tvalueDB.setValue(valueId, sourceValue, {\n\t\t\t\tstateful: value.options.stateful,\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * When a CC supports to be split into multiple partial CCs, this can be used to identify the\n\t * session the partial CCs belong to.\n\t * If a CC expects `mergePartialCCs` to be always called, you should return an empty object here.\n\t */\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\treturn undefined; // Only select CCs support to be split\n\t}\n\n\t/**\n\t * When a CC supports to be split into multiple partial CCs, this indicates that the last report hasn't been received yet.\n\t * @param _session The previously received set of messages received in this partial CC session\n\t */\n\tpublic expectMoreMessages(_session: CommandClass[]): boolean {\n\t\treturn false; // By default, all CCs are monolithic\n\t}\n\n\t/**\n\t * Include previously received partial responses into a final CC\n\t * @deprecated Use {@link mergePartialCCsAsync} instead\n\t */\n\tpublic mergePartialCCs(\n\t\t_partials: CommandClass[],\n\t\t_ctx: CCParsingContext,\n\t): void {\n\t\t// This is highly CC dependent\n\t\t// Overwrite this in derived classes, by default do nothing\n\t}\n\n\t/** Include previously received partial responses into a final CC */\n\tpublic async mergePartialCCsAsync(\n\t\t_partials: CommandClass[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// This is highly CC dependent\n\t\t// Overwrite this in derived classes, by default do nothing\n\t}\n\n\t/** Tests whether this CC expects at least one command in return */\n\tpublic expectsCCResponse(): boolean {\n\t\tlet expected:\n\t\t\t| DynamicCCResponse<this>\n\t\t\t| ReturnType<DynamicCCResponse<this>> = getExpectedCCResponse(this);\n\n\t\t// Evaluate dynamic CC responses\n\t\tif (\n\t\t\ttypeof expected === \"function\"\n\t\t\t&& !staticExtends(expected, CommandClass)\n\t\t) {\n\t\t\texpected = expected(this);\n\t\t}\n\t\tif (expected === undefined) return false;\n\t\tif (isArray(expected)) {\n\t\t\treturn expected.every((cc) => staticExtends(cc, CommandClass));\n\t\t} else {\n\t\t\treturn staticExtends(expected, CommandClass);\n\t\t}\n\t}\n\n\tpublic isExpectedCCResponse(received: CommandClass): boolean {\n\t\tif (received.nodeId !== this.nodeId) return false;\n\n\t\tlet expected:\n\t\t\t| DynamicCCResponse<this>\n\t\t\t| ReturnType<DynamicCCResponse<this>> = getExpectedCCResponse(this);\n\n\t\t// Evaluate dynamic CC responses\n\t\tif (\n\t\t\ttypeof expected === \"function\"\n\t\t\t&& !staticExtends(expected, CommandClass)\n\t\t) {\n\t\t\texpected = expected(this);\n\t\t}\n\n\t\tif (expected == undefined) {\n\t\t\t// Fallback, should not happen if the expected response is defined correctly\n\t\t\treturn false;\n\t\t} else if (\n\t\t\tisArray(expected)\n\t\t\t&& expected.every((cc) => staticExtends(cc, CommandClass))\n\t\t) {\n\t\t\t// The CC always expects a response from the given list, check if the received\n\t\t\t// message is in that list\n\t\t\tif (expected.every((base) => !(received instanceof base))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (staticExtends(expected, CommandClass)) {\n\t\t\t// The CC always expects the same single response, check if this is the one\n\t\t\tif (!(received instanceof expected)) return false;\n\t\t}\n\n\t\t// If the CC wants to test the response, let it\n\t\tconst predicate = getCCResponsePredicate(this);\n\t\tconst ret = predicate?.(this, received) ?? true;\n\n\t\tif (ret === \"checkEncapsulated\") {\n\t\t\tif (\n\t\t\t\tisEncapsulatingCommandClass(this)\n\t\t\t\t&& isEncapsulatingCommandClass(received)\n\t\t\t) {\n\t\t\t\treturn this.encapsulated.isExpectedCCResponse(\n\t\t\t\t\treceived.encapsulated,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Fallback, should not happen if the expected response is defined correctly\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Translates a property identifier into a speaking name for use in an external API\n\t * @param property The property identifier that should be translated\n\t * @param _propertyKey The (optional) property key the translated name may depend on\n\t */\n\tpublic translateProperty(\n\t\t_ctx: GetValueDB,\n\t\tproperty: string | number,\n\t\t_propertyKey?: string | number,\n\t): string {\n\t\t// Overwrite this in derived classes, by default just return the property key\n\t\treturn property.toString();\n\t}\n\n\t/**\n\t * Translates a property key into a speaking name for use in an external API\n\t * @param _property The property the key in question belongs to\n\t * @param propertyKey The property key for which the speaking name should be retrieved\n\t */\n\tpublic translatePropertyKey(\n\t\t_ctx: GetValueDB,\n\t\t_property: string | number,\n\t\tpropertyKey: string | number,\n\t): string | undefined {\n\t\t// Overwrite this in derived classes, by default just return the property key\n\t\treturn propertyKey.toString();\n\t}\n\n\t/** Returns the number of bytes that are added to the payload by this CC */\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// Default is ccId (+ ccCommand):\n\t\treturn (this.isExtended() ? 2 : 1) + 1;\n\t}\n\n\t/** Computes the maximum net payload size that can be transmitted inside this CC */\n\tpublic getMaxPayloadLength(baseLength: number): number {\n\t\tlet ret = baseLength;\n\t\tlet cur: CommandClass | undefined = this;\n\t\twhile (cur) {\n\t\t\tret -= cur.computeEncapsulationOverhead();\n\t\t\tcur = isEncapsulatingCommandClass(cur)\n\t\t\t\t? cur.encapsulated\n\t\t\t\t: undefined;\n\t\t}\n\t\treturn ret;\n\t}\n\n\t/** Checks whether this CC is encapsulated with one that has the given CC id and (optionally) CC Command */\n\tpublic isEncapsulatedWith(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): boolean {\n\t\tlet cc: CommandClass = this;\n\t\t// Check whether there was a S0 encapsulation\n\t\twhile (cc.encapsulatingCC) {\n\t\t\tcc = cc.encapsulatingCC;\n\t\t\tif (\n\t\t\t\tcc.ccId === ccId\n\t\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Traverses the encapsulation stack of this CC outwards and returns the one that has the given CC id and (optionally) CC Command if that exists. */\n\tpublic getEncapsulatingCC(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): CommandClass | undefined {\n\t\tlet cc: CommandClass = this;\n\t\twhile (cc.encapsulatingCC) {\n\t\t\tcc = cc.encapsulatingCC;\n\t\t\tif (\n\t\t\t\tcc.ccId === ccId\n\t\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand)\n\t\t\t) {\n\t\t\t\treturn cc;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Traverses the encapsulation stack of this CC inwards and returns the one that has the given CC id and (optionally) CC Command if that exists. */\n\tpublic getEncapsulatedCC(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): CommandClass | undefined {\n\t\tconst predicate = (cc: CommandClass): boolean =>\n\t\t\tcc.ccId === ccId\n\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand);\n\n\t\tif (isEncapsulatingCommandClass(this)) {\n\t\t\tif (predicate(this.encapsulated)) return this.encapsulated;\n\t\t\treturn this.encapsulated.getEncapsulatedCC(ccId, ccCommand);\n\t\t} else if (isMultiEncapsulatingCommandClass(this)) {\n\t\t\tfor (const encapsulated of this.encapsulated) {\n\t\t\t\tif (predicate(encapsulated)) return encapsulated;\n\t\t\t\tconst ret = encapsulated.getEncapsulatedCC(ccId, ccCommand);\n\t\t\t\tif (ret) return ret;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface InvalidCCOptions extends CommandClassOptions {\n\tccName: string;\n\treason?: string | ZWaveErrorCodes;\n}\n\nexport class InvalidCC extends CommandClass {\n\tpublic constructor(options: InvalidCCOptions) {\n\t\tsuper(options);\n\t\tthis._ccName = options.ccName;\n\t\t// Numeric reasons are used internally to communicate problems with a CC\n\t\t// without ignoring them entirely\n\t\tthis.reason = options.reason;\n\t}\n\n\tprivate _ccName: string;\n\tpublic get ccName(): string {\n\t\treturn this._ccName;\n\t}\n\tpublic readonly reason?: string | ZWaveErrorCodes;\n\n\tpublic toLogEntry(_ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\ttags: [this.ccName, \"INVALID\"],\n\t\t\tmessage: this.reason != undefined\n\t\t\t\t? {\n\t\t\t\t\terror: typeof this.reason === \"string\"\n\t\t\t\t\t\t? this.reason\n\t\t\t\t\t\t: getEnumMemberName(\n\t\t\t\t\t\t\tZWaveErrorCodes,\n\t\t\t\t\t\t\tthis.reason,\n\t\t\t\t\t\t),\n\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t};\n\t}\n}\n\nexport type CCConstructor<T extends CommandClass> = typeof CommandClass & {\n\t// I don't like the any, but we need it to support half-implemented CCs (e.g. report classes)\n\tnew (options: any): T;\n};\n\n/**\n * @publicAPI\n * May be used to define different expected CC responses depending on the sent CC\n */\nexport type DynamicCCResponse<\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass = CommandClass,\n> = (\n\tsentCC: TSent,\n) => CCConstructor<TReceived> | CCConstructor<TReceived>[] | undefined;\n\n/** @publicAPI */\nexport type CCResponseRole =\n\t| boolean // The response was either expected or unexpected\n\t| \"checkEncapsulated\"; // The response role depends on the encapsulated CC\n\n/**\n * @publicAPI\n * A predicate function to test if a received CC matches the sent CC\n */\nexport type CCResponsePredicate<\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass = CommandClass,\n> = (sentCommand: TSent, receivedCommand: TReceived) => CCResponseRole;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAAA,kBAmCO;AAaP,oBAOO;AACP,wBAAwB;AAExB,oCAUO;AACP,uCAIO;AACP,oBAKO;AAyDD,SAAU,sBACf,KACA,IACA,gBAAuB;AAIvB,MACC,OAAO,GAAG,WAAW,YAClB,GAAG,WAAW,iCACd,GAAG,WAAW,kCAChB;AACD,eAAO,qDAAsB,GAAG,IAAI;EACrC;AAEA,SAAO,IAAI,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,MAChE,sBAAkB,qDAAsB,GAAG,IAAI;AACrD;AAjBgB;AAmBV,MAAO,MAAK;EA3JlB,OA2JkB;;;EAET;EACA;EACA;EAHR,YACQ,MACA,WACA,SAAc;AAFd,SAAA,OAAA;AACA,SAAA,YAAA;AACA,SAAA,UAAA;EACL;EAEI,OAAO,MAAM,MAAgB;AACnC,UAAM,EAAE,MAAM,WAAW,WAAU,QAAK,uBAAU,IAAI;AAEtD,QAAI,SAAS,2BAAe,cAAc,GAAG;AAC5C,aAAO,IAAI,MAAM,MAAM,QAAW,IAAI,oBAAK,CAAE;IAC9C;AACA,QAAI,YAAgC,KAAK,UAAU;AACnD,QAAI,UAAU,oBAAM,KAAK,KAAK,SAAS,aAAa,CAAC,CAAC;AACtD,QAAI,SAAS,2BAAe,mBAAmB,GAAG;AAGjD,gBAAU,oBAAM,OAAO;QACtB,oBAAM,KAAK,CAAC,YAAY,CAAK,CAAC;QAC9B;OACA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AAS,QAAQ;EACvB;EAEQ;EACR,IAAW,SAAM;AAChB,WAAO,KAAK;EACb;EACgB;EAET,WAAW,MAAiB;AAClC,WAAO;MACN,MAAM,CAAC,KAAK,QAAQ,SAAS;MAC7B,SAAS,KAAK,UAAU,SACrB;QACD,OAAO,OAAO,KAAK,WAAW,WAC3B,KAAK,aACL,iCACD,6BACA,KAAK,MAAM;UAGZ;;EAEL;;",
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\ttype GetDeviceConfig,\n\ttype LookupManufacturer,\n} from \"@zwave-js/config\";\nimport { type LogNode } from \"@zwave-js/core\";\nimport {\n\ttype BroadcastCC,\n\ttype CCAddress,\n\ttype CCId,\n\tCommandClasses,\n\ttype ControlsCC,\n\tEncapsulationFlags,\n\ttype EndpointId,\n\ttype FrameType,\n\ttype GetAllEndpoints,\n\ttype GetCCs,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ModifyCCs,\n\ttype MulticastCC,\n\ttype MulticastDestination,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\ttype NodeId,\n\ttype QueryNodeStatus,\n\ttype QuerySecurityClasses,\n\ttype SetSecurityClass,\n\ttype SinglecastCC,\n\ttype SupportsCC,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype ValueMetadata,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tisZWaveError,\n\tparseCCId,\n\tvalueIdToString,\n} from \"@zwave-js/core/safe\";\nimport {\n\tBytes,\n\ttype JSONObject,\n\tbuffer2hex,\n\tgetEnumMemberName,\n\tnum2hex,\n\tstaticExtends,\n} from \"@zwave-js/shared/safe\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport type { CCAPIHost, CCAPINode, ValueIDProperties } from \"./API.js\";\nimport {\n\tgetCCCommand,\n\tgetCCCommandConstructor,\n\tgetCCConstructor,\n\tgetCCResponsePredicate,\n\tgetCCValueProperties,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetExpectedCCResponse,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport {\n\ttype EncapsulatingCommandClass,\n\tisEncapsulatingCommandClass,\n\tisMultiEncapsulatingCommandClass,\n} from \"./EncapsulatingCommandClass.js\";\nimport {\n\ttype CCValue,\n\ttype DynamicCCValue,\n\ttype StaticCCValue,\n\tdefaultCCValueOptions,\n} from \"./Values.js\";\nimport { type GetInterviewOptions } from \"./traits.js\";\n\nexport interface CommandClassOptions extends CCAddress {\n\tccId?: number; // Used to overwrite the declared CC ID\n\tccCommand?: number; // undefined = NoOp\n\tpayload?: Uint8Array;\n}\n\n// Defines the necessary traits an endpoint passed to a CC instance must have\nexport type CCEndpoint =\n\t& EndpointId\n\t& SupportsCC\n\t& ControlsCC\n\t& GetCCs\n\t& ModifyCCs;\n\n// Defines the necessary traits a node passed to a CC instance must have\nexport type CCNode =\n\t& NodeId\n\t& SupportsCC\n\t& ControlsCC\n\t& GetCCs\n\t& GetEndpoint<CCEndpoint>\n\t& GetAllEndpoints<CCEndpoint>\n\t& QuerySecurityClasses\n\t& SetSecurityClass\n\t& ListenBehavior\n\t& QueryNodeStatus;\n\nexport type InterviewContext =\n\t& CCAPIHost<\n\t\t& CCAPINode\n\t\t& GetCCs\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& QuerySecurityClasses\n\t\t& SetSecurityClass\n\t\t& GetEndpoint<EndpointId & GetCCs & SupportsCC & ControlsCC & ModifyCCs>\n\t\t& GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>\n\t>\n\t& GetInterviewOptions\n\t& LookupManufacturer;\n\nexport type RefreshValuesContext = CCAPIHost<\n\tCCAPINode & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n>;\n\nexport type PersistValuesContext =\n\t& HostIDs\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetDeviceConfig\n\t& GetNode<\n\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t>\n\t& LogNode;\n\nexport function getEffectiveCCVersion(\n\tctx: GetSupportedCCVersion,\n\tcc: CCId,\n\tdefaultVersion?: number,\n): number {\n\t// For multicast and broadcast CCs, just use the highest implemented version to serialize\n\t// Older nodes will ignore the additional fields\n\tif (\n\t\ttypeof cc.nodeId !== \"number\"\n\t\t|| cc.nodeId === NODE_ID_BROADCAST\n\t\t|| cc.nodeId === NODE_ID_BROADCAST_LR\n\t) {\n\t\treturn getImplementedVersion(cc.ccId);\n\t}\n\t// For singlecast CCs, set the CC version as high as possible\n\treturn ctx.getSupportedCCVersion(cc.ccId, cc.nodeId, cc.endpointIndex)\n\t\t|| (defaultVersion ?? getImplementedVersion(cc.ccId));\n}\n\nexport class CCRaw {\n\tpublic constructor(\n\t\tpublic ccId: CommandClasses,\n\t\tpublic ccCommand: number | undefined,\n\t\tpublic payload: Bytes,\n\t) {}\n\n\tpublic static parse(data: Uint8Array): CCRaw {\n\t\tconst { ccId, bytesRead: ccIdLength } = parseCCId(data);\n\t\t// There are so few exceptions that we can handle them here manually\n\t\tif (ccId === CommandClasses[\"No Operation\"]) {\n\t\t\treturn new CCRaw(ccId, undefined, new Bytes());\n\t\t}\n\t\tlet ccCommand: number | undefined = data[ccIdLength];\n\t\tlet payload = Bytes.view(data.subarray(ccIdLength + 1));\n\t\tif (ccId === CommandClasses[\"Transport Service\"]) {\n\t\t\t// Transport Service only uses the higher 5 bits for the command\n\t\t\t// and re-uses the lower 3 bits of the ccCommand as payload\n\t\t\tpayload = Bytes.concat([\n\t\t\t\tBytes.from([ccCommand & 0b111]),\n\t\t\t\tpayload,\n\t\t\t]);\n\t\t\tccCommand = ccCommand & 0b11111_000;\n\t\t} else if (ccId === CommandClasses[\"Manufacturer Proprietary\"]) {\n\t\t\t// ManufacturerProprietaryCC has no CC command, so the first\n\t\t\t// payload byte is stored in ccCommand.\n\t\t\tpayload = Bytes.concat([\n\t\t\t\tBytes.from([ccCommand]),\n\t\t\t\tpayload,\n\t\t\t]);\n\t\t\tccCommand = undefined;\n\t\t}\n\n\t\treturn new CCRaw(ccId, ccCommand, payload);\n\t}\n\n\tpublic withPayload(payload: Bytes): CCRaw {\n\t\treturn new CCRaw(this.ccId, this.ccCommand, payload);\n\t}\n}\n\n// @publicAPI\nexport class CommandClass implements CCId {\n\t// empty constructor to parse messages\n\tpublic constructor(options: CommandClassOptions) {\n\t\tconst {\n\t\t\tnodeId,\n\t\t\tendpointIndex = 0,\n\t\t\tccId = getCommandClass(this),\n\t\t\tccCommand = getCCCommand(this),\n\t\t\tpayload = new Uint8Array(),\n\t\t} = options;\n\n\t\tthis.nodeId = nodeId;\n\t\tthis.endpointIndex = endpointIndex;\n\t\tthis.ccId = ccId;\n\t\tthis.ccCommand = ccCommand;\n\t\tthis.payload = Bytes.view(payload);\n\t}\n\n\tpublic static async parse(\n\t\tdata: Uint8Array,\n\t\tctx: CCParsingContext,\n\t): Promise<CommandClass> {\n\t\tconst raw = CCRaw.parse(data);\n\n\t\t// Find the correct subclass constructor to invoke\n\t\tconst CCConstructor = getCCConstructor(raw.ccId);\n\t\tif (!CCConstructor) {\n\t\t\t// None -> fall back to the default constructor\n\t\t\treturn await CommandClass.from(raw, ctx);\n\t\t}\n\n\t\tlet CommandConstructor: CCConstructor<CommandClass> | undefined;\n\t\tif (raw.ccCommand != undefined) {\n\t\t\tCommandConstructor = getCCCommandConstructor(\n\t\t\t\traw.ccId,\n\t\t\t\traw.ccCommand,\n\t\t\t);\n\t\t}\n\t\t// Not every CC has a constructor for its commands. In that case,\n\t\t// call the CC constructor directly\n\t\ttry {\n\t\t\treturn await (CommandConstructor ?? CCConstructor).from(raw, ctx);\n\t\t} catch (e) {\n\t\t\t// Indicate invalid payloads with a special CC type\n\t\t\tif (\n\t\t\t\tisZWaveError(e)\n\t\t\t\t&& e.code === ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t) {\n\t\t\t\tconst ccName = CommandConstructor?.name\n\t\t\t\t\t?? `${getCCName(raw.ccId)} CC`;\n\n\t\t\t\t// Preserve why the command was invalid\n\t\t\t\tlet reason: string | ZWaveErrorCodes | undefined;\n\t\t\t\tif (\n\t\t\t\t\ttypeof e.context === \"string\"\n\t\t\t\t\t|| (typeof e.context === \"number\"\n\t\t\t\t\t\t&& ZWaveErrorCodes[e.context] != undefined)\n\t\t\t\t) {\n\t\t\t\t\treason = e.context;\n\t\t\t\t}\n\n\t\t\t\tconst ret = new InvalidCC({\n\t\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\t\tccId: raw.ccId,\n\t\t\t\t\tccCommand: raw.ccCommand,\n\t\t\t\t\tccName,\n\t\t\t\t\treason,\n\t\t\t\t});\n\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CommandClass | Promise<CommandClass> {\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tccId: raw.ccId,\n\t\t\tccCommand: raw.ccCommand,\n\t\t\tpayload: raw.payload,\n\t\t});\n\t}\n\n\t/** This CC's identifier */\n\tpublic ccId!: CommandClasses;\n\tpublic ccCommand?: number;\n\tpublic get ccName(): string {\n\t\treturn getCCName(this.ccId);\n\t}\n\n\t/** The ID of the target node(s) */\n\tpublic nodeId!: number | MulticastDestination;\n\n\tpublic payload: Bytes;\n\n\t/** Which endpoint of the node this CC belongs to. 0 for the root device. */\n\tpublic endpointIndex: number;\n\n\t/**\n\t * Which encapsulation CCs this CC is/was/should be encapsulated with.\n\t *\n\t * Don't use this directly, this is used internally.\n\t */\n\tpublic encapsulationFlags: EncapsulationFlags = EncapsulationFlags.None;\n\n\t/** Activates or deactivates the given encapsulation flag(s) */\n\tpublic toggleEncapsulationFlag(\n\t\tflag: EncapsulationFlags,\n\t\tactive: boolean,\n\t): void {\n\t\tif (active) {\n\t\t\tthis.encapsulationFlags |= flag;\n\t\t} else {\n\t\t\tthis.encapsulationFlags &= ~flag;\n\t\t}\n\t}\n\n\t/** Contains a reference to the encapsulating CC if this CC is encapsulated */\n\tpublic encapsulatingCC?: EncapsulatingCommandClass;\n\n\t/** The type of Z-Wave frame this CC was sent with */\n\tpublic readonly frameType?: FrameType;\n\n\t/** Returns true if this CC is an extended CC (0xF100..0xFFFF) */\n\tpublic isExtended(): boolean {\n\t\treturn this.ccId >= 0xf100;\n\t}\n\n\t/** Whether the interview for this CC was previously completed */\n\tpublic isInterviewComplete(host: GetValueDB): boolean {\n\t\treturn !!this.getValueDB(host).getValue<boolean>({\n\t\t\tcommandClass: this.ccId,\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tproperty: \"interviewComplete\",\n\t\t});\n\t}\n\n\t/** Marks the interview for this CC as complete or not */\n\tpublic setInterviewComplete(\n\t\thost: GetValueDB,\n\t\tcomplete: boolean,\n\t): void {\n\t\tthis.getValueDB(host).setValue(\n\t\t\t{\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty: \"interviewComplete\",\n\t\t\t},\n\t\t\tcomplete,\n\t\t);\n\t}\n\n\t/**\n\t * Serializes this CommandClass to be embedded in a message payload or another CC\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/require-await\n\tpublic async serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// NoOp CCs have no command and no payload\n\t\tif (this.ccId === CommandClasses[\"No Operation\"]) {\n\t\t\treturn Bytes.from([this.ccId]);\n\t\t} else if (this.ccCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Command Class without a command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst payloadLength = this.payload.length;\n\t\tconst ccIdLength = this.isExtended() ? 2 : 1;\n\t\tconst data = new Bytes(ccIdLength + 1 + payloadLength);\n\t\tdata.writeUIntBE(this.ccId, 0, ccIdLength);\n\t\tdata[ccIdLength] = this.ccCommand;\n\t\tif (payloadLength > 0 /* implies payload != undefined */) {\n\t\t\tdata.set(this.payload, 1 + ccIdLength);\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic prepareRetransmission(): void {\n\t\t// Do nothing by default\n\t}\n\n\t/**\n\t * Create an instance of the given CC without checking whether it is supported.\n\t * If the CC is implemented, this returns an instance of the given CC which is linked to the given endpoint.\n\t *\n\t * **INTERNAL:** Applications should not use this directly.\n\t */\n\tpublic static createInstanceUnchecked<T extends CommandClass>(\n\t\tendpoint: EndpointId,\n\t\tcc: CommandClasses | CCConstructor<T>,\n\t): T | undefined {\n\t\tconst Constructor = typeof cc === \"number\" ? getCCConstructor(cc) : cc;\n\t\tif (Constructor) {\n\t\t\treturn new Constructor({\n\t\t\t\tnodeId: endpoint.nodeId,\n\t\t\t\tendpointIndex: endpoint.index,\n\t\t\t}) as T;\n\t\t}\n\t}\n\n\t/** Generates a representation of this CC for the log */\n\tpublic toLogEntry(_ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet tag = this.constructor.name;\n\t\tconst message: MessageRecord = {};\n\t\tif (this.constructor === CommandClass) {\n\t\t\ttag = `${\n\t\t\t\tgetEnumMemberName(\n\t\t\t\t\tCommandClasses,\n\t\t\t\t\tthis.ccId,\n\t\t\t\t)\n\t\t\t} CC (not implemented)`;\n\t\t\tif (this.ccCommand != undefined) {\n\t\t\t\tmessage.command = num2hex(this.ccCommand);\n\t\t\t}\n\t\t}\n\t\tif (this.payload.length > 0) {\n\t\t\tmessage.payload = buffer2hex(this.payload);\n\t\t}\n\t\treturn {\n\t\t\ttags: [tag],\n\t\t\tmessage,\n\t\t};\n\t}\n\n\t/** Generates the JSON representation of this CC */\n\tpublic toJSON(): JSONObject {\n\t\treturn this.toJSONInternal();\n\t}\n\n\tprivate toJSONInternal(): JSONObject {\n\t\tconst ret: JSONObject = {\n\t\t\tnodeId: this.nodeId,\n\t\t\tccId: CommandClasses[this.ccId] || num2hex(this.ccId),\n\t\t};\n\t\tif (this.ccCommand != undefined) {\n\t\t\tret.ccCommand = num2hex(this.ccCommand);\n\t\t}\n\t\tif (this.payload.length > 0) {\n\t\t\tret.payload = buffer2hex(this.payload);\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprotected throwMissingCriticalInterviewResponse(): never {\n\t\tthrow new ZWaveError(\n\t\t\t`The node did not respond to a critical interview query in time.`,\n\t\t\tZWaveErrorCodes.Controller_NodeTimeout,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the interview procedure for this CC according to SDS14223\n\t */\n\tpublic async interview(_ctx: InterviewContext): Promise<void> {\n\t\t// This needs to be overwritten per command class. In the default implementation, don't do anything\n\t}\n\n\t/**\n\t * Refreshes all dynamic values of this CC\n\t */\n\tpublic async refreshValues(_ctx: RefreshValuesContext): Promise<void> {\n\t\t// This needs to be overwritten per command class. In the default implementation, don't do anything\n\t}\n\n\t/**\n\t * Checks if the CC values need to be manually refreshed.\n\t * This should be called regularly and when sleeping nodes wake up\n\t */\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\t_ctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// This needs to be overwritten per command class.\n\t\t// In the default implementation, don't require a refresh\n\t\treturn false;\n\t}\n\n\t/** Determines which CC interviews must be performed before this CC can be interviewed */\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// By default, all CCs require the VersionCC interview\n\n\t\t// There are two exceptions to this rule:\n\t\t// * ManufacturerSpecific must be interviewed first\n\t\t// * VersionCC itself must be done after that\n\t\t// These exceptions are defined in the overrides of this method of each corresponding CC\n\n\t\treturn [CommandClasses.Version];\n\t}\n\n\t/**\n\t * Whether the endpoint interview may be skipped by a CC. Can be overwritten by a subclass.\n\t */\n\tpublic skipEndpointInterview(): boolean {\n\t\t// By default no interview may be skipped\n\t\treturn false;\n\t}\n\n\t/**\n\t * Maps a BasicCC value to a more specific CC implementation. Returns true if the value was mapped, false otherwise.\n\t * @param _value The value of the received BasicCC\n\t */\n\tpublic setMappedBasicValue(\n\t\t_ctx: GetValueDB,\n\t\t_value: number,\n\t): boolean {\n\t\t// By default, don't map\n\t\treturn false;\n\t}\n\n\tpublic isSinglecast(): this is SinglecastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"singlecast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined\n\t\t\t\t&& typeof this.nodeId === \"number\"\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\tpublic isMulticast(): this is MulticastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"multicast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined && isArray(this.nodeId))\n\t\t);\n\t}\n\n\tpublic isBroadcast(): this is BroadcastCC<this> {\n\t\treturn (\n\t\t\t// received\n\t\t\tthis.frameType === \"broadcast\"\n\t\t\t// transmitted\n\t\t\t|| (this.frameType == undefined\n\t\t\t\t&& (this.nodeId === NODE_ID_BROADCAST\n\t\t\t\t\t|| this.nodeId === NODE_ID_BROADCAST_LR))\n\t\t);\n\t}\n\n\t/**\n\t * Returns the node this CC is linked to. Throws if the controller is not yet ready.\n\t */\n\tpublic getNode<T extends NodeId>(\n\t\tctx: GetNode<T>,\n\t): T | undefined {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn ctx.getNode(this.nodeId);\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t * Returns the node this CC is linked to (or undefined if the node doesn't exist)\n\t */\n\tpublic tryGetNode<T extends NodeId>(\n\t\tctx: GetNode<T>,\n\t): T | undefined {\n\t\ttry {\n\t\t\treturn this.getNode(ctx);\n\t\t} catch (e) {\n\t\t\t// This was expected\n\t\t\tif (isZWaveError(e) && e.code === ZWaveErrorCodes.Driver_NotReady) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t// Something else happened\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tpublic getEndpoint<T extends EndpointId>(\n\t\tctx: GetNode<NodeId & GetEndpoint<T>>,\n\t): T | undefined {\n\t\treturn this.getNode(ctx)?.getEndpoint(this.endpointIndex);\n\t}\n\n\t/** Returns the value DB for this CC's node */\n\tprotected getValueDB(ctx: GetValueDB): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn ctx.getValueDB(this.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n\n\t/**\n\t * Ensures that the metadata for the given CC value exists in the Value DB or creates it if it does not.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t * @param meta Will be used in place of the predefined metadata when given\n\t */\n\tprotected ensureMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tmeta?: ValueMetadata,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tif (!valueDB.hasMetadata(valueId)) {\n\t\t\tvalueDB.setMetadata(valueId, meta ?? ccValue.meta);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the metadata for the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected removeMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setMetadata(valueId, undefined);\n\t}\n\n\t/**\n\t * Writes the metadata for the given CC value into the Value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t * @param meta Will be used in place of the predefined metadata when given\n\t */\n\tprotected setMetadata(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tmeta?: ValueMetadata,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setMetadata(valueId, meta ?? ccValue.meta);\n\t}\n\n\t/**\n\t * Reads the metadata for the given CC value from the Value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getMetadata<T extends ValueMetadata>(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): T | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getMetadata(valueId) as any;\n\t}\n\n\t/**\n\t * Stores the given value under the value ID for the given CC value in the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected setValue(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t\tvalue: unknown,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.setValue(valueId, value);\n\t}\n\n\t/**\n\t * Removes the value for the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected removeValue(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\tvalueDB.removeValue(valueId);\n\t}\n\n\t/**\n\t * Reads the value stored for the value ID of the given CC value from the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getValue<T>(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): T | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getValue(valueId);\n\t}\n\n\t/**\n\t * Reads when the value stored for the value ID of the given CC value was last updated in the value DB.\n\t * The endpoint index of the current CC instance is automatically taken into account.\n\t */\n\tprotected getValueTimestamp(\n\t\tctx: GetValueDB,\n\t\tccValue: CCValue,\n\t): number | undefined {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\tconst valueId = ccValue.endpoint(this.endpointIndex);\n\t\treturn valueDB.getTimestamp(valueId);\n\t}\n\n\t/** Returns the CC value definition for the current CC which matches the given value ID */\n\tprotected getCCValue(\n\t\tvalueId: ValueID,\n\t): StaticCCValue | DynamicCCValue | undefined {\n\t\tconst ccValues = getCCValues(this);\n\t\tif (!ccValues) return;\n\n\t\tfor (const value of Object.values(ccValues)) {\n\t\t\tif (value?.is(valueId)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getAllCCValues(): (StaticCCValue | DynamicCCValue)[] {\n\t\treturn Object.values(getCCValues(this) ?? {}) as (\n\t\t\t| StaticCCValue\n\t\t\t| DynamicCCValue\n\t\t)[];\n\t}\n\n\tprivate getCCValueForValueId(\n\t\tproperties: ValueIDProperties,\n\t): StaticCCValue | DynamicCCValue | undefined {\n\t\treturn this.getAllCCValues().find((value) =>\n\t\t\tvalue.is({\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t...properties,\n\t\t\t})\n\t\t);\n\t}\n\n\tprivate shouldAutoCreateValue(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tvalue: StaticCCValue,\n\t): boolean {\n\t\treturn (\n\t\t\tvalue.options.autoCreate === true\n\t\t\t|| (typeof value.options.autoCreate === \"function\"\n\t\t\t\t&& value.options.autoCreate(\n\t\t\t\t\tctx,\n\t\t\t\t\t{\n\t\t\t\t\t\tvirtual: false,\n\t\t\t\t\t\tnodeId: this.nodeId as number,\n\t\t\t\t\t\tindex: this.endpointIndex,\n\t\t\t\t\t},\n\t\t\t\t))\n\t\t);\n\t}\n\n\t/** Returns a list of all value names that are defined for this CommandClass */\n\tpublic getDefinedValueIDs(\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t\tincludeInternal: boolean = false,\n\t): ValueID[] {\n\t\t// In order to compare value ids, we need them to be strings\n\t\tconst ret = new Map<string, ValueID>();\n\n\t\tconst addValueId = (\n\t\t\tproperty: string | number,\n\t\t\tpropertyKey?: string | number,\n\t\t): void => {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tconst dbKey = valueIdToString(valueId);\n\t\t\tif (!ret.has(dbKey)) ret.set(dbKey, valueId);\n\t\t};\n\n\t\t// Return all value IDs for this CC...\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\t// ...which either have metadata or a value\n\t\tconst existingValueIds: ValueID[] = [\n\t\t\t...valueDB.getValues(this.ccId),\n\t\t\t...valueDB.getAllMetadata(this.ccId),\n\t\t];\n\n\t\t// To determine which value IDs to expose, we need to know the CC version\n\t\t// that we're doing this for\n\t\tconst supportedVersion = typeof this.nodeId === \"number\"\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t&& this.nodeId !== NODE_ID_BROADCAST_LR\n\t\t\t// On singlecast CCs, use the version the node reported support for,\n\t\t\t? ctx.getSupportedCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.nodeId,\n\t\t\t\tthis.endpointIndex,\n\t\t\t)\n\t\t\t// on multicast/broadcast, use the highest version we implement\n\t\t\t: getImplementedVersion(this.ccId);\n\n\t\t// ...or which are statically defined using @ccValues(...)\n\t\tfor (const value of Object.values(getCCValues(this) ?? {})) {\n\t\t\t// Skip dynamic CC values - they need a specific subclass instance to be evaluated\n\t\t\tif (!value || typeof value === \"function\") continue;\n\n\t\t\t// Skip those values that are only supported in higher versions of the CC\n\t\t\tif (\n\t\t\t\tvalue.options.minVersion != undefined\n\t\t\t\t&& value.options.minVersion > supportedVersion\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip internal values\n\t\t\tif (value.options.internal && !includeInternal) continue;\n\n\t\t\t// And determine if this value should be automatically \"created\"\n\t\t\tif (!this.shouldAutoCreateValue(ctx, value)) continue;\n\n\t\t\texistingValueIds.push(value.endpoint(this.endpointIndex));\n\t\t}\n\n\t\t// TODO: this is a bit awkward for the statically defined ones\n\t\tconst ccValues = this.getAllCCValues();\n\t\tfor (const valueId of existingValueIds) {\n\t\t\t// ...belonging to the current endpoint\n\t\t\tif ((valueId.endpoint ?? 0) !== this.endpointIndex) continue;\n\n\t\t\t// Hard-coded: interviewComplete is always internal\n\t\t\tif (valueId.property === \"interviewComplete\") continue;\n\n\t\t\t// ... which don't have a CC value definition\n\t\t\t// ... or one that does not mark the value ID as internal\n\t\t\tconst ccValue = ccValues.find((value) => value.is(valueId));\n\t\t\tif (!ccValue || !ccValue.options.internal || includeInternal) {\n\t\t\t\taddValueId(valueId.property, valueId.propertyKey);\n\t\t\t}\n\t\t}\n\n\t\treturn [...ret.values()];\n\t}\n\n\t/** Determines if the given value is an internal value */\n\tpublic isInternalValue(properties: ValueIDProperties): boolean {\n\t\t// Hard-coded: interviewComplete is always internal\n\t\tif (properties.property === \"interviewComplete\") return true;\n\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.internal ?? defaultCCValueOptions.internal;\n\t}\n\n\t/** Determines if the given value is an secret value */\n\tpublic isSecretValue(properties: ValueIDProperties): boolean {\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.secret ?? defaultCCValueOptions.secret;\n\t}\n\n\t/** Determines if the given value should be persisted or represents an event */\n\tpublic isStatefulValue(properties: ValueIDProperties): boolean {\n\t\tconst ccValue = this.getCCValueForValueId(properties);\n\t\treturn ccValue?.options.stateful ?? defaultCCValueOptions.stateful;\n\t}\n\n\t/**\n\t * Persists all values for this CC instance into the value DB which are annotated with @ccValue.\n\t * Returns `true` if the process succeeded, `false` if the value DB cannot be accessed.\n\t */\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tlet valueDB: ValueDB;\n\t\ttry {\n\t\t\tvalueDB = this.getValueDB(ctx);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\n\t\t// To determine which value IDs to expose, we need to know the CC version\n\t\t// that we're doing this for\n\t\tconst supportedVersion = ctx.getSupportedCCVersion(\n\t\t\tthis.ccId,\n\t\t\t// Values are only persisted for singlecast, so we know nodeId is a number\n\t\t\tthis.nodeId as number,\n\t\t\tthis.endpointIndex,\n\t\t\t// If the version isn't known yet, limit the created values to V1\n\t\t) || 1;\n\n\t\t// Get all properties of this CC which are annotated with a @ccValue decorator and store them.\n\t\tfor (const [prop, _value] of getCCValueProperties(this)) {\n\t\t\t// Evaluate dynamic CC values first\n\t\t\tconst value = typeof _value === \"function\" ? _value(this) : _value;\n\n\t\t\t// Skip those values that are only supported in higher versions of the CC\n\t\t\tif (\n\t\t\t\tvalue.options.minVersion != undefined\n\t\t\t\t&& value.options.minVersion > supportedVersion\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst valueId: ValueID = value.endpoint(this.endpointIndex);\n\t\t\tconst sourceValue = this[prop as keyof this];\n\n\t\t\t// Metadata gets created for non-internal values...\n\t\t\tconst createMetadata = !value.options.internal\n\t\t\t\t// ... but only if the value is included in the report we are persisting\n\t\t\t\t&& (sourceValue != undefined\n\t\t\t\t\t// ... or if we know which CC version the node supports\n\t\t\t\t\t// and the value may be automatically created\n\t\t\t\t\t|| (supportedVersion >= value.options.minVersion\n\t\t\t\t\t\t&& this.shouldAutoCreateValue(ctx, value)));\n\n\t\t\tif (createMetadata && !valueDB.hasMetadata(valueId)) {\n\t\t\t\tvalueDB.setMetadata(valueId, value.meta);\n\t\t\t}\n\n\t\t\t// The value only gets written if it is not undefined. null is a valid value!\n\t\t\tif (sourceValue === undefined) continue;\n\n\t\t\tvalueDB.setValue(valueId, sourceValue, {\n\t\t\t\tstateful: value.options.stateful,\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * When a CC supports to be split into multiple partial CCs, this can be used to identify the\n\t * session the partial CCs belong to.\n\t * If a CC expects `mergePartialCCs` to be always called, you should return an empty object here.\n\t */\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\treturn undefined; // Only select CCs support to be split\n\t}\n\n\t/**\n\t * When a CC supports to be split into multiple partial CCs, this indicates that the last report hasn't been received yet.\n\t * @param _session The previously received set of messages received in this partial CC session\n\t */\n\tpublic expectMoreMessages(_session: CommandClass[]): boolean {\n\t\treturn false; // By default, all CCs are monolithic\n\t}\n\n\t/** Include previously received partial responses into a final CC */\n\tpublic async mergePartialCCs(\n\t\t_partials: CommandClass[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// This is highly CC dependent\n\t\t// Overwrite this in derived classes, by default do nothing\n\t}\n\n\t/** Tests whether this CC expects at least one command in return */\n\tpublic expectsCCResponse(): boolean {\n\t\tlet expected:\n\t\t\t| DynamicCCResponse<this>\n\t\t\t| ReturnType<DynamicCCResponse<this>> = getExpectedCCResponse(this);\n\n\t\t// Evaluate dynamic CC responses\n\t\tif (\n\t\t\ttypeof expected === \"function\"\n\t\t\t&& !staticExtends(expected, CommandClass)\n\t\t) {\n\t\t\texpected = expected(this);\n\t\t}\n\t\tif (expected === undefined) return false;\n\t\tif (isArray(expected)) {\n\t\t\treturn expected.every((cc) => staticExtends(cc, CommandClass));\n\t\t} else {\n\t\t\treturn staticExtends(expected, CommandClass);\n\t\t}\n\t}\n\n\tpublic isExpectedCCResponse(received: CommandClass): boolean {\n\t\tif (received.nodeId !== this.nodeId) return false;\n\n\t\tlet expected:\n\t\t\t| DynamicCCResponse<this>\n\t\t\t| ReturnType<DynamicCCResponse<this>> = getExpectedCCResponse(this);\n\n\t\t// Evaluate dynamic CC responses\n\t\tif (\n\t\t\ttypeof expected === \"function\"\n\t\t\t&& !staticExtends(expected, CommandClass)\n\t\t) {\n\t\t\texpected = expected(this);\n\t\t}\n\n\t\tif (expected == undefined) {\n\t\t\t// Fallback, should not happen if the expected response is defined correctly\n\t\t\treturn false;\n\t\t} else if (\n\t\t\tisArray(expected)\n\t\t\t&& expected.every((cc) => staticExtends(cc, CommandClass))\n\t\t) {\n\t\t\t// The CC always expects a response from the given list, check if the received\n\t\t\t// message is in that list\n\t\t\tif (expected.every((base) => !(received instanceof base))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (staticExtends(expected, CommandClass)) {\n\t\t\t// The CC always expects the same single response, check if this is the one\n\t\t\tif (!(received instanceof expected)) return false;\n\t\t}\n\n\t\t// If the CC wants to test the response, let it\n\t\tconst predicate = getCCResponsePredicate(this);\n\t\tconst ret = predicate?.(this, received) ?? true;\n\n\t\tif (ret === \"checkEncapsulated\") {\n\t\t\tif (\n\t\t\t\tisEncapsulatingCommandClass(this)\n\t\t\t\t&& isEncapsulatingCommandClass(received)\n\t\t\t) {\n\t\t\t\treturn this.encapsulated.isExpectedCCResponse(\n\t\t\t\t\treceived.encapsulated,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Fallback, should not happen if the expected response is defined correctly\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Translates a property identifier into a speaking name for use in an external API\n\t * @param property The property identifier that should be translated\n\t * @param _propertyKey The (optional) property key the translated name may depend on\n\t */\n\tpublic translateProperty(\n\t\t_ctx: GetValueDB,\n\t\tproperty: string | number,\n\t\t_propertyKey?: string | number,\n\t): string {\n\t\t// Overwrite this in derived classes, by default just return the property key\n\t\treturn property.toString();\n\t}\n\n\t/**\n\t * Translates a property key into a speaking name for use in an external API\n\t * @param _property The property the key in question belongs to\n\t * @param propertyKey The property key for which the speaking name should be retrieved\n\t */\n\tpublic translatePropertyKey(\n\t\t_ctx: GetValueDB,\n\t\t_property: string | number,\n\t\tpropertyKey: string | number,\n\t): string | undefined {\n\t\t// Overwrite this in derived classes, by default just return the property key\n\t\treturn propertyKey.toString();\n\t}\n\n\t/** Returns the number of bytes that are added to the payload by this CC */\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// Default is ccId (+ ccCommand):\n\t\treturn (this.isExtended() ? 2 : 1) + 1;\n\t}\n\n\t/** Computes the maximum net payload size that can be transmitted inside this CC */\n\tpublic getMaxPayloadLength(baseLength: number): number {\n\t\tlet ret = baseLength;\n\t\tlet cur: CommandClass | undefined = this;\n\t\twhile (cur) {\n\t\t\tret -= cur.computeEncapsulationOverhead();\n\t\t\tcur = isEncapsulatingCommandClass(cur)\n\t\t\t\t? cur.encapsulated\n\t\t\t\t: undefined;\n\t\t}\n\t\treturn ret;\n\t}\n\n\t/** Checks whether this CC is encapsulated with one that has the given CC id and (optionally) CC Command */\n\tpublic isEncapsulatedWith(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): boolean {\n\t\tlet cc: CommandClass = this;\n\t\t// Check whether there was a S0 encapsulation\n\t\twhile (cc.encapsulatingCC) {\n\t\t\tcc = cc.encapsulatingCC;\n\t\t\tif (\n\t\t\t\tcc.ccId === ccId\n\t\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Traverses the encapsulation stack of this CC outwards and returns the one that has the given CC id and (optionally) CC Command if that exists. */\n\tpublic getEncapsulatingCC(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): CommandClass | undefined {\n\t\tlet cc: CommandClass = this;\n\t\twhile (cc.encapsulatingCC) {\n\t\t\tcc = cc.encapsulatingCC;\n\t\t\tif (\n\t\t\t\tcc.ccId === ccId\n\t\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand)\n\t\t\t) {\n\t\t\t\treturn cc;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Traverses the encapsulation stack of this CC inwards and returns the one that has the given CC id and (optionally) CC Command if that exists. */\n\tpublic getEncapsulatedCC(\n\t\tccId: CommandClasses,\n\t\tccCommand?: number,\n\t): CommandClass | undefined {\n\t\tconst predicate = (cc: CommandClass): boolean =>\n\t\t\tcc.ccId === ccId\n\t\t\t&& (ccCommand === undefined || cc.ccCommand === ccCommand);\n\n\t\tif (isEncapsulatingCommandClass(this)) {\n\t\t\tif (predicate(this.encapsulated)) return this.encapsulated;\n\t\t\treturn this.encapsulated.getEncapsulatedCC(ccId, ccCommand);\n\t\t} else if (isMultiEncapsulatingCommandClass(this)) {\n\t\t\tfor (const encapsulated of this.encapsulated) {\n\t\t\t\tif (predicate(encapsulated)) return encapsulated;\n\t\t\t\tconst ret = encapsulated.getEncapsulatedCC(ccId, ccCommand);\n\t\t\t\tif (ret) return ret;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface InvalidCCOptions extends CommandClassOptions {\n\tccName: string;\n\treason?: string | ZWaveErrorCodes;\n}\n\nexport class InvalidCC extends CommandClass {\n\tpublic constructor(options: InvalidCCOptions) {\n\t\tsuper(options);\n\t\tthis._ccName = options.ccName;\n\t\t// Numeric reasons are used internally to communicate problems with a CC\n\t\t// without ignoring them entirely\n\t\tthis.reason = options.reason;\n\t}\n\n\tprivate _ccName: string;\n\tpublic get ccName(): string {\n\t\treturn this._ccName;\n\t}\n\tpublic readonly reason?: string | ZWaveErrorCodes;\n\n\tpublic toLogEntry(_ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\ttags: [this.ccName, \"INVALID\"],\n\t\t\tmessage: this.reason != undefined\n\t\t\t\t? {\n\t\t\t\t\terror: typeof this.reason === \"string\"\n\t\t\t\t\t\t? this.reason\n\t\t\t\t\t\t: getEnumMemberName(\n\t\t\t\t\t\t\tZWaveErrorCodes,\n\t\t\t\t\t\t\tthis.reason,\n\t\t\t\t\t\t),\n\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t};\n\t}\n}\n\nexport type CCConstructor<T extends CommandClass> = typeof CommandClass & {\n\t// I don't like the any, but we need it to support half-implemented CCs (e.g. report classes)\n\tnew (options: any): T;\n};\n\n/**\n * @publicAPI\n * May be used to define different expected CC responses depending on the sent CC\n */\nexport type DynamicCCResponse<\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass = CommandClass,\n> = (\n\tsentCC: TSent,\n) => CCConstructor<TReceived> | CCConstructor<TReceived>[] | undefined;\n\n/** @publicAPI */\nexport type CCResponseRole =\n\t| boolean // The response was either expected or unexpected\n\t| \"checkEncapsulated\"; // The response role depends on the encapsulated CC\n\n/**\n * @publicAPI\n * A predicate function to test if a received CC matches the sent CC\n */\nexport type CCResponsePredicate<\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass = CommandClass,\n> = (sentCommand: TSent, receivedCommand: TReceived) => CCResponseRole;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;AAAA,kBAuCO;AACP,IAAAA,eAOO;AACP,wBAAwB;AAExB,oCAUO;AACP,uCAIO;AACP,oBAKO;AA0DD,SAAU,sBACf,KACA,IACA,gBAAuB;AAIvB,MACC,OAAO,GAAG,WAAW,YAClB,GAAG,WAAW,iCACd,GAAG,WAAW,kCAChB;AACD,eAAO,qDAAsB,GAAG,IAAI;EACrC;AAEA,SAAO,IAAI,sBAAsB,GAAG,MAAM,GAAG,QAAQ,G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SAAS,SACR,cAAc,UAAa,GAAG,cAAc,YAC/C;AACD,eAAO;MACR;IACD;AACA,WAAO;EACR;;EAGO,mBACN,MACA,WAAkB;AAElB,QAAI,KAAmB;AACvB,WAAO,GAAG,iBAAiB;AAC1B,WAAK,GAAG;AACR,UACC,GAAG,SAAS,SACR,cAAc,UAAa,GAAG,cAAc,YAC/C;AACD,eAAO;MACR;IACD;EACD;;EAGO,kBACN,MACA,WAAkB;AAElB,UAAM,YAAY,wBAAC,OAClB,GAAG,SAAS,SACR,cAAc,UAAa,GAAG,cAAc,YAF/B;AAIlB,YAAI,8DAA4B,IAAI,GAAG;AACtC,UAAI,UAAU,KAAK,YAAY;AAAG,eAAO,KAAK;AAC9C,aAAO,KAAK,aAAa,kBAAkB,MAAM,SAAS;IAC3D,eAAW,mEAAiC,IAAI,GAAG;AAClD,iBAAW,gBAAgB,KAAK,cAAc;AAC7C,YAAI,UAAU,YAAY;AAAG,iBAAO;AACpC,cAAM,MAAM,aAAa,kBAAkB,MAAM,SAAS;AAC1D,YAAI;AAAK,iBAAO;MACjB;IACD;EACD;;AAQK,MAAO,kBAAkB,aAAY;EAtnC3C,OAsnC2C;;;EAC1C,YAAmB,SAAyB;AAC3C,UAAM,OAAO;AACb,SAAK,UAAU,QAAQ;AAGvB,SAAK,SAAS,QAAQ;EACvB;EAEQ;EACR,IAAW,SAAM;AAChB,WAAO,KAAK;EACb;EACgB;EAET,WAAW,MAAiB;AAClC,WAAO;MACN,MAAM,CAAC,KAAK,QAAQ,SAAS;MAC7B,SAAS,KAAK,UAAU,SACrB;QACD,OAAO,OAAO,KAAK,WAAW,WAC3B,KAAK,aACL,gCACD,6BACA,KAAK,MAAM;UAGZ;;EAEL;;",
|
|
6
|
+
"names": ["import_safe"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandClasses } from "@zwave-js/core";
|
|
1
|
+
import { type CommandClasses } from "@zwave-js/core/safe";
|
|
2
2
|
import type { TypedClassDecorator } from "@zwave-js/shared";
|
|
3
3
|
import type { APIConstructor, CCAPI } from "./API.js";
|
|
4
4
|
import { type CCConstructor, type CCResponsePredicate, type CommandClass, type DynamicCCResponse } from "./CommandClass.js";
|
|
@@ -42,8 +42,8 @@ __export(CommandClassDecorators_exports, {
|
|
|
42
42
|
useSupervision: () => useSupervision
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(CommandClassDecorators_exports);
|
|
45
|
-
var import_core = require("@zwave-js/core");
|
|
46
45
|
var import_reflection = require("@zwave-js/core/reflection");
|
|
46
|
+
var import_safe = require("@zwave-js/core/safe");
|
|
47
47
|
const CCAndCommandDecorator = (0, import_reflection.createReflectionDecoratorPair)({ superName: "ccId", subName: "ccCommand" });
|
|
48
48
|
const commandClass = CCAndCommandDecorator.superDecorator;
|
|
49
49
|
const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;
|
|
@@ -53,7 +53,7 @@ const getCCCommandConstructor = CCAndCommandDecorator.lookupSubConstructor;
|
|
|
53
53
|
function getCommandClassStatic(classConstructor) {
|
|
54
54
|
const ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);
|
|
55
55
|
if (ret == void 0) {
|
|
56
|
-
throw new
|
|
56
|
+
throw new import_safe.ZWaveError(`No command class defined for ${classConstructor.name}!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
57
57
|
}
|
|
58
58
|
return ret;
|
|
59
59
|
}
|
|
@@ -71,7 +71,7 @@ function getCommandClass(cc) {
|
|
|
71
71
|
const constr = cc.constructor;
|
|
72
72
|
const ret = CCAndCommandDecorator.lookupSuperValueStatic(constr) ?? apiDecorator.lookupValueStatic(constr);
|
|
73
73
|
if (ret == void 0) {
|
|
74
|
-
throw new
|
|
74
|
+
throw new import_safe.ZWaveError(`No command class defined for ${constr.name}!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
75
75
|
}
|
|
76
76
|
return ret;
|
|
77
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/CommandClassDecorators.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n} from \"@zwave-js/core\";\nimport {\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core/reflection\";\nimport type { TypedClassDecorator } from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport {\n\ttype CCConstructor,\n\ttype CCResponsePredicate,\n\ttype CommandClass,\n\ttype DynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\ttypeof CommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\ttypeof CCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(\n\t\tconstr as typeof CommandClass,\n\t)\n\t\t?? apiDecorator.lookupValueStatic(constr as typeof CCAPI);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTTarget extends typeof CommandClass,\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<TTarget> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export function ccValue<TTarget extends CommandClass>(\n// \tvalue: StaticCCValue,\n// ): TypedPropertyDecorator<TTarget>;\n\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \tvalue: DynamicCCValue<TArgs>,\n// \tgetArgs: (self: TTarget) => Readonly<TArgs>,\n// ): TypedPropertyDecorator<TTarget>;\n\n// // Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// // target type in the getArgs function then.\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \t...args:\n// \t\t| [value: StaticCCValue]\n// \t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n// ): TypedPropertyDecorator<TTarget> {\n// \t// Normalize the arguments to the expected format\n// \tdebugger;\n// \tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n// \tif (args.length === 1) {\n// \t\tvalueOrFactory = args[0];\n// \t} else {\n// \t\tconst [value, getArgs] = args;\n// \t\tvalueOrFactory = (self: TTarget) => {\n// \t\t\tconst args = getArgs(self);\n// \t\t\tconst base = value(...args);\n// \t\t\treturn {\n// \t\t\t\t...base,\n// \t\t\t\tis: value.is,\n// \t\t\t\toptions: value.options,\n// \t\t\t};\n// \t\t};\n// \t}\n\n// \treturn function decoratorBody_ccValue(\n// \t\ttarget: TTarget,\n// \t\tproperty: string | number | symbol,\n// \t): void {\n// \t\t// get the class constructor\n// \t\tconst constr = target.constructor;\n\n// \t\t// retrieve the current metadata\n// \t\tconst metadata: Map<\n// \t\t\tstring | number,\n// \t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n// \t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n// \t\t// Add the variable\n// \t\tmetadata.set(property as string | number, valueOrFactory);\n\n// \t\t// And store it back\n// \t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n// \t};\n// }\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: StaticCCValue,\n): TypedClassDecorator<Class>;\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: InstanceType<Class>) => TArgs,\n): TypedClassDecorator<Class>;\n\n/**\n * @publicAPI\n * Defines which CC values the properties of a Z-Wave Command Class correspond to\n */\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [\n\t\t\tvalue: DynamicCCValue<TArgs>,\n\t\t\tgetArgs: (self: InstanceType<Class>) => TArgs,\n\t\t]\n): TypedClassDecorator<Class> {\n\treturn function decorator_ccValueProperty(constr: Class): void {\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<InstanceType<Class>>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Determine the correct metadata\n\t\tlet valueOrFactory:\n\t\t\t| StaticCCValue\n\t\t\t| StaticCCValueFactory<InstanceType<Class>>;\n\t\tif (args.length === 1) {\n\t\t\tvalueOrFactory = args[0];\n\t\t} else {\n\t\t\tconst [value, getArgs] = args;\n\t\t\tvalueOrFactory = (self: InstanceType<Class>) => {\n\t\t\t\tconst args = getArgs(self);\n\t\t\t\tconst base = value(...args);\n\t\t\t\treturn {\n\t\t\t\t\t...base,\n\t\t\t\t\tis: value.is,\n\t\t\t\t\toptions: value.options,\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\t// Add the metadata\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<\n\ttypeof CommandClass\n>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
4
|
+
"sourcesContent": ["import {\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core/reflection\";\nimport {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n} from \"@zwave-js/core/safe\";\nimport type { TypedClassDecorator } from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport {\n\ttype CCConstructor,\n\ttype CCResponsePredicate,\n\ttype CommandClass,\n\ttype DynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\ttypeof CommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\ttypeof CCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(\n\t\tconstr as typeof CommandClass,\n\t)\n\t\t?? apiDecorator.lookupValueStatic(constr as typeof CCAPI);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTTarget extends typeof CommandClass,\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<TTarget> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export function ccValue<TTarget extends CommandClass>(\n// \tvalue: StaticCCValue,\n// ): TypedPropertyDecorator<TTarget>;\n\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \tvalue: DynamicCCValue<TArgs>,\n// \tgetArgs: (self: TTarget) => Readonly<TArgs>,\n// ): TypedPropertyDecorator<TTarget>;\n\n// // Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// // target type in the getArgs function then.\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \t...args:\n// \t\t| [value: StaticCCValue]\n// \t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n// ): TypedPropertyDecorator<TTarget> {\n// \t// Normalize the arguments to the expected format\n// \tdebugger;\n// \tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n// \tif (args.length === 1) {\n// \t\tvalueOrFactory = args[0];\n// \t} else {\n// \t\tconst [value, getArgs] = args;\n// \t\tvalueOrFactory = (self: TTarget) => {\n// \t\t\tconst args = getArgs(self);\n// \t\t\tconst base = value(...args);\n// \t\t\treturn {\n// \t\t\t\t...base,\n// \t\t\t\tis: value.is,\n// \t\t\t\toptions: value.options,\n// \t\t\t};\n// \t\t};\n// \t}\n\n// \treturn function decoratorBody_ccValue(\n// \t\ttarget: TTarget,\n// \t\tproperty: string | number | symbol,\n// \t): void {\n// \t\t// get the class constructor\n// \t\tconst constr = target.constructor;\n\n// \t\t// retrieve the current metadata\n// \t\tconst metadata: Map<\n// \t\t\tstring | number,\n// \t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n// \t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n// \t\t// Add the variable\n// \t\tmetadata.set(property as string | number, valueOrFactory);\n\n// \t\t// And store it back\n// \t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n// \t};\n// }\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: StaticCCValue,\n): TypedClassDecorator<Class>;\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: InstanceType<Class>) => TArgs,\n): TypedClassDecorator<Class>;\n\n/**\n * @publicAPI\n * Defines which CC values the properties of a Z-Wave Command Class correspond to\n */\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [\n\t\t\tvalue: DynamicCCValue<TArgs>,\n\t\t\tgetArgs: (self: InstanceType<Class>) => TArgs,\n\t\t]\n): TypedClassDecorator<Class> {\n\treturn function decorator_ccValueProperty(constr: Class): void {\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<InstanceType<Class>>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Determine the correct metadata\n\t\tlet valueOrFactory:\n\t\t\t| StaticCCValue\n\t\t\t| StaticCCValueFactory<InstanceType<Class>>;\n\t\tif (args.length === 1) {\n\t\t\tvalueOrFactory = args[0];\n\t\t} else {\n\t\t\tconst [value, getArgs] = args;\n\t\t\tvalueOrFactory = (self: InstanceType<Class>) => {\n\t\t\t\tconst args = getArgs(self);\n\t\t\t\tconst base = value(...args);\n\t\t\t\treturn {\n\t\t\t\t\t...base,\n\t\t\t\t\tis: value.is,\n\t\t\t\t\toptions: value.options,\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\t// Add the metadata\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<\n\ttypeof CommandClass\n>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAIO;AACP,kBAIO;AAeP,MAAM,4BAAwB,iDAK5B,EAAE,WAAW,QAAQ,SAAS,YAAW,CAAE;AAMtC,MAAM,eAAe,sBAAsB;AAM3C,MAAM,mBAAmB,sBAAsB;AAM/C,MAAM,YAAY,sBAAsB;AAMxC,MAAM,eAAe,sBAAsB;AAM3C,MAAM,0BACZ,sBAAsB;AAMjB,SA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B,qBAAqB;",
|
|
6
6
|
"names": ["args"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type
|
|
1
|
+
import { type GetDeviceConfig } from "@zwave-js/config";
|
|
2
|
+
import { type CommandClasses, type EndpointId, type GetValueDB, type ValueID, type ValueMetadata } from "@zwave-js/core/safe";
|
|
3
3
|
import { type FnOrStatic, type ReturnTypeOrStatic } from "@zwave-js/shared/safe";
|
|
4
|
-
import type { Overwrite } from "alcalzone-shared/types";
|
|
5
4
|
import type { ValueIDProperties } from "./API.js";
|
|
5
|
+
declare function defineCCValues<T extends CommandClasses>(commandClass: T, _: Record<string, CCValueBlueprint | DynamicCCValueBlueprint<any[]>>): typeof import("../cc/_CCValues.generated.js").CCValues[T];
|
|
6
6
|
export interface CCValueOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Whether the CC value is internal. Internal values are not exposed to the user.
|
|
@@ -36,7 +36,6 @@ export declare const defaultCCValueOptions: {
|
|
|
36
36
|
readonly supportsEndpoints: true;
|
|
37
37
|
readonly autoCreate: true;
|
|
38
38
|
};
|
|
39
|
-
type DefaultOptions = typeof defaultCCValueOptions;
|
|
40
39
|
export type ExpandRecursively<T> = T extends (...args: infer A) => infer R ? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R> : ((...args: A) => ExpandRecursively<R>) & {
|
|
41
40
|
[P in keyof T]: ExpandRecursively<T[P]>;
|
|
42
41
|
} : T extends object ? T extends infer O ? {
|
|
@@ -47,34 +46,19 @@ export type ExpandRecursivelySkipMeta<T> = T extends (...args: infer A) => infer
|
|
|
47
46
|
} : T extends ValueMetadata ? T : T extends object ? T extends infer O ? {
|
|
48
47
|
[K in keyof O]: ExpandRecursivelySkipMeta<O[K]>;
|
|
49
48
|
} : never : T;
|
|
50
|
-
type InferValueIDBase<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint, TWorker = {
|
|
51
|
-
commandClass: TCommandClass;
|
|
52
|
-
} & Pick<TBlueprint, "property" | "propertyKey">> = {
|
|
53
|
-
[K in keyof TWorker as unknown extends TWorker[K] ? never : K]: TWorker[K];
|
|
54
|
-
};
|
|
55
|
-
type ToStaticCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, CCValueBlueprint>> = Readonly<{
|
|
56
|
-
[K in keyof TValues]: ExpandRecursively<InferStaticCCValue<TCommandClass, TValues[K]>>;
|
|
57
|
-
}>;
|
|
58
|
-
type ToDynamicCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>> = Readonly<{
|
|
59
|
-
[K in keyof TValues]: ExpandRecursively<InferDynamicCCValue<TCommandClass, TValues[K]>>;
|
|
60
|
-
}>;
|
|
61
49
|
type InferArgs<T extends FnOrStatic<any, any>[]> = T extends [
|
|
62
50
|
(...args: infer A) => any,
|
|
63
51
|
...any
|
|
64
52
|
] ? A : T extends [any, ...infer R] ? InferArgs<R> : [];
|
|
65
53
|
export declare const V: {
|
|
66
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
67
|
-
defineStaticCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, CCValueBlueprint>>(commandClass: TCommandClass, values: TValues): TValues extends Record<keyof TValues, CCValueBlueprint> ? ExpandRecursively<ToStaticCCValues<TCommandClass, TValues>> : never;
|
|
68
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
69
|
-
defineDynamicCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>>(commandClass: TCommandClass, values: TValues): TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>> ? ExpandRecursively<ToDynamicCCValues<TCommandClass, TValues>> : never;
|
|
70
54
|
/** Returns a CC value definition that is named like the value `property` */
|
|
71
|
-
staticProperty<TProp extends string | number, TMeta extends ValueMetadata, TOptions extends CCValueOptions>(property: TProp, meta?: TMeta, options?: TOptions): { [K in TProp]: {
|
|
55
|
+
staticProperty<TProp extends string | number, const TMeta extends ValueMetadata, const TOptions extends CCValueOptions>(property: TProp, meta?: TMeta, options?: TOptions): { [K in TProp]: {
|
|
72
56
|
property: TProp;
|
|
73
57
|
meta: TMeta;
|
|
74
58
|
options: TOptions;
|
|
75
59
|
}; };
|
|
76
60
|
/** Returns a CC value definition with the given name and `property` */
|
|
77
|
-
staticPropertyWithName<TName extends string, TProp extends string | number, TMeta extends ValueMetadata, TOptions extends CCValueOptions>(name: TName, property: TProp, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
61
|
+
staticPropertyWithName<TName extends string, TProp extends string | number, const TMeta extends ValueMetadata, const TOptions extends CCValueOptions>(name: TName, property: TProp, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
78
62
|
property: TProp;
|
|
79
63
|
meta: TMeta;
|
|
80
64
|
options: TOptions;
|
|
@@ -96,7 +80,7 @@ export declare const V: {
|
|
|
96
80
|
options: TOptions;
|
|
97
81
|
}; };
|
|
98
82
|
/** Returns a CC value definition with the given name and a dynamic `property` */
|
|
99
|
-
dynamicPropertyAndKeyWithName<TName extends string, TProp extends FnOrStatic<any[], ValueIDProperties["property"]>, TKey extends FnOrStatic<any[], ValueIDProperties["propertyKey"]>,
|
|
83
|
+
dynamicPropertyAndKeyWithName<TName extends string, TProp extends FnOrStatic<any[], ValueIDProperties["property"]>, TKey extends FnOrStatic<any[], ValueIDProperties["propertyKey"]>, TOptions extends CCValueOptions, TMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata>(name: TName, property: TProp, propertyKey: TKey, is: PartialCCValuePredicate, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
100
84
|
(...args: InferArgs<[TProp, TKey, TMeta]>): {
|
|
101
85
|
property: ReturnTypeOrStatic<TProp>;
|
|
102
86
|
propertyKey: ReturnTypeOrStatic<TKey>;
|
|
@@ -105,6 +89,7 @@ export declare const V: {
|
|
|
105
89
|
is: PartialCCValuePredicate;
|
|
106
90
|
options: TOptions;
|
|
107
91
|
}; };
|
|
92
|
+
defineCCValues: typeof defineCCValues;
|
|
108
93
|
};
|
|
109
94
|
export interface CCValueBlueprint extends Readonly<ValueIDProperties> {
|
|
110
95
|
readonly meta?: Readonly<ValueMetadata>;
|
|
@@ -118,106 +103,22 @@ export interface DynamicCCValueBlueprint<TArgs extends any[]> {
|
|
|
118
103
|
is: PartialCCValuePredicate;
|
|
119
104
|
readonly options?: Readonly<CCValueOptions>;
|
|
120
105
|
}
|
|
121
|
-
type DropOptional<T> = {
|
|
122
|
-
[K in keyof T as [undefined] extends [T[K]] ? never : K]: T[K];
|
|
123
|
-
};
|
|
124
|
-
type MergeOptions<TOptions extends CCValueOptions> = DropOptional<CCValueOptions extends TOptions ? DefaultOptions : Overwrite<DefaultOptions, TOptions>>;
|
|
125
|
-
type MergeMeta<TMeta extends ValueMetadata> = DropOptional<ValueMetadata extends TMeta ? (typeof ValueMetadata)["Any"] : Overwrite<(typeof ValueMetadata)["Any"], TMeta>>;
|
|
126
106
|
/** The common base type of all CC value definitions */
|
|
127
107
|
export interface CCValue {
|
|
128
108
|
readonly id: Omit<ValueID, "endpoint">;
|
|
129
109
|
endpoint(endpoint?: number): ValueID;
|
|
130
110
|
readonly meta: ValueMetadata;
|
|
131
111
|
}
|
|
132
|
-
type AddCCValueProperties<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint, ValueIDBase extends Record<string, any> = InferValueIDBase<TCommandClass, TBlueprint>> = {
|
|
133
|
-
/** Returns the value ID of this CC value, without endpoint information */
|
|
134
|
-
get id(): ValueIDBase;
|
|
135
|
-
/** Returns the value ID, specialized to the given endpoint */
|
|
136
|
-
endpoint(endpoint?: number): Readonly<Pick<ValueIDBase, "commandClass"> & {
|
|
137
|
-
endpoint: number;
|
|
138
|
-
} & Omit<ValueIDBase, "commandClass">>;
|
|
139
|
-
/** Whether the given value ID matches this value definition */
|
|
140
|
-
is: CCValuePredicate;
|
|
141
|
-
/** Returns the metadata for this value ID */
|
|
142
|
-
get meta(): Readonly<MergeMeta<NonNullable<TBlueprint["meta"]>>>;
|
|
143
|
-
/** Returns the value options for this value ID */
|
|
144
|
-
get options(): Readonly<MergeOptions<NonNullable<TBlueprint["options"]>>>;
|
|
145
|
-
};
|
|
146
|
-
/** A CC value definition which depends on one or more parameters, transparently inferred from its arguments */
|
|
147
|
-
export type InferDynamicCCValue<TCommandClass extends CommandClasses, TBlueprint extends DynamicCCValueBlueprint<any[]>> = TBlueprint extends DynamicCCValueBlueprint<infer TArgs> ? {
|
|
148
|
-
(...args: TArgs): Omit<InferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>, "options" | "is">;
|
|
149
|
-
/** Whether the given value ID matches this value definition */
|
|
150
|
-
is: CCValuePredicate;
|
|
151
|
-
readonly options: InferStaticCCValue<TCommandClass, ReturnType<TBlueprint> & {
|
|
152
|
-
options: TBlueprint["options"];
|
|
153
|
-
}>["options"];
|
|
154
|
-
} : never;
|
|
155
|
-
/** A static or evaluated CC value definition, transparently inferred from its arguments */
|
|
156
|
-
export type InferStaticCCValue<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint> = Readonly<AddCCValueProperties<TCommandClass, TBlueprint>>;
|
|
157
|
-
/** The generic variant of {@link InferStaticCCValue}, without inferring arguments */
|
|
158
112
|
export interface StaticCCValue extends CCValue {
|
|
159
113
|
/** Whether the given value ID matches this value definition */
|
|
160
114
|
is: CCValuePredicate;
|
|
161
115
|
readonly options: Required<CCValueOptions>;
|
|
162
116
|
}
|
|
163
|
-
/** The generic variant of {@link InferDynamicCCValue}, without inferring arguments */
|
|
164
117
|
export type DynamicCCValue<TArgs extends any[] = any[]> = ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue> & {
|
|
165
118
|
/** Whether the given value ID matches this value definition */
|
|
166
119
|
is: CCValuePredicate;
|
|
167
120
|
readonly options: Required<CCValueOptions>;
|
|
168
121
|
};
|
|
169
122
|
export type StaticCCValueFactory<T> = (self: T) => StaticCCValue;
|
|
170
|
-
export interface CCValues {
|
|
171
|
-
"Alarm Sensor": typeof import("../cc/AlarmSensorCC.js").AlarmSensorCCValues;
|
|
172
|
-
Association: typeof import("../cc/AssociationCC.js").AssociationCCValues;
|
|
173
|
-
"Association Group Information": typeof import("../cc/AssociationGroupInfoCC.js").AssociationGroupInfoCCValues;
|
|
174
|
-
"Barrier Operator": typeof import("../cc/BarrierOperatorCC.js").BarrierOperatorCCValues;
|
|
175
|
-
Basic: typeof import("../cc/BasicCC.js").BasicCCValues;
|
|
176
|
-
Battery: typeof import("../cc/BatteryCC.js").BatteryCCValues;
|
|
177
|
-
"Binary Sensor": typeof import("../cc/BinarySensorCC.js").BinarySensorCCValues;
|
|
178
|
-
"Binary Switch": typeof import("../cc/BinarySwitchCC.js").BinarySwitchCCValues;
|
|
179
|
-
"Central Scene": typeof import("../cc/CentralSceneCC.js").CentralSceneCCValues;
|
|
180
|
-
"Climate Control Schedule": typeof import("../cc/ClimateControlScheduleCC.js").ClimateControlScheduleCCValues;
|
|
181
|
-
"Color Switch": typeof import("../cc/ColorSwitchCC.js").ColorSwitchCCValues;
|
|
182
|
-
Configuration: typeof import("../cc/ConfigurationCC.js").ConfigurationCCValues;
|
|
183
|
-
"Door Lock": typeof import("../cc/DoorLockCC.js").DoorLockCCValues;
|
|
184
|
-
"Door Lock Logging": typeof import("../cc/DoorLockLoggingCC.js").DoorLockLoggingCCValues;
|
|
185
|
-
"Energy Production": typeof import("../cc/EnergyProductionCC.js").EnergyProductionCCValues;
|
|
186
|
-
"Entry Control": typeof import("../cc/EntryControlCC.js").EntryControlCCValues;
|
|
187
|
-
"Firmware Update Meta Data": typeof import("../cc/FirmwareUpdateMetaDataCC.js").FirmwareUpdateMetaDataCCValues;
|
|
188
|
-
"Humidity Control Mode": typeof import("../cc/HumidityControlModeCC.js").HumidityControlModeCCValues;
|
|
189
|
-
"Humidity Control Operating State": typeof import("../cc/HumidityControlOperatingStateCC.js").HumidityControlOperatingStateCCValues;
|
|
190
|
-
"Humidity Control Setpoint": typeof import("../cc/HumidityControlSetpointCC.js").HumidityControlSetpointCCValues;
|
|
191
|
-
Indicator: typeof import("../cc/IndicatorCC.js").IndicatorCCValues;
|
|
192
|
-
Irrigation: typeof import("../cc/IrrigationCC.js").IrrigationCCValues;
|
|
193
|
-
Language: typeof import("../cc/LanguageCC.js").LanguageCCValues;
|
|
194
|
-
Lock: typeof import("../cc/LockCC.js").LockCCValues;
|
|
195
|
-
"Manufacturer Specific": typeof import("../cc/ManufacturerSpecificCC.js").ManufacturerSpecificCCValues;
|
|
196
|
-
Meter: typeof import("../cc/MeterCC.js").MeterCCValues;
|
|
197
|
-
"Multi Channel Association": typeof import("../cc/MultiChannelAssociationCC.js").MultiChannelAssociationCCValues;
|
|
198
|
-
"Multi Channel": typeof import("../cc/MultiChannelCC.js").MultiChannelCCValues;
|
|
199
|
-
"Multilevel Sensor": typeof import("../cc/MultilevelSensorCC.js").MultilevelSensorCCValues;
|
|
200
|
-
"Multilevel Switch": typeof import("../cc/MultilevelSwitchCC.js").MultilevelSwitchCCValues;
|
|
201
|
-
"Node Naming and Location": typeof import("../cc/NodeNamingCC.js").NodeNamingAndLocationCCValues;
|
|
202
|
-
Notification: typeof import("../cc/NotificationCC.js").NotificationCCValues;
|
|
203
|
-
Protection: typeof import("../cc/ProtectionCC.js").ProtectionCCValues;
|
|
204
|
-
"Scene Activation": typeof import("../cc/SceneActivationCC.js").SceneActivationCCValues;
|
|
205
|
-
"Scene Actuator Configuration": typeof import("../cc/SceneActuatorConfigurationCC.js").SceneActuatorConfigurationCCValues;
|
|
206
|
-
"Scene Controller Configuration": typeof import("../cc/SceneControllerConfigurationCC.js").SceneControllerConfigurationCCValues;
|
|
207
|
-
"Schedule Entry Lock": typeof import("../cc/ScheduleEntryLockCC.js").ScheduleEntryLockCCValues;
|
|
208
|
-
"Sound Switch": typeof import("../cc/SoundSwitchCC.js").SoundSwitchCCValues;
|
|
209
|
-
Supervision: typeof import("../cc/SupervisionCC.js").SupervisionCCValues;
|
|
210
|
-
"Thermostat Fan Mode": typeof import("../cc/ThermostatFanModeCC.js").ThermostatFanModeCCValues;
|
|
211
|
-
"Thermostat Fan State": typeof import("../cc/ThermostatFanStateCC.js").ThermostatFanStateCCValues;
|
|
212
|
-
"Thermostat Mode": typeof import("../cc/ThermostatModeCC.js").ThermostatModeCCValues;
|
|
213
|
-
"Thermostat Operating State": typeof import("../cc/ThermostatOperatingStateCC.js").ThermostatOperatingStateCCValues;
|
|
214
|
-
"Thermostat Setpoint": typeof import("../cc/ThermostatSetpointCC.js").ThermostatSetpointCCValues;
|
|
215
|
-
"Time Parameters": typeof import("../cc/TimeParametersCC.js").TimeParametersCCValues;
|
|
216
|
-
"User Code": typeof import("../cc/UserCodeCC.js").UserCodeCCValues;
|
|
217
|
-
Version: typeof import("../cc/VersionCC.js").VersionCCValues;
|
|
218
|
-
"Wake Up": typeof import("../cc/WakeUpCC.js").WakeUpCCValues;
|
|
219
|
-
"Window Covering": typeof import("../cc/WindowCoveringCC.js").WindowCoveringCCValues;
|
|
220
|
-
"Z-Wave Plus Info": typeof import("../cc/ZWavePlusCC.js").ZWavePlusCCValues;
|
|
221
|
-
}
|
|
222
123
|
export {};
|
|
223
124
|
//# sourceMappingURL=Values.d.ts.map
|