@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var BatteryCCReport_1, BatteryCCHealthReport_1;
|
|
8
35
|
import { timespan } from "@zwave-js/core";
|
|
9
36
|
import { CommandClasses, MessagePriority, ValueMetadata, enumValuesToMetadataStates, parseFloatWithScale, validatePayload, } from "@zwave-js/core/safe";
|
|
10
37
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
11
38
|
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
12
39
|
import { CCAPI, POLL_VALUE, PhysicalCCAPI, throwUnsupportedProperty, } from "../lib/API.js";
|
|
13
40
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
14
|
-
import { API, CCCommand,
|
|
41
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from "../lib/CommandClassDecorators.js";
|
|
15
42
|
import { V } from "../lib/Values.js";
|
|
16
43
|
import { BatteryChargingStatus, BatteryCommand, BatteryReplacementStatus, } from "../lib/_Types.js";
|
|
17
44
|
import { NotificationCCValues } from "./NotificationCC.js";
|
|
@@ -94,108 +121,135 @@ export const BatteryCCValues = Object.freeze({
|
|
|
94
121
|
}),
|
|
95
122
|
});
|
|
96
123
|
// @noSetValueAPI This CC is read-only
|
|
97
|
-
let BatteryCCAPI =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
let BatteryCCAPI = (() => {
|
|
125
|
+
let _classDecorators = [API(CommandClasses.Battery)];
|
|
126
|
+
let _classDescriptor;
|
|
127
|
+
let _classExtraInitializers = [];
|
|
128
|
+
let _classThis;
|
|
129
|
+
let _classSuper = PhysicalCCAPI;
|
|
130
|
+
var BatteryCCAPI = class extends _classSuper {
|
|
131
|
+
static { _classThis = this; }
|
|
132
|
+
static {
|
|
133
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
134
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
135
|
+
BatteryCCAPI = _classThis = _classDescriptor.value;
|
|
136
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
137
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
104
138
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
case "isLow":
|
|
112
|
-
case "chargingStatus":
|
|
113
|
-
case "rechargeable":
|
|
114
|
-
case "backup":
|
|
115
|
-
case "overheating":
|
|
116
|
-
case "lowFluid":
|
|
117
|
-
case "rechargeOrReplace":
|
|
118
|
-
case "lowTemperatureStatus":
|
|
119
|
-
case "disconnected":
|
|
120
|
-
return (await this.get())?.[property];
|
|
121
|
-
case "maximumCapacity":
|
|
122
|
-
case "temperature":
|
|
123
|
-
return (await this.getHealth())?.[property];
|
|
124
|
-
default:
|
|
125
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
139
|
+
supportsCommand(cmd) {
|
|
140
|
+
switch (cmd) {
|
|
141
|
+
case BatteryCommand.Get:
|
|
142
|
+
return true; // This is mandatory
|
|
143
|
+
case BatteryCommand.HealthGet:
|
|
144
|
+
return this.version >= 2;
|
|
126
145
|
}
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
130
|
-
async get() {
|
|
131
|
-
this.assertSupportsCommand(BatteryCommand, BatteryCommand.Get);
|
|
132
|
-
const cc = new BatteryCCGet({
|
|
133
|
-
nodeId: this.endpoint.nodeId,
|
|
134
|
-
endpointIndex: this.endpoint.index,
|
|
135
|
-
});
|
|
136
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
137
|
-
if (response) {
|
|
138
|
-
return pick(response, [
|
|
139
|
-
"level",
|
|
140
|
-
"isLow",
|
|
141
|
-
"chargingStatus",
|
|
142
|
-
"rechargeable",
|
|
143
|
-
"backup",
|
|
144
|
-
"overheating",
|
|
145
|
-
"lowFluid",
|
|
146
|
-
"rechargeOrReplace",
|
|
147
|
-
"lowTemperatureStatus",
|
|
148
|
-
"disconnected",
|
|
149
|
-
]);
|
|
146
|
+
return super.supportsCommand(cmd);
|
|
150
147
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
get [POLL_VALUE]() {
|
|
149
|
+
return async function ({ property }) {
|
|
150
|
+
switch (property) {
|
|
151
|
+
case "level":
|
|
152
|
+
case "isLow":
|
|
153
|
+
case "chargingStatus":
|
|
154
|
+
case "rechargeable":
|
|
155
|
+
case "backup":
|
|
156
|
+
case "overheating":
|
|
157
|
+
case "lowFluid":
|
|
158
|
+
case "rechargeOrReplace":
|
|
159
|
+
case "lowTemperatureStatus":
|
|
160
|
+
case "disconnected":
|
|
161
|
+
return (await this.get())?.[property];
|
|
162
|
+
case "maximumCapacity":
|
|
163
|
+
case "temperature":
|
|
164
|
+
return (await this.getHealth())?.[property];
|
|
165
|
+
default:
|
|
166
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
162
169
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
171
|
+
async get() {
|
|
172
|
+
this.assertSupportsCommand(BatteryCommand, BatteryCommand.Get);
|
|
173
|
+
const cc = new BatteryCCGet({
|
|
174
|
+
nodeId: this.endpoint.nodeId,
|
|
175
|
+
endpointIndex: this.endpoint.index,
|
|
176
|
+
});
|
|
177
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
178
|
+
if (response) {
|
|
179
|
+
return pick(response, [
|
|
180
|
+
"level",
|
|
181
|
+
"isLow",
|
|
182
|
+
"chargingStatus",
|
|
183
|
+
"rechargeable",
|
|
184
|
+
"backup",
|
|
185
|
+
"overheating",
|
|
186
|
+
"lowFluid",
|
|
187
|
+
"rechargeOrReplace",
|
|
188
|
+
"lowTemperatureStatus",
|
|
189
|
+
"disconnected",
|
|
190
|
+
]);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
194
|
+
async getHealth() {
|
|
195
|
+
this.assertSupportsCommand(BatteryCommand, BatteryCommand.HealthGet);
|
|
196
|
+
const cc = new BatteryCCHealthGet({
|
|
197
|
+
nodeId: this.endpoint.nodeId,
|
|
198
|
+
endpointIndex: this.endpoint.index,
|
|
199
|
+
});
|
|
200
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
201
|
+
if (response) {
|
|
202
|
+
return pick(response, ["maximumCapacity", "temperature"]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
return BatteryCCAPI = _classThis;
|
|
207
|
+
})();
|
|
168
208
|
export { BatteryCCAPI };
|
|
169
|
-
let BatteryCC =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
209
|
+
let BatteryCC = (() => {
|
|
210
|
+
let _classDecorators = [commandClass(CommandClasses.Battery), implementedVersion(3), ccValues(BatteryCCValues)];
|
|
211
|
+
let _classDescriptor;
|
|
212
|
+
let _classExtraInitializers = [];
|
|
213
|
+
let _classThis;
|
|
214
|
+
let _classSuper = CommandClass;
|
|
215
|
+
var BatteryCC = class extends _classSuper {
|
|
216
|
+
static { _classThis = this; }
|
|
217
|
+
static {
|
|
218
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
219
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
220
|
+
BatteryCC = _classThis = _classDescriptor.value;
|
|
221
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
222
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
223
|
+
}
|
|
224
|
+
async interview(ctx) {
|
|
225
|
+
const node = this.getNode(ctx);
|
|
226
|
+
ctx.logNode(node.id, {
|
|
227
|
+
endpoint: this.endpointIndex,
|
|
228
|
+
message: `Interviewing ${this.ccName}...`,
|
|
229
|
+
direction: "none",
|
|
230
|
+
});
|
|
231
|
+
// Query the Battery status
|
|
232
|
+
await this.refreshValues(ctx);
|
|
233
|
+
// Remember that the interview is complete
|
|
234
|
+
this.setInterviewComplete(ctx, true);
|
|
235
|
+
}
|
|
236
|
+
async refreshValues(ctx) {
|
|
237
|
+
const node = this.getNode(ctx);
|
|
238
|
+
const endpoint = this.getEndpoint(ctx);
|
|
239
|
+
const api = CCAPI.create(CommandClasses.Battery, ctx, endpoint).withOptions({
|
|
240
|
+
priority: MessagePriority.NodeQuery,
|
|
241
|
+
});
|
|
242
|
+
ctx.logNode(node.id, {
|
|
243
|
+
endpoint: this.endpointIndex,
|
|
244
|
+
message: "querying battery status...",
|
|
245
|
+
direction: "outbound",
|
|
246
|
+
});
|
|
247
|
+
const batteryStatus = await api.get();
|
|
248
|
+
if (batteryStatus) {
|
|
249
|
+
let logMessage = `received response for battery information:
|
|
196
250
|
level: ${batteryStatus.level}${batteryStatus.isLow ? " (low)" : ""}`;
|
|
197
|
-
|
|
198
|
-
|
|
251
|
+
if (api.version >= 2) {
|
|
252
|
+
logMessage += `
|
|
199
253
|
status: ${BatteryChargingStatus[batteryStatus.chargingStatus]}
|
|
200
254
|
rechargeable: ${batteryStatus.rechargeable}
|
|
201
255
|
is backup: ${batteryStatus.backup}
|
|
@@ -204,310 +258,321 @@ fluid is low: ${batteryStatus.lowFluid}
|
|
|
204
258
|
needs to be replaced or charged: ${BatteryReplacementStatus[batteryStatus.rechargeOrReplace]}
|
|
205
259
|
is low temperature ${batteryStatus.lowTemperatureStatus}
|
|
206
260
|
is disconnected: ${batteryStatus.disconnected}`;
|
|
207
|
-
|
|
208
|
-
ctx.logNode(node.id, {
|
|
209
|
-
endpoint: this.endpointIndex,
|
|
210
|
-
message: logMessage,
|
|
211
|
-
direction: "inbound",
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
if (api.version >= 2) {
|
|
215
|
-
// always query the health
|
|
216
|
-
ctx.logNode(node.id, {
|
|
217
|
-
endpoint: this.endpointIndex,
|
|
218
|
-
message: "querying battery health...",
|
|
219
|
-
direction: "outbound",
|
|
220
|
-
});
|
|
221
|
-
const batteryHealth = await api.getHealth();
|
|
222
|
-
if (batteryHealth) {
|
|
223
|
-
const logMessage = `received response for battery health:
|
|
224
|
-
max. capacity: ${batteryHealth.maximumCapacity} %
|
|
225
|
-
temperature: ${batteryHealth.temperature} °C`;
|
|
261
|
+
}
|
|
226
262
|
ctx.logNode(node.id, {
|
|
227
263
|
endpoint: this.endpointIndex,
|
|
228
264
|
message: logMessage,
|
|
229
265
|
direction: "inbound",
|
|
230
266
|
});
|
|
231
267
|
}
|
|
268
|
+
if (api.version >= 2) {
|
|
269
|
+
// always query the health
|
|
270
|
+
ctx.logNode(node.id, {
|
|
271
|
+
endpoint: this.endpointIndex,
|
|
272
|
+
message: "querying battery health...",
|
|
273
|
+
direction: "outbound",
|
|
274
|
+
});
|
|
275
|
+
const batteryHealth = await api.getHealth();
|
|
276
|
+
if (batteryHealth) {
|
|
277
|
+
const logMessage = `received response for battery health:
|
|
278
|
+
max. capacity: ${batteryHealth.maximumCapacity} %
|
|
279
|
+
temperature: ${batteryHealth.temperature} °C`;
|
|
280
|
+
ctx.logNode(node.id, {
|
|
281
|
+
endpoint: this.endpointIndex,
|
|
282
|
+
message: logMessage,
|
|
283
|
+
direction: "inbound",
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
232
287
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
commandClass(CommandClasses.Battery),
|
|
248
|
-
implementedVersion(3),
|
|
249
|
-
ccValues(BatteryCCValues)
|
|
250
|
-
], BatteryCC);
|
|
288
|
+
shouldRefreshValues(ctx) {
|
|
289
|
+
// Check when the battery state was last updated
|
|
290
|
+
const valueDB = ctx.tryGetValueDB(this.nodeId);
|
|
291
|
+
if (!valueDB)
|
|
292
|
+
return true;
|
|
293
|
+
const lastUpdated = valueDB.getTimestamp(BatteryCCValues.level.endpoint(this.endpointIndex));
|
|
294
|
+
return (lastUpdated == undefined
|
|
295
|
+
// The specs say once per month, but that's a bit too unfrequent IMO
|
|
296
|
+
// Also the maximum that setInterval supports is ~24.85 days
|
|
297
|
+
|| Date.now() - lastUpdated > timespan.days(7));
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
return BatteryCC = _classThis;
|
|
301
|
+
})();
|
|
251
302
|
export { BatteryCC };
|
|
252
|
-
let BatteryCCReport =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
static from(raw, ctx) {
|
|
267
|
-
let ccOptions;
|
|
268
|
-
validatePayload(raw.payload.length >= 1);
|
|
269
|
-
const level = raw.payload[0];
|
|
270
|
-
if (level === 0xff) {
|
|
271
|
-
ccOptions = {
|
|
272
|
-
isLow: true,
|
|
273
|
-
};
|
|
303
|
+
let BatteryCCReport = (() => {
|
|
304
|
+
let _classDecorators = [CCCommand(BatteryCommand.Report), ccValueProperty("level", BatteryCCValues.level), ccValueProperty("isLow", BatteryCCValues.isLow), ccValueProperty("chargingStatus", BatteryCCValues.chargingStatus), ccValueProperty("rechargeable", BatteryCCValues.rechargeable), ccValueProperty("backup", BatteryCCValues.backup), ccValueProperty("overheating", BatteryCCValues.overheating), ccValueProperty("lowFluid", BatteryCCValues.lowFluid), ccValueProperty("rechargeOrReplace", BatteryCCValues.rechargeOrReplace), ccValueProperty("disconnected", BatteryCCValues.disconnected), ccValueProperty("lowTemperatureStatus", BatteryCCValues.lowTemperatureStatus)];
|
|
305
|
+
let _classDescriptor;
|
|
306
|
+
let _classExtraInitializers = [];
|
|
307
|
+
let _classThis;
|
|
308
|
+
let _classSuper = BatteryCC;
|
|
309
|
+
var BatteryCCReport = class extends _classSuper {
|
|
310
|
+
static { _classThis = this; }
|
|
311
|
+
static {
|
|
312
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
313
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
314
|
+
BatteryCCReport = _classThis = _classDescriptor.value;
|
|
315
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
316
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
274
317
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
318
|
+
constructor(options) {
|
|
319
|
+
super(options);
|
|
320
|
+
this.level = options.isLow ? 0 : options.level;
|
|
321
|
+
this.isLow = !!options.isLow;
|
|
322
|
+
this.chargingStatus = options.chargingStatus;
|
|
323
|
+
this.rechargeable = options.rechargeable;
|
|
324
|
+
this.backup = options.backup;
|
|
325
|
+
this.overheating = options.overheating;
|
|
326
|
+
this.lowFluid = options.lowFluid;
|
|
327
|
+
this.rechargeOrReplace = options.rechargeOrReplace;
|
|
328
|
+
this.disconnected = options.disconnected;
|
|
329
|
+
this.lowTemperatureStatus = options.lowTemperatureStatus;
|
|
280
330
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
:
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
331
|
+
static from(raw, ctx) {
|
|
332
|
+
let ccOptions;
|
|
333
|
+
validatePayload(raw.payload.length >= 1);
|
|
334
|
+
const level = raw.payload[0];
|
|
335
|
+
if (level === 0xff) {
|
|
336
|
+
ccOptions = {
|
|
337
|
+
isLow: true,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
ccOptions = {
|
|
342
|
+
isLow: false,
|
|
343
|
+
level,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
if (raw.payload.length >= 3) {
|
|
347
|
+
// Starting with V2
|
|
348
|
+
const chargingStatus = raw.payload[1] >>> 6;
|
|
349
|
+
const rechargeable = !!(raw.payload[1] & 0b0010_0000);
|
|
350
|
+
const backup = !!(raw.payload[1] & 0b0001_0000);
|
|
351
|
+
const overheating = !!(raw.payload[1] & 0b1000);
|
|
352
|
+
const lowFluid = !!(raw.payload[1] & 0b0100);
|
|
353
|
+
const rechargeOrReplace = !!(raw.payload[1] & 0b10)
|
|
354
|
+
? BatteryReplacementStatus.Now
|
|
355
|
+
: !!(raw.payload[1] & 0b1)
|
|
356
|
+
? BatteryReplacementStatus.Soon
|
|
357
|
+
: BatteryReplacementStatus.No;
|
|
358
|
+
const lowTemperatureStatus = !!(raw.payload[2] & 0b10);
|
|
359
|
+
const disconnected = !!(raw.payload[2] & 0b1);
|
|
360
|
+
ccOptions = {
|
|
361
|
+
...ccOptions,
|
|
362
|
+
chargingStatus,
|
|
363
|
+
rechargeable,
|
|
364
|
+
backup,
|
|
365
|
+
overheating,
|
|
366
|
+
lowFluid,
|
|
367
|
+
rechargeOrReplace,
|
|
368
|
+
lowTemperatureStatus,
|
|
369
|
+
disconnected,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return new this({
|
|
373
|
+
nodeId: ctx.sourceNodeId,
|
|
296
374
|
...ccOptions,
|
|
297
|
-
|
|
298
|
-
rechargeable,
|
|
299
|
-
backup,
|
|
300
|
-
overheating,
|
|
301
|
-
lowFluid,
|
|
302
|
-
rechargeOrReplace,
|
|
303
|
-
lowTemperatureStatus,
|
|
304
|
-
disconnected,
|
|
305
|
-
};
|
|
375
|
+
});
|
|
306
376
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
.notificationVariable("Power Management", "Battery level status");
|
|
328
|
-
// If not undefined and not idle
|
|
329
|
-
if (this.getValue(ctx, batteryLevelStatusValue)) {
|
|
330
|
-
this.setValue(ctx, batteryLevelStatusValue, 0);
|
|
377
|
+
persistValues(ctx) {
|
|
378
|
+
if (!super.persistValues(ctx))
|
|
379
|
+
return false;
|
|
380
|
+
// Naïve heuristic for a full battery
|
|
381
|
+
if (this.level >= 90) {
|
|
382
|
+
// Some devices send Notification CC Reports with battery information,
|
|
383
|
+
// or this information is mapped from legacy V1 alarm values.
|
|
384
|
+
// We may need to idle the corresponding values when the battery is full
|
|
385
|
+
const notificationCCVersion = ctx.getSupportedCCVersion(CommandClasses.Notification, this.nodeId, this.endpointIndex);
|
|
386
|
+
if (
|
|
387
|
+
// supported
|
|
388
|
+
notificationCCVersion > 0
|
|
389
|
+
// but idling is not required
|
|
390
|
+
&& notificationCCVersion < 8) {
|
|
391
|
+
const batteryLevelStatusValue = NotificationCCValues
|
|
392
|
+
.notificationVariable("Power Management", "Battery level status");
|
|
393
|
+
// If not undefined and not idle
|
|
394
|
+
if (this.getValue(ctx, batteryLevelStatusValue)) {
|
|
395
|
+
this.setValue(ctx, batteryLevelStatusValue, 0);
|
|
396
|
+
}
|
|
331
397
|
}
|
|
332
398
|
}
|
|
399
|
+
return true;
|
|
333
400
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
return super.serialize(ctx);
|
|
369
|
-
}
|
|
370
|
-
toLogEntry(ctx) {
|
|
371
|
-
const message = {
|
|
372
|
-
level: this.level,
|
|
373
|
-
"is low": this.isLow,
|
|
374
|
-
};
|
|
375
|
-
if (this.chargingStatus != undefined) {
|
|
376
|
-
message["charging status"] = getEnumMemberName(BatteryChargingStatus, this.chargingStatus);
|
|
401
|
+
level;
|
|
402
|
+
isLow;
|
|
403
|
+
chargingStatus;
|
|
404
|
+
rechargeable;
|
|
405
|
+
backup;
|
|
406
|
+
overheating;
|
|
407
|
+
lowFluid;
|
|
408
|
+
rechargeOrReplace;
|
|
409
|
+
disconnected;
|
|
410
|
+
lowTemperatureStatus;
|
|
411
|
+
serialize(ctx) {
|
|
412
|
+
this.payload = Bytes.from([this.isLow ? 0xff : this.level]);
|
|
413
|
+
if (this.chargingStatus != undefined) {
|
|
414
|
+
this.payload = Bytes.concat([
|
|
415
|
+
this.payload,
|
|
416
|
+
Bytes.from([
|
|
417
|
+
(this.chargingStatus << 6)
|
|
418
|
+
+ (this.rechargeable ? 0b0010_0000 : 0)
|
|
419
|
+
+ (this.backup ? 0b0001_0000 : 0)
|
|
420
|
+
+ (this.overheating ? 0b1000 : 0)
|
|
421
|
+
+ (this.lowFluid ? 0b0100 : 0)
|
|
422
|
+
+ (this.rechargeOrReplace === BatteryReplacementStatus.Now
|
|
423
|
+
? 0b10
|
|
424
|
+
: this.rechargeOrReplace
|
|
425
|
+
=== BatteryReplacementStatus.Soon
|
|
426
|
+
? 0b1
|
|
427
|
+
: 0),
|
|
428
|
+
(this.lowTemperatureStatus ? 0b10 : 0)
|
|
429
|
+
+ (this.disconnected ? 0b1 : 0),
|
|
430
|
+
]),
|
|
431
|
+
]);
|
|
432
|
+
}
|
|
433
|
+
return super.serialize(ctx);
|
|
377
434
|
}
|
|
378
|
-
|
|
379
|
-
message
|
|
435
|
+
toLogEntry(ctx) {
|
|
436
|
+
const message = {
|
|
437
|
+
level: this.level,
|
|
438
|
+
"is low": this.isLow,
|
|
439
|
+
};
|
|
440
|
+
if (this.chargingStatus != undefined) {
|
|
441
|
+
message["charging status"] = getEnumMemberName(BatteryChargingStatus, this.chargingStatus);
|
|
442
|
+
}
|
|
443
|
+
if (this.rechargeable != undefined) {
|
|
444
|
+
message.rechargeable = this.rechargeable;
|
|
445
|
+
}
|
|
446
|
+
if (this.backup != undefined) {
|
|
447
|
+
message.backup = this.backup;
|
|
448
|
+
}
|
|
449
|
+
if (this.overheating != undefined) {
|
|
450
|
+
message.overheating = this.overheating;
|
|
451
|
+
}
|
|
452
|
+
if (this.lowFluid != undefined) {
|
|
453
|
+
message["low fluid"] = this.lowFluid;
|
|
454
|
+
}
|
|
455
|
+
if (this.rechargeOrReplace != undefined) {
|
|
456
|
+
message["recharge or replace"] = getEnumMemberName(BatteryReplacementStatus, this.rechargeOrReplace);
|
|
457
|
+
}
|
|
458
|
+
if (this.lowTemperatureStatus != undefined) {
|
|
459
|
+
message.lowTemperatureStatus = this.lowTemperatureStatus;
|
|
460
|
+
}
|
|
461
|
+
if (this.disconnected != undefined) {
|
|
462
|
+
message.disconnected = this.disconnected;
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
...super.toLogEntry(ctx),
|
|
466
|
+
message,
|
|
467
|
+
};
|
|
380
468
|
}
|
|
381
|
-
|
|
382
|
-
|
|
469
|
+
};
|
|
470
|
+
return BatteryCCReport = _classThis;
|
|
471
|
+
})();
|
|
472
|
+
export { BatteryCCReport };
|
|
473
|
+
let BatteryCCGet = (() => {
|
|
474
|
+
let _classDecorators = [CCCommand(BatteryCommand.Get), expectedCCResponse(BatteryCCReport)];
|
|
475
|
+
let _classDescriptor;
|
|
476
|
+
let _classExtraInitializers = [];
|
|
477
|
+
let _classThis;
|
|
478
|
+
let _classSuper = BatteryCC;
|
|
479
|
+
var BatteryCCGet = class extends _classSuper {
|
|
480
|
+
static { _classThis = this; }
|
|
481
|
+
static {
|
|
482
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
483
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
484
|
+
BatteryCCGet = _classThis = _classDescriptor.value;
|
|
485
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
486
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
383
487
|
}
|
|
384
|
-
|
|
385
|
-
|
|
488
|
+
};
|
|
489
|
+
return BatteryCCGet = _classThis;
|
|
490
|
+
})();
|
|
491
|
+
export { BatteryCCGet };
|
|
492
|
+
let BatteryCCHealthReport = (() => {
|
|
493
|
+
let _classDecorators = [CCCommand(BatteryCommand.HealthReport), ccValueProperty("maximumCapacity", BatteryCCValues.maximumCapacity), ccValueProperty("temperature", BatteryCCValues.temperature)];
|
|
494
|
+
let _classDescriptor;
|
|
495
|
+
let _classExtraInitializers = [];
|
|
496
|
+
let _classThis;
|
|
497
|
+
let _classSuper = BatteryCC;
|
|
498
|
+
var BatteryCCHealthReport = class extends _classSuper {
|
|
499
|
+
static { _classThis = this; }
|
|
500
|
+
static {
|
|
501
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
502
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
503
|
+
BatteryCCHealthReport = _classThis = _classDescriptor.value;
|
|
504
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
505
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
386
506
|
}
|
|
387
|
-
|
|
388
|
-
|
|
507
|
+
constructor(options) {
|
|
508
|
+
super(options);
|
|
509
|
+
// TODO: Check implementation:
|
|
510
|
+
this.maximumCapacity = options.maximumCapacity;
|
|
511
|
+
this.temperature = options.temperature;
|
|
512
|
+
this.temperatureScale = options.temperatureScale;
|
|
389
513
|
}
|
|
390
|
-
|
|
391
|
-
|
|
514
|
+
static from(raw, ctx) {
|
|
515
|
+
validatePayload(raw.payload.length >= 2);
|
|
516
|
+
// Parse maximum capacity. 0xff means unknown
|
|
517
|
+
let maximumCapacity = raw.payload[0];
|
|
518
|
+
if (maximumCapacity === 0xff)
|
|
519
|
+
maximumCapacity = undefined;
|
|
520
|
+
const { value: temperature, scale: temperatureScale, } = parseFloatWithScale(raw.payload.subarray(1), true);
|
|
521
|
+
return new this({
|
|
522
|
+
nodeId: ctx.sourceNodeId,
|
|
523
|
+
maximumCapacity,
|
|
524
|
+
temperature,
|
|
525
|
+
temperatureScale,
|
|
526
|
+
});
|
|
392
527
|
}
|
|
393
|
-
|
|
394
|
-
|
|
528
|
+
persistValues(ctx) {
|
|
529
|
+
if (!super.persistValues(ctx))
|
|
530
|
+
return false;
|
|
531
|
+
// Update the temperature unit in the value DB
|
|
532
|
+
const temperatureValue = BatteryCCValues.temperature;
|
|
533
|
+
this.setMetadata(ctx, temperatureValue, {
|
|
534
|
+
...temperatureValue.meta,
|
|
535
|
+
unit: this.temperatureScale === 0x00 ? "°C" : undefined,
|
|
536
|
+
});
|
|
537
|
+
return true;
|
|
395
538
|
}
|
|
396
|
-
|
|
397
|
-
|
|
539
|
+
maximumCapacity;
|
|
540
|
+
temperature;
|
|
541
|
+
temperatureScale;
|
|
542
|
+
toLogEntry(ctx) {
|
|
543
|
+
return {
|
|
544
|
+
...super.toLogEntry(ctx),
|
|
545
|
+
message: {
|
|
546
|
+
temperature: this.temperature != undefined
|
|
547
|
+
? this.temperature
|
|
548
|
+
: "unknown",
|
|
549
|
+
"max capacity": this.maximumCapacity != undefined
|
|
550
|
+
? `${this.maximumCapacity} %`
|
|
551
|
+
: "unknown",
|
|
552
|
+
},
|
|
553
|
+
};
|
|
398
554
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
__decorate([
|
|
406
|
-
ccValue(BatteryCCValues.level)
|
|
407
|
-
], BatteryCCReport.prototype, "level", void 0);
|
|
408
|
-
__decorate([
|
|
409
|
-
ccValue(BatteryCCValues.isLow)
|
|
410
|
-
], BatteryCCReport.prototype, "isLow", void 0);
|
|
411
|
-
__decorate([
|
|
412
|
-
ccValue(BatteryCCValues.chargingStatus)
|
|
413
|
-
], BatteryCCReport.prototype, "chargingStatus", void 0);
|
|
414
|
-
__decorate([
|
|
415
|
-
ccValue(BatteryCCValues.rechargeable)
|
|
416
|
-
], BatteryCCReport.prototype, "rechargeable", void 0);
|
|
417
|
-
__decorate([
|
|
418
|
-
ccValue(BatteryCCValues.backup)
|
|
419
|
-
], BatteryCCReport.prototype, "backup", void 0);
|
|
420
|
-
__decorate([
|
|
421
|
-
ccValue(BatteryCCValues.overheating)
|
|
422
|
-
], BatteryCCReport.prototype, "overheating", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
ccValue(BatteryCCValues.lowFluid)
|
|
425
|
-
], BatteryCCReport.prototype, "lowFluid", void 0);
|
|
426
|
-
__decorate([
|
|
427
|
-
ccValue(BatteryCCValues.rechargeOrReplace)
|
|
428
|
-
], BatteryCCReport.prototype, "rechargeOrReplace", void 0);
|
|
429
|
-
__decorate([
|
|
430
|
-
ccValue(BatteryCCValues.disconnected)
|
|
431
|
-
], BatteryCCReport.prototype, "disconnected", void 0);
|
|
432
|
-
__decorate([
|
|
433
|
-
ccValue(BatteryCCValues.lowTemperatureStatus)
|
|
434
|
-
], BatteryCCReport.prototype, "lowTemperatureStatus", void 0);
|
|
435
|
-
BatteryCCReport = BatteryCCReport_1 = __decorate([
|
|
436
|
-
CCCommand(BatteryCommand.Report)
|
|
437
|
-
], BatteryCCReport);
|
|
438
|
-
export { BatteryCCReport };
|
|
439
|
-
let BatteryCCGet = class BatteryCCGet extends BatteryCC {
|
|
440
|
-
};
|
|
441
|
-
BatteryCCGet = __decorate([
|
|
442
|
-
CCCommand(BatteryCommand.Get),
|
|
443
|
-
expectedCCResponse(BatteryCCReport)
|
|
444
|
-
], BatteryCCGet);
|
|
445
|
-
export { BatteryCCGet };
|
|
446
|
-
let BatteryCCHealthReport = BatteryCCHealthReport_1 = class BatteryCCHealthReport extends BatteryCC {
|
|
447
|
-
constructor(options) {
|
|
448
|
-
super(options);
|
|
449
|
-
// TODO: Check implementation:
|
|
450
|
-
this.maximumCapacity = options.maximumCapacity;
|
|
451
|
-
this.temperature = options.temperature;
|
|
452
|
-
this.temperatureScale = options.temperatureScale;
|
|
453
|
-
}
|
|
454
|
-
static from(raw, ctx) {
|
|
455
|
-
validatePayload(raw.payload.length >= 2);
|
|
456
|
-
// Parse maximum capacity. 0xff means unknown
|
|
457
|
-
let maximumCapacity = raw.payload[0];
|
|
458
|
-
if (maximumCapacity === 0xff)
|
|
459
|
-
maximumCapacity = undefined;
|
|
460
|
-
const { value: temperature, scale: temperatureScale, } = parseFloatWithScale(raw.payload.subarray(1), true);
|
|
461
|
-
return new BatteryCCHealthReport_1({
|
|
462
|
-
nodeId: ctx.sourceNodeId,
|
|
463
|
-
maximumCapacity,
|
|
464
|
-
temperature,
|
|
465
|
-
temperatureScale,
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
persistValues(ctx) {
|
|
469
|
-
if (!super.persistValues(ctx))
|
|
470
|
-
return false;
|
|
471
|
-
// Update the temperature unit in the value DB
|
|
472
|
-
const temperatureValue = BatteryCCValues.temperature;
|
|
473
|
-
this.setMetadata(ctx, temperatureValue, {
|
|
474
|
-
...temperatureValue.meta,
|
|
475
|
-
unit: this.temperatureScale === 0x00 ? "°C" : undefined,
|
|
476
|
-
});
|
|
477
|
-
return true;
|
|
478
|
-
}
|
|
479
|
-
maximumCapacity;
|
|
480
|
-
temperature;
|
|
481
|
-
temperatureScale;
|
|
482
|
-
toLogEntry(ctx) {
|
|
483
|
-
return {
|
|
484
|
-
...super.toLogEntry(ctx),
|
|
485
|
-
message: {
|
|
486
|
-
temperature: this.temperature != undefined
|
|
487
|
-
? this.temperature
|
|
488
|
-
: "unknown",
|
|
489
|
-
"max capacity": this.maximumCapacity != undefined
|
|
490
|
-
? `${this.maximumCapacity} %`
|
|
491
|
-
: "unknown",
|
|
492
|
-
},
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
__decorate([
|
|
497
|
-
ccValue(BatteryCCValues.maximumCapacity)
|
|
498
|
-
], BatteryCCHealthReport.prototype, "maximumCapacity", void 0);
|
|
499
|
-
__decorate([
|
|
500
|
-
ccValue(BatteryCCValues.temperature)
|
|
501
|
-
], BatteryCCHealthReport.prototype, "temperature", void 0);
|
|
502
|
-
BatteryCCHealthReport = BatteryCCHealthReport_1 = __decorate([
|
|
503
|
-
CCCommand(BatteryCommand.HealthReport)
|
|
504
|
-
], BatteryCCHealthReport);
|
|
555
|
+
};
|
|
556
|
+
return BatteryCCHealthReport = _classThis;
|
|
557
|
+
})();
|
|
505
558
|
export { BatteryCCHealthReport };
|
|
506
|
-
let BatteryCCHealthGet =
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
559
|
+
let BatteryCCHealthGet = (() => {
|
|
560
|
+
let _classDecorators = [CCCommand(BatteryCommand.HealthGet), expectedCCResponse(BatteryCCHealthReport)];
|
|
561
|
+
let _classDescriptor;
|
|
562
|
+
let _classExtraInitializers = [];
|
|
563
|
+
let _classThis;
|
|
564
|
+
let _classSuper = BatteryCC;
|
|
565
|
+
var BatteryCCHealthGet = class extends _classSuper {
|
|
566
|
+
static { _classThis = this; }
|
|
567
|
+
static {
|
|
568
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
569
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
570
|
+
BatteryCCHealthGet = _classThis = _classDescriptor.value;
|
|
571
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
572
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
return BatteryCCHealthGet = _classThis;
|
|
576
|
+
})();
|
|
512
577
|
export { BatteryCCHealthGet };
|
|
513
578
|
//# sourceMappingURL=BatteryCC.js.map
|