@zwave-js/cc 15.0.0-beta.0 → 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 +79 -161
- package/build/cjs/cc/AlarmSensorCC.js +12 -50
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +63 -199
- package/build/cjs/cc/AssociationCC.js +9 -22
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +66 -166
- package/build/cjs/cc/AssociationGroupInfoCC.js +11 -22
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +86 -294
- package/build/cjs/cc/BarrierOperatorCC.js +12 -44
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +85 -331
- package/build/cjs/cc/BasicCC.js +15 -46
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.d.ts +237 -835
- package/build/cjs/cc/BatteryCC.js +7 -84
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +34 -99
- package/build/cjs/cc/BinarySensorCC.js +9 -29
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +45 -197
- package/build/cjs/cc/BinarySwitchCC.js +6 -22
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +77 -296
- package/build/cjs/cc/CentralSceneCC.js +7 -30
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +45 -160
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -24
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +130 -457
- package/build/cjs/cc/ColorSwitchCC.js +23 -75
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +32 -100
- package/build/cjs/cc/ConfigurationCC.js +11 -31
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.d.ts +512 -1823
- package/build/cjs/cc/DoorLockCC.js +51 -156
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +11 -63
- package/build/cjs/cc/DoorLockLoggingCC.js +4 -8
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +14 -29
- package/build/cjs/cc/EnergyProductionCC.js +5 -17
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +73 -324
- package/build/cjs/cc/EntryControlCC.js +9 -36
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +78 -390
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +5 -26
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +31 -131
- package/build/cjs/cc/HumidityControlModeCC.js +6 -15
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +17 -65
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -12
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +51 -128
- package/build/cjs/cc/HumidityControlSetpointCC.js +10 -28
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +123 -365
- package/build/cjs/cc/IndicatorCC.js +15 -61
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +826 -2317
- package/build/cjs/cc/IrrigationCC.js +29 -233
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +31 -133
- package/build/cjs/cc/LanguageCC.js +4 -15
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +14 -64
- package/build/cjs/cc/LockCC.js +4 -12
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +77 -239
- package/build/cjs/cc/ManufacturerSpecificCC.js +5 -26
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +119 -393
- package/build/cjs/cc/MeterCC.js +25 -69
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +66 -166
- package/build/cjs/cc/MultiChannelAssociationCC.js +10 -23
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +119 -499
- package/build/cjs/cc/MultiChannelCC.js +18 -46
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +46 -130
- package/build/cjs/cc/MultilevelSensorCC.js +12 -33
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +160 -525
- package/build/cjs/cc/MultilevelSwitchCC.js +13 -107
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +33 -135
- package/build/cjs/cc/NodeNamingCC.js +5 -16
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +262 -702
- package/build/cjs/cc/NotificationCC.js +29 -112
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +118 -524
- package/build/cjs/cc/ProtectionCC.js +15 -50
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +33 -132
- package/build/cjs/cc/SceneActivationCC.js +4 -17
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +34 -61
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +9 -21
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +34 -61
- package/build/cjs/cc/SceneControllerConfigurationCC.js +10 -22
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +95 -299
- package/build/cjs/cc/ScheduleEntryLockCC.js +13 -30
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +72 -261
- package/build/cjs/cc/SoundSwitchCC.js +11 -43
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +17 -33
- package/build/cjs/cc/SupervisionCC.js +4 -9
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +44 -195
- package/build/cjs/cc/ThermostatFanModeCC.js +8 -21
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +17 -65
- package/build/cjs/cc/ThermostatFanStateCC.js +4 -12
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +44 -195
- package/build/cjs/cc/ThermostatModeCC.js +8 -21
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +17 -65
- package/build/cjs/cc/ThermostatOperatingStateCC.js +4 -12
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +49 -129
- package/build/cjs/cc/ThermostatSetpointCC.js +10 -25
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +12 -63
- package/build/cjs/cc/TimeParametersCC.js +4 -11
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +311 -1066
- package/build/cjs/cc/UserCodeCC.js +33 -98
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +289 -1003
- package/build/cjs/cc/VersionCC.js +7 -98
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +49 -201
- package/build/cjs/cc/WakeUpCC.js +6 -26
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +126 -220
- package/build/cjs/cc/WindowCoveringCC.js +16 -128
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +69 -329
- package/build/cjs/cc/ZWavePlusCC.js +4 -25
- package/build/cjs/cc/ZWavePlusCC.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/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/Values.d.ts +6 -105
- package/build/cjs/lib/Values.js +13 -107
- package/build/cjs/lib/Values.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts +79 -161
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -39
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +63 -199
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -14
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +66 -166
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -13
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +86 -294
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -34
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +85 -331
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -32
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +237 -835
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -78
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +34 -99
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -16
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +45 -197
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -17
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +77 -296
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -26
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +45 -160
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -23
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +130 -457
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -52
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +32 -100
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -15
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +512 -1823
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +9 -127
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +11 -63
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -5
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +14 -29
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -13
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +73 -324
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -28
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +78 -390
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -23
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +31 -131
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -10
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +17 -65
- 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 +51 -128
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -19
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +123 -365
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -43
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +826 -2317
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -222
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +31 -133
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -12
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +14 -64
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -9
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +0 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +77 -239
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -24
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +119 -393
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -49
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +66 -166
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -14
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +119 -499
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +2 -30
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +46 -130
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -22
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +160 -525
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +5 -101
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +33 -135
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -12
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +262 -702
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +3 -85
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +118 -524
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -36
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +33 -132
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -14
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +34 -61
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -14
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +34 -61
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -14
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +95 -299
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +2 -17
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +72 -261
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -33
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +17 -33
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +2 -7
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +44 -195
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -14
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +17 -65
- 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 +44 -195
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -14
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +17 -65
- 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/ThermostatSetpointCC.d.ts +49 -129
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -16
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +12 -63
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +2 -8
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +311 -1066
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -60
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +289 -1003
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -92
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +49 -201
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -21
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +126 -220
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +3 -103
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +69 -329
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -25
- package/build/esm/cc/ZWavePlusCC.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/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/Values.d.ts +6 -105
- 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/package.json +9 -7
|
@@ -1,123 +1,70 @@
|
|
|
1
1
|
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
|
|
2
|
-
import { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry,
|
|
2
|
+
import { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type WithAddress } from "@zwave-js/core/safe";
|
|
3
3
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
4
4
|
import { PhysicalCCAPI } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
6
6
|
import { AlarmSensorCommand, AlarmSensorType } from "../lib/_Types.js";
|
|
7
7
|
export declare const AlarmSensorCCValues: Readonly<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
state: ((sensorType: AlarmSensorType) => {
|
|
9
|
+
id: {
|
|
10
|
+
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
11
|
+
readonly property: "state";
|
|
12
|
+
readonly propertyKey: AlarmSensorType;
|
|
13
|
+
};
|
|
14
|
+
endpoint: (endpoint?: number) => {
|
|
11
15
|
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
12
16
|
readonly endpoint: number;
|
|
13
|
-
readonly property: "
|
|
17
|
+
readonly property: "state";
|
|
18
|
+
readonly propertyKey: AlarmSensorType;
|
|
14
19
|
};
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly writeable: true;
|
|
24
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
25
|
-
readonly type: "any";
|
|
26
|
-
readonly readable: true;
|
|
27
|
-
readonly writeable: true;
|
|
28
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
29
|
-
readonly type: "any";
|
|
20
|
+
readonly meta: {
|
|
21
|
+
readonly label: `${string} state`;
|
|
22
|
+
readonly description: "Whether the alarm is active";
|
|
23
|
+
readonly ccSpecific: {
|
|
24
|
+
readonly sensorType: AlarmSensorType;
|
|
25
|
+
};
|
|
26
|
+
readonly writeable: false;
|
|
27
|
+
readonly type: "boolean";
|
|
30
28
|
readonly readable: true;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly writeable: true;
|
|
36
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
37
|
-
readonly type: "any";
|
|
38
|
-
readonly readable: true;
|
|
39
|
-
readonly writeable: true;
|
|
40
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
41
|
-
readonly options: Readonly<(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
42
|
-
readonly internal: false;
|
|
43
|
-
readonly minVersion: 1;
|
|
44
|
-
readonly secret: false;
|
|
45
|
-
readonly stateful: true;
|
|
46
|
-
readonly supportsEndpoints: true;
|
|
47
|
-
readonly autoCreate: true;
|
|
48
|
-
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
49
|
-
readonly internal: false;
|
|
50
|
-
readonly minVersion: 1;
|
|
51
|
-
readonly secret: false;
|
|
52
|
-
readonly stateful: true;
|
|
53
|
-
readonly supportsEndpoints: true;
|
|
54
|
-
readonly autoCreate: true;
|
|
55
|
-
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>) extends infer T ? { [K in keyof T as [undefined] extends [(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
56
|
-
readonly internal: false;
|
|
57
|
-
readonly minVersion: 1;
|
|
58
|
-
readonly secret: false;
|
|
59
|
-
readonly stateful: true;
|
|
60
|
-
readonly supportsEndpoints: true;
|
|
61
|
-
readonly autoCreate: true;
|
|
62
|
-
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
63
|
-
readonly internal: false;
|
|
64
|
-
readonly minVersion: 1;
|
|
65
|
-
readonly secret: false;
|
|
66
|
-
readonly stateful: true;
|
|
67
|
-
readonly supportsEndpoints: true;
|
|
68
|
-
readonly autoCreate: true;
|
|
69
|
-
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]] ? never : K]: (import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
70
|
-
readonly internal: false;
|
|
71
|
-
readonly minVersion: 1;
|
|
72
|
-
readonly secret: false;
|
|
73
|
-
readonly stateful: true;
|
|
74
|
-
readonly supportsEndpoints: true;
|
|
75
|
-
readonly autoCreate: true;
|
|
76
|
-
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
29
|
+
};
|
|
30
|
+
}) & {
|
|
31
|
+
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
32
|
+
options: {
|
|
77
33
|
readonly internal: false;
|
|
78
34
|
readonly minVersion: 1;
|
|
79
35
|
readonly secret: false;
|
|
80
36
|
readonly stateful: true;
|
|
81
37
|
readonly supportsEndpoints: true;
|
|
82
38
|
readonly autoCreate: true;
|
|
83
|
-
}
|
|
39
|
+
};
|
|
84
40
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
readonly
|
|
88
|
-
readonly
|
|
89
|
-
readonly
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
readonly readable: true;
|
|
93
|
-
readonly writeable: true;
|
|
94
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
95
|
-
readonly type: "any";
|
|
96
|
-
readonly readable: true;
|
|
97
|
-
readonly writeable: true;
|
|
98
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
99
|
-
readonly type: "any";
|
|
100
|
-
readonly readable: true;
|
|
101
|
-
readonly writeable: true;
|
|
102
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
103
|
-
readonly type: "any";
|
|
104
|
-
readonly readable: true;
|
|
105
|
-
readonly writeable: true;
|
|
106
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
107
|
-
readonly type: "any";
|
|
108
|
-
readonly readable: true;
|
|
109
|
-
readonly writeable: true;
|
|
110
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
111
|
-
readonly id: ValueIDBase;
|
|
112
|
-
readonly endpoint: (endpoint?: number | undefined) => {
|
|
41
|
+
severity: ((sensorType: AlarmSensorType) => {
|
|
42
|
+
id: {
|
|
43
|
+
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
44
|
+
readonly property: "severity";
|
|
45
|
+
readonly propertyKey: AlarmSensorType;
|
|
46
|
+
};
|
|
47
|
+
endpoint: (endpoint?: number) => {
|
|
113
48
|
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
114
49
|
readonly endpoint: number;
|
|
115
|
-
readonly property: "
|
|
50
|
+
readonly property: "severity";
|
|
116
51
|
readonly propertyKey: AlarmSensorType;
|
|
117
52
|
};
|
|
53
|
+
readonly meta: {
|
|
54
|
+
readonly min: 1;
|
|
55
|
+
readonly max: 100;
|
|
56
|
+
readonly unit: "%";
|
|
57
|
+
readonly label: `${string} severity`;
|
|
58
|
+
readonly ccSpecific: {
|
|
59
|
+
readonly sensorType: AlarmSensorType;
|
|
60
|
+
};
|
|
61
|
+
readonly writeable: false;
|
|
62
|
+
readonly type: "number";
|
|
63
|
+
readonly readable: true;
|
|
64
|
+
};
|
|
118
65
|
}) & {
|
|
119
66
|
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
120
|
-
|
|
67
|
+
options: {
|
|
121
68
|
readonly internal: false;
|
|
122
69
|
readonly minVersion: 1;
|
|
123
70
|
readonly secret: false;
|
|
@@ -126,42 +73,32 @@ export declare const AlarmSensorCCValues: Readonly<{
|
|
|
126
73
|
readonly autoCreate: true;
|
|
127
74
|
};
|
|
128
75
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
readonly readable: true;
|
|
137
|
-
readonly writeable: true;
|
|
138
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
139
|
-
readonly type: "any";
|
|
140
|
-
readonly readable: true;
|
|
141
|
-
readonly writeable: true;
|
|
142
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
143
|
-
readonly type: "any";
|
|
144
|
-
readonly readable: true;
|
|
145
|
-
readonly writeable: true;
|
|
146
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
147
|
-
readonly type: "any";
|
|
148
|
-
readonly readable: true;
|
|
149
|
-
readonly writeable: true;
|
|
150
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
151
|
-
readonly type: "any";
|
|
152
|
-
readonly readable: true;
|
|
153
|
-
readonly writeable: true;
|
|
154
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
155
|
-
readonly id: ValueIDBase;
|
|
156
|
-
readonly endpoint: (endpoint?: number | undefined) => {
|
|
76
|
+
duration: ((sensorType: AlarmSensorType) => {
|
|
77
|
+
id: {
|
|
78
|
+
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
79
|
+
readonly property: "duration";
|
|
80
|
+
readonly propertyKey: AlarmSensorType;
|
|
81
|
+
};
|
|
82
|
+
endpoint: (endpoint?: number) => {
|
|
157
83
|
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
158
84
|
readonly endpoint: number;
|
|
159
|
-
readonly property: "
|
|
85
|
+
readonly property: "duration";
|
|
160
86
|
readonly propertyKey: AlarmSensorType;
|
|
161
87
|
};
|
|
88
|
+
readonly meta: {
|
|
89
|
+
readonly unit: "s";
|
|
90
|
+
readonly label: `${string} duration`;
|
|
91
|
+
readonly description: "For how long the alarm should be active";
|
|
92
|
+
readonly ccSpecific: {
|
|
93
|
+
readonly sensorType: AlarmSensorType;
|
|
94
|
+
};
|
|
95
|
+
readonly writeable: false;
|
|
96
|
+
readonly type: "number";
|
|
97
|
+
readonly readable: true;
|
|
98
|
+
};
|
|
162
99
|
}) & {
|
|
163
100
|
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
164
|
-
|
|
101
|
+
options: {
|
|
165
102
|
readonly internal: false;
|
|
166
103
|
readonly minVersion: 1;
|
|
167
104
|
readonly secret: false;
|
|
@@ -170,43 +107,24 @@ export declare const AlarmSensorCCValues: Readonly<{
|
|
|
170
107
|
readonly autoCreate: true;
|
|
171
108
|
};
|
|
172
109
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
readonly
|
|
176
|
-
readonly
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
readonly type: "any";
|
|
180
|
-
readonly readable: true;
|
|
181
|
-
readonly writeable: true;
|
|
182
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
183
|
-
readonly type: "any";
|
|
184
|
-
readonly readable: true;
|
|
185
|
-
readonly writeable: true;
|
|
186
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
187
|
-
readonly type: "any";
|
|
188
|
-
readonly readable: true;
|
|
189
|
-
readonly writeable: true;
|
|
190
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
191
|
-
readonly type: "any";
|
|
192
|
-
readonly readable: true;
|
|
193
|
-
readonly writeable: true;
|
|
194
|
-
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
195
|
-
readonly type: "any";
|
|
196
|
-
readonly readable: true;
|
|
197
|
-
readonly writeable: true;
|
|
198
|
-
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
199
|
-
readonly id: ValueIDBase;
|
|
200
|
-
readonly endpoint: (endpoint?: number | undefined) => {
|
|
110
|
+
supportedSensorTypes: {
|
|
111
|
+
id: {
|
|
112
|
+
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
113
|
+
readonly property: "supportedSensorTypes";
|
|
114
|
+
};
|
|
115
|
+
endpoint: (endpoint?: number) => {
|
|
201
116
|
readonly commandClass: (typeof CommandClasses)["Alarm Sensor"];
|
|
202
117
|
readonly endpoint: number;
|
|
203
|
-
readonly property: "
|
|
204
|
-
readonly propertyKey: AlarmSensorType;
|
|
118
|
+
readonly property: "supportedSensorTypes";
|
|
205
119
|
};
|
|
206
|
-
}) & {
|
|
207
120
|
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
121
|
+
readonly meta: Readonly<{
|
|
122
|
+
readonly type: "any";
|
|
123
|
+
readonly readable: true;
|
|
124
|
+
readonly writeable: true;
|
|
125
|
+
}>;
|
|
126
|
+
options: {
|
|
127
|
+
readonly internal: true;
|
|
210
128
|
readonly minVersion: 1;
|
|
211
129
|
readonly secret: false;
|
|
212
130
|
readonly stateful: true;
|
|
@@ -221,7 +139,7 @@ export declare class AlarmSensorCCAPI extends PhysicalCCAPI {
|
|
|
221
139
|
* Retrieves the current value from this sensor
|
|
222
140
|
* @param sensorType The (optional) sensor type to retrieve the value for
|
|
223
141
|
*/
|
|
224
|
-
get(sensorType?: AlarmSensorType): Promise<Pick<AlarmSensorCCReport, "state" | "
|
|
142
|
+
get(sensorType?: AlarmSensorType): Promise<Pick<AlarmSensorCCReport, "state" | "severity" | "duration"> | undefined>;
|
|
225
143
|
getSupportedSensorTypes(): Promise<AlarmSensorType[] | undefined>;
|
|
226
144
|
}
|
|
227
145
|
export declare class AlarmSensorCC extends CommandClass {
|
|
@@ -35,7 +35,7 @@ __export(AlarmSensorCC_exports, {
|
|
|
35
35
|
AlarmSensorCCReport: () => AlarmSensorCCReport,
|
|
36
36
|
AlarmSensorCCSupportedGet: () => AlarmSensorCCSupportedGet,
|
|
37
37
|
AlarmSensorCCSupportedReport: () => AlarmSensorCCSupportedReport,
|
|
38
|
-
AlarmSensorCCValues: () => AlarmSensorCCValues
|
|
38
|
+
AlarmSensorCCValues: () => import_CCValues_generated.AlarmSensorCCValues
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(AlarmSensorCC_exports);
|
|
41
41
|
var __validateArgs = __toESM(require("./AlarmSensorCC._validateArgs.js"), 1);
|
|
@@ -47,6 +47,7 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
47
47
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
48
48
|
var import_Values = require("../lib/Values.js");
|
|
49
49
|
var import_Types = require("../lib/_Types.js");
|
|
50
|
+
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
50
51
|
var __runInitializers = function(thisArg, initializers, value) {
|
|
51
52
|
var useValue = arguments.length > 2;
|
|
52
53
|
for (var i = 0; i < initializers.length; i++) {
|
|
@@ -88,45 +89,6 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
88
89
|
done = true;
|
|
89
90
|
};
|
|
90
91
|
const { validateArgs_AlarmSensorCCAPI_get } = __validateArgs;
|
|
91
|
-
const AlarmSensorCCValues = Object.freeze({
|
|
92
|
-
...import_Values.V.defineDynamicCCValues(import_safe.CommandClasses["Alarm Sensor"], {
|
|
93
|
-
...import_Values.V.dynamicPropertyAndKeyWithName("state", "state", (sensorType) => sensorType, ({ property, propertyKey }) => property === "state" && typeof propertyKey === "number", (sensorType) => {
|
|
94
|
-
const alarmName = (0, import_safe3.getEnumMemberName)(import_Types.AlarmSensorType, sensorType);
|
|
95
|
-
return {
|
|
96
|
-
...import_safe.ValueMetadata.ReadOnlyBoolean,
|
|
97
|
-
label: `${alarmName} state`,
|
|
98
|
-
description: "Whether the alarm is active",
|
|
99
|
-
ccSpecific: { sensorType }
|
|
100
|
-
};
|
|
101
|
-
}),
|
|
102
|
-
...import_Values.V.dynamicPropertyAndKeyWithName("severity", "severity", (sensorType) => sensorType, ({ property, propertyKey }) => property === "severity" && typeof propertyKey === "number", (sensorType) => {
|
|
103
|
-
const alarmName = (0, import_safe3.getEnumMemberName)(import_Types.AlarmSensorType, sensorType);
|
|
104
|
-
return {
|
|
105
|
-
...import_safe.ValueMetadata.ReadOnlyNumber,
|
|
106
|
-
min: 1,
|
|
107
|
-
max: 100,
|
|
108
|
-
unit: "%",
|
|
109
|
-
label: `${alarmName} severity`,
|
|
110
|
-
ccSpecific: { sensorType }
|
|
111
|
-
};
|
|
112
|
-
}),
|
|
113
|
-
...import_Values.V.dynamicPropertyAndKeyWithName("duration", "duration", (sensorType) => sensorType, ({ property, propertyKey }) => property === "duration" && typeof propertyKey === "number", (sensorType) => {
|
|
114
|
-
const alarmName = (0, import_safe3.getEnumMemberName)(import_Types.AlarmSensorType, sensorType);
|
|
115
|
-
return {
|
|
116
|
-
...import_safe.ValueMetadata.ReadOnlyNumber,
|
|
117
|
-
unit: "s",
|
|
118
|
-
label: `${alarmName} duration`,
|
|
119
|
-
description: "For how long the alarm should be active",
|
|
120
|
-
ccSpecific: { sensorType }
|
|
121
|
-
};
|
|
122
|
-
})
|
|
123
|
-
}),
|
|
124
|
-
...import_Values.V.defineStaticCCValues(import_safe.CommandClasses["Alarm Sensor"], {
|
|
125
|
-
...import_Values.V.staticProperty("supportedSensorTypes", void 0, {
|
|
126
|
-
internal: true
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
});
|
|
130
92
|
let AlarmSensorCCAPI = (() => {
|
|
131
93
|
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Alarm Sensor"])];
|
|
132
94
|
let _classDescriptor;
|
|
@@ -193,7 +155,7 @@ let AlarmSensorCCAPI = (() => {
|
|
|
193
155
|
return AlarmSensorCCAPI2 = _classThis;
|
|
194
156
|
})();
|
|
195
157
|
let AlarmSensorCC = (() => {
|
|
196
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Alarm Sensor"]), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(AlarmSensorCCValues)];
|
|
158
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Alarm Sensor"]), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.AlarmSensorCCValues)];
|
|
197
159
|
let _classDescriptor;
|
|
198
160
|
let _classExtraInitializers = [];
|
|
199
161
|
let _classThis;
|
|
@@ -263,7 +225,7 @@ let AlarmSensorCC = (() => {
|
|
|
263
225
|
const api = import_API.CCAPI.create(import_safe.CommandClasses["Alarm Sensor"], ctx, endpoint).withOptions({
|
|
264
226
|
priority: import_safe.MessagePriority.NodeQuery
|
|
265
227
|
});
|
|
266
|
-
const supportedSensorTypes = this.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes) ?? [];
|
|
228
|
+
const supportedSensorTypes = this.getValue(ctx, import_CCValues_generated.AlarmSensorCCValues.supportedSensorTypes) ?? [];
|
|
267
229
|
for (const type of supportedSensorTypes) {
|
|
268
230
|
if (!(0, import_safe3.isEnumMember)(import_Types.AlarmSensorType, type))
|
|
269
231
|
continue;
|
|
@@ -298,12 +260,12 @@ duration: ${currentValue.duration}`;
|
|
|
298
260
|
* This only works AFTER the interview process
|
|
299
261
|
*/
|
|
300
262
|
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
301
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(AlarmSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
263
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(import_CCValues_generated.AlarmSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
302
264
|
}
|
|
303
265
|
createMetadataForSensorType(ctx, sensorType) {
|
|
304
|
-
const stateValue = AlarmSensorCCValues.state(sensorType);
|
|
305
|
-
const severityValue = AlarmSensorCCValues.severity(sensorType);
|
|
306
|
-
const durationValue = AlarmSensorCCValues.duration(sensorType);
|
|
266
|
+
const stateValue = import_CCValues_generated.AlarmSensorCCValues.state(sensorType);
|
|
267
|
+
const severityValue = import_CCValues_generated.AlarmSensorCCValues.severity(sensorType);
|
|
268
|
+
const durationValue = import_CCValues_generated.AlarmSensorCCValues.duration(sensorType);
|
|
307
269
|
this.ensureMetadata(ctx, stateValue);
|
|
308
270
|
this.ensureMetadata(ctx, severityValue);
|
|
309
271
|
this.ensureMetadata(ctx, durationValue);
|
|
@@ -382,9 +344,9 @@ let AlarmSensorCCReport = (() => {
|
|
|
382
344
|
if (!super.persistValues(ctx))
|
|
383
345
|
return false;
|
|
384
346
|
this.createMetadataForSensorType(ctx, this.sensorType);
|
|
385
|
-
const stateValue = AlarmSensorCCValues.state(this.sensorType);
|
|
386
|
-
const severityValue = AlarmSensorCCValues.severity(this.sensorType);
|
|
387
|
-
const durationValue = AlarmSensorCCValues.duration(this.sensorType);
|
|
347
|
+
const stateValue = import_CCValues_generated.AlarmSensorCCValues.state(this.sensorType);
|
|
348
|
+
const severityValue = import_CCValues_generated.AlarmSensorCCValues.severity(this.sensorType);
|
|
349
|
+
const durationValue = import_CCValues_generated.AlarmSensorCCValues.duration(this.sensorType);
|
|
388
350
|
this.setValue(ctx, stateValue, this.state);
|
|
389
351
|
this.setValue(ctx, severityValue, this.severity);
|
|
390
352
|
this.setValue(ctx, durationValue, this.duration);
|
|
@@ -441,7 +403,7 @@ let AlarmSensorCCGet = (() => {
|
|
|
441
403
|
return AlarmSensorCCGet2 = _classThis;
|
|
442
404
|
})();
|
|
443
405
|
let AlarmSensorCCSupportedReport = (() => {
|
|
444
|
-
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AlarmSensorCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSensorTypes", AlarmSensorCCValues.supportedSensorTypes)];
|
|
406
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.AlarmSensorCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSensorTypes", import_CCValues_generated.AlarmSensorCCValues.supportedSensorTypes)];
|
|
445
407
|
let _classDescriptor;
|
|
446
408
|
let _classExtraInitializers = [];
|
|
447
409
|
let _classThis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/AlarmSensorCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = Object.freeze({\n\t...V.defineDynamicCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t}),\n\t...V.defineStaticCCValues(CommandClasses[\"Alarm Sensor\"], {\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t}),\n});\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sensorType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAcO;AACP,IAAAA,eAAsB;AACtB,IAAAA,eAAsD;AAEtD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD
|
|
4
|
+
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, isEnumMember, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { AlarmSensorCommand, AlarmSensorType } from \"../lib/_Types.js\";\n\nexport const AlarmSensorCCValues = V.defineCCValues(\n\tCommandClasses[\"Alarm Sensor\"],\n\t{\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"state\",\n\t\t\t\"state\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"state\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\t\tlabel: `${alarmName} state`,\n\t\t\t\t\tdescription: \"Whether the alarm is active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"severity\",\n\t\t\t\"severity\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"severity\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 100,\n\t\t\t\t\tunit: \"%\",\n\t\t\t\t\tlabel: `${alarmName} severity`,\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(sensorType: AlarmSensorType) => sensorType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(sensorType: AlarmSensorType) => {\n\t\t\t\tconst alarmName = getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tsensorType,\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\t\tunit: \"s\",\n\t\t\t\t\tlabel: `${alarmName} duration`,\n\t\t\t\t\tdescription: \"For how long the alarm should be active\",\n\t\t\t\t\tccSpecific: { sensorType },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Alarm Sensor\"])\nexport class AlarmSensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: AlarmSensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase AlarmSensorCommand.Get:\n\t\t\tcase AlarmSensorCommand.SupportedGet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(sensorType?: AlarmSensorType) {\n\t\tthis.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);\n\n\t\tconst cc = new AlarmSensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<AlarmSensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return pick(response, [\"state\", \"severity\", \"duration\"]);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupportedSensorTypes() {\n\t\tthis.assertSupportsCommand(\n\t\t\tAlarmSensorCommand,\n\t\t\tAlarmSensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new AlarmSensorCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tAlarmSensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) return response.supportedSensorTypes;\n\t}\n}\n\n@commandClass(CommandClasses[\"Alarm Sensor\"])\n@implementedVersion(1)\n@ccValues(AlarmSensorCCValues)\nexport class AlarmSensorCC extends CommandClass {\n\tdeclare ccCommand: AlarmSensorCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\n\t\t// Skip the interview in favor of Notification CC if possible\n\t\tif (endpoint.supportsCC(CommandClasses.Notification)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: skipping interview because Notification CC is supported...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.setInterviewComplete(ctx, true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Find out which sensor types this sensor supports\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\tif (supportedSensorTypes) {\n\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(AlarmSensorType, type))\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported sensor types timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Alarm Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tconst supportedSensorTypes: readonly AlarmSensorType[] =\n\t\t\tthis.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)\n\t\t\t\t?? [];\n\n\t\t// Always query (all of) the sensor's current value(s)\n\t\tfor (const type of supportedSensorTypes) {\n\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t// for valid values and throws otherwise.\n\t\t\tif (!isEnumMember(AlarmSensorType, type)) continue;\n\n\t\t\tconst sensorName = getEnumMemberName(AlarmSensorType, type);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get(type);\n\t\t\tif (currentValue) {\n\t\t\t\tlet message = `received current value for ${sensorName}: \nstate: ${currentValue.state}`;\n\t\t\t\tif (currentValue.severity != undefined) {\n\t\t\t\t\tmessage += `\nseverity: ${currentValue.severity}`;\n\t\t\t\t}\n\t\t\t\tif (currentValue.duration != undefined) {\n\t\t\t\t\tmessage += `\nduration: ${currentValue.duration}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<AlarmSensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tAlarmSensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tprotected createMetadataForSensorType(\n\t\tctx: GetValueDB,\n\t\tsensorType: AlarmSensorType,\n\t): void {\n\t\tconst stateValue = AlarmSensorCCValues.state(sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(sensorType);\n\n\t\t// Always create metadata if it does not exist\n\t\tthis.ensureMetadata(ctx, stateValue);\n\t\tthis.ensureMetadata(ctx, severityValue);\n\t\tthis.ensureMetadata(ctx, durationValue);\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCReportOptions {\n\tsensorType: AlarmSensorType;\n\tstate: boolean;\n\tseverity?: number;\n\tduration?: number;\n}\n\n@CCCommand(AlarmSensorCommand.Report)\nexport class AlarmSensorCCReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sensorType = options.sensorType;\n\t\tthis.state = options.state;\n\t\tthis.severity = options.severity;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);\n\t\tconst sourceNodeId = raw.payload[0];\n\n\t\tconst sensorType: AlarmSensorType = raw.payload[1];\n\t\t// Any positive value gets interpreted as alarm\n\t\tconst state: boolean = raw.payload[2] > 0;\n\t\t// Severity only ranges from 1 to 100\n\t\tlet severity: number | undefined;\n\t\tif (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {\n\t\t\tseverity = raw.payload[2];\n\t\t}\n\n\t\t// ignore zero durations\n\t\tconst duration = raw.payload.readUInt16BE(3) || undefined;\n\n\t\treturn new this({\n\t\t\t// Alarm Sensor reports may be forwarded by a different node, in this case\n\t\t\t// (and only then!) the payload contains the original node ID\n\t\t\tnodeId: sourceNodeId || ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t\tstate,\n\t\t\tseverity,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly sensorType: AlarmSensorType;\n\tpublic readonly state: boolean;\n\tpublic readonly severity: number | undefined;\n\tpublic readonly duration: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sensor type\": getEnumMemberName(AlarmSensorType, this.sensorType),\n\t\t\t\"alarm state\": this.state,\n\t\t};\n\t\tif (this.severity != undefined) {\n\t\t\tmessage.severity = this.severity;\n\t\t}\n\t\tif (this.duration != undefined) {\n\t\t\tmessage.duration = `${this.duration} seconds`;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata if it does not exist\n\t\tthis.createMetadataForSensorType(ctx, this.sensorType);\n\n\t\tconst stateValue = AlarmSensorCCValues.state(this.sensorType);\n\t\tconst severityValue = AlarmSensorCCValues.severity(this.sensorType);\n\t\tconst durationValue = AlarmSensorCCValues.duration(this.sensorType);\n\n\t\tthis.setValue(ctx, stateValue, this.state);\n\t\tthis.setValue(ctx, severityValue, this.severity);\n\t\tthis.setValue(ctx, durationValue, this.duration);\n\n\t\treturn true;\n\t}\n}\n\nfunction testResponseForAlarmSensorGet(\n\tsent: AlarmSensorCCGet,\n\treceived: AlarmSensorCCReport,\n) {\n\t// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType === AlarmSensorType.Any\n\t\t|| received.sensorType === sent.sensorType\n\t);\n}\n\n// @publicAPI\nexport interface AlarmSensorCCGetOptions {\n\tsensorType?: AlarmSensorType;\n}\n\n@CCCommand(AlarmSensorCommand.Get)\n@expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)\nexport class AlarmSensorCCGet extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType ?? AlarmSensorType.Any;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new AlarmSensorCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic sensorType: AlarmSensorType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sensorType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"sensor type\": getEnumMemberName(\n\t\t\t\t\tAlarmSensorType,\n\t\t\t\t\tthis.sensorType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface AlarmSensorCCSupportedReportOptions {\n\tsupportedSensorTypes: AlarmSensorType[];\n}\n\n@CCCommand(AlarmSensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tAlarmSensorCCValues.supportedSensorTypes,\n)\nexport class AlarmSensorCCSupportedReport extends AlarmSensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<AlarmSensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): AlarmSensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst bitMaskLength = raw.payload[0];\n\t\tvalidatePayload(raw.payload.length >= 1 + bitMaskLength);\n\t\tconst supportedSensorTypes: AlarmSensorType[] = parseBitMask(\n\t\t\traw.payload.subarray(1, 1 + bitMaskLength),\n\t\t\tAlarmSensorType[\"General Purpose\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: AlarmSensorType[];\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\t// Create metadata for each sensor type\n\t\tfor (const type of this.supportedSensorTypes) {\n\t\t\tthis.createMetadataForSensorType(ctx, type);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported sensor types\": this.supportedSensorTypes\n\t\t\t\t\t.map((t) => getEnumMemberName(AlarmSensorType, t))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(AlarmSensorCommand.SupportedGet)\n@expectedCCResponse(AlarmSensorCCSupportedReport)\nexport class AlarmSensorCCSupportedGet extends AlarmSensorCC {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAcO;AACP,IAAAA,eAAsB;AACtB,IAAAA,eAAsD;AAEtD,iBAAqC;AACrC,0BAMO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0EvC,oBAAgB,MAAA;8BAD5B,mCAAI,2BAAe,cAAc,CAAC,CAAC;;;;oBACE;;;wCAAA,YAAa;WAAA;;;;;;;;yBAcjD,kCAAa,EAAE,aAAa,KAAI,CAAE,CAAC;AAEpC,mBAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAhBjB,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBA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