@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +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,10 +1,37 @@
|
|
|
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 ThermostatModeCCSet_1, ThermostatModeCCReport_1, ThermostatModeCCSupportedReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -48,7 +75,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
48
75
|
import { buffer2hex, getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
49
76
|
import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
50
77
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
51
|
-
import { API, CCCommand,
|
|
78
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
52
79
|
import { V } from "../lib/Values.js";
|
|
53
80
|
import { ThermostatMode, ThermostatModeCommand } from "../lib/_Types.js";
|
|
54
81
|
export const ThermostatModeCCValues = Object.freeze({
|
|
@@ -65,362 +92,439 @@ export const ThermostatModeCCValues = Object.freeze({
|
|
|
65
92
|
...V.staticProperty("supportedModes", undefined, { internal: true }),
|
|
66
93
|
}),
|
|
67
94
|
});
|
|
68
|
-
let ThermostatModeCCAPI =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
|
|
91
|
-
// aren't able to handle the GET this quickly.
|
|
92
|
-
this.schedulePoll({ property }, value);
|
|
95
|
+
let ThermostatModeCCAPI = (() => {
|
|
96
|
+
let _classDecorators = [API(CommandClasses["Thermostat Mode"])];
|
|
97
|
+
let _classDescriptor;
|
|
98
|
+
let _classExtraInitializers = [];
|
|
99
|
+
let _classThis;
|
|
100
|
+
let _classSuper = CCAPI;
|
|
101
|
+
var ThermostatModeCCAPI = class extends _classSuper {
|
|
102
|
+
static { _classThis = this; }
|
|
103
|
+
static {
|
|
104
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
105
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
106
|
+
ThermostatModeCCAPI = _classThis = _classDescriptor.value;
|
|
107
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
108
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
109
|
+
}
|
|
110
|
+
supportsCommand(cmd) {
|
|
111
|
+
switch (cmd) {
|
|
112
|
+
case ThermostatModeCommand.Get:
|
|
113
|
+
case ThermostatModeCommand.SupportedGet:
|
|
114
|
+
return this.isSinglecast();
|
|
115
|
+
case ThermostatModeCommand.Set:
|
|
116
|
+
return true; // This is mandatory
|
|
93
117
|
}
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
switch (property) {
|
|
100
|
-
case "mode":
|
|
101
|
-
return (await this.get())?.[property];
|
|
102
|
-
default:
|
|
118
|
+
return super.supportsCommand(cmd);
|
|
119
|
+
}
|
|
120
|
+
get [SET_VALUE]() {
|
|
121
|
+
return async function ({ property }, value) {
|
|
122
|
+
if (property !== "mode") {
|
|
103
123
|
throwUnsupportedProperty(this.ccId, property);
|
|
124
|
+
}
|
|
125
|
+
if (typeof value !== "number") {
|
|
126
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
127
|
+
}
|
|
128
|
+
const result = await this.set(value);
|
|
129
|
+
// Verify the current value after a delay, unless the command was supervised and successful
|
|
130
|
+
if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
|
|
131
|
+
// TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
|
|
132
|
+
// aren't able to handle the GET this quickly.
|
|
133
|
+
this.schedulePoll({ property }, value);
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
get [POLL_VALUE]() {
|
|
139
|
+
return async function ({ property }) {
|
|
140
|
+
switch (property) {
|
|
141
|
+
case "mode":
|
|
142
|
+
return (await this.get())?.[property];
|
|
143
|
+
default:
|
|
144
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
149
|
+
async get() {
|
|
150
|
+
this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Get);
|
|
151
|
+
const cc = new ThermostatModeCCGet({
|
|
152
|
+
nodeId: this.endpoint.nodeId,
|
|
153
|
+
endpointIndex: this.endpoint.index,
|
|
154
|
+
});
|
|
155
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
156
|
+
if (response) {
|
|
157
|
+
return pick(response, ["mode", "manufacturerData"]);
|
|
104
158
|
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
108
|
-
async get() {
|
|
109
|
-
this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Get);
|
|
110
|
-
const cc = new ThermostatModeCCGet({
|
|
111
|
-
nodeId: this.endpoint.nodeId,
|
|
112
|
-
endpointIndex: this.endpoint.index,
|
|
113
|
-
});
|
|
114
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
115
|
-
if (response) {
|
|
116
|
-
return pick(response, ["mode", "manufacturerData"]);
|
|
117
159
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
160
|
+
async set(mode, manufacturerData) {
|
|
161
|
+
__assertType("mode", "ThermostatMode", __assertType__ThermostatMode.bind(void 0, mode));
|
|
162
|
+
__assertType("manufacturerData", undefined, __assertType__optional_su__string__uint8array_eu.bind(void 0, manufacturerData));
|
|
163
|
+
this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Set);
|
|
164
|
+
if (typeof manufacturerData === "string") {
|
|
165
|
+
// We accept the manufacturer data as a hex string. Make sure it's valid
|
|
166
|
+
if (manufacturerData.length % 2 !== 0
|
|
167
|
+
|| !/^[0-9a-f]+$/i.test(manufacturerData)) {
|
|
168
|
+
throw new ZWaveError(`Manufacturer data must be represented as hexadecimal when passed as a string!`, ZWaveErrorCodes.Argument_Invalid);
|
|
169
|
+
}
|
|
170
|
+
manufacturerData = Bytes.from(manufacturerData, "hex");
|
|
128
171
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
};
|
|
149
|
-
ThermostatModeCCAPI = __decorate([
|
|
150
|
-
API(CommandClasses["Thermostat Mode"])
|
|
151
|
-
], ThermostatModeCCAPI);
|
|
172
|
+
const cc = new ThermostatModeCCSet({
|
|
173
|
+
nodeId: this.endpoint.nodeId,
|
|
174
|
+
endpointIndex: this.endpoint.index,
|
|
175
|
+
mode,
|
|
176
|
+
manufacturerData: manufacturerData,
|
|
177
|
+
});
|
|
178
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
179
|
+
}
|
|
180
|
+
async getSupportedModes() {
|
|
181
|
+
this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.SupportedGet);
|
|
182
|
+
const cc = new ThermostatModeCCSupportedGet({
|
|
183
|
+
nodeId: this.endpoint.nodeId,
|
|
184
|
+
endpointIndex: this.endpoint.index,
|
|
185
|
+
});
|
|
186
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
187
|
+
return response?.supportedModes;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
return ThermostatModeCCAPI = _classThis;
|
|
191
|
+
})();
|
|
152
192
|
export { ThermostatModeCCAPI };
|
|
153
|
-
let ThermostatModeCC =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
.map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
|
|
175
|
-
.join("")}`;
|
|
193
|
+
let ThermostatModeCC = (() => {
|
|
194
|
+
let _classDecorators = [commandClass(CommandClasses["Thermostat Mode"]), implementedVersion(3), ccValues(ThermostatModeCCValues)];
|
|
195
|
+
let _classDescriptor;
|
|
196
|
+
let _classExtraInitializers = [];
|
|
197
|
+
let _classThis;
|
|
198
|
+
let _classSuper = CommandClass;
|
|
199
|
+
var ThermostatModeCC = class extends _classSuper {
|
|
200
|
+
static { _classThis = this; }
|
|
201
|
+
static {
|
|
202
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
203
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
204
|
+
ThermostatModeCC = _classThis = _classDescriptor.value;
|
|
205
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
206
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
207
|
+
}
|
|
208
|
+
async interview(ctx) {
|
|
209
|
+
const node = this.getNode(ctx);
|
|
210
|
+
const endpoint = this.getEndpoint(ctx);
|
|
211
|
+
const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
|
|
212
|
+
priority: MessagePriority.NodeQuery,
|
|
213
|
+
});
|
|
176
214
|
ctx.logNode(node.id, {
|
|
177
215
|
endpoint: this.endpointIndex,
|
|
178
|
-
message:
|
|
179
|
-
direction: "
|
|
216
|
+
message: `Interviewing ${this.ccName}...`,
|
|
217
|
+
direction: "none",
|
|
180
218
|
});
|
|
181
|
-
|
|
182
|
-
else {
|
|
219
|
+
// First query the possible modes to set the metadata
|
|
183
220
|
ctx.logNode(node.id, {
|
|
184
221
|
endpoint: this.endpointIndex,
|
|
185
|
-
message: "
|
|
186
|
-
|
|
222
|
+
message: "querying supported thermostat modes...",
|
|
223
|
+
direction: "outbound",
|
|
187
224
|
});
|
|
188
|
-
|
|
225
|
+
const supportedModes = await api.getSupportedModes();
|
|
226
|
+
if (supportedModes) {
|
|
227
|
+
const logMessage = `received supported thermostat modes:${supportedModes
|
|
228
|
+
.map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
|
|
229
|
+
.join("")}`;
|
|
230
|
+
ctx.logNode(node.id, {
|
|
231
|
+
endpoint: this.endpointIndex,
|
|
232
|
+
message: logMessage,
|
|
233
|
+
direction: "inbound",
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
ctx.logNode(node.id, {
|
|
238
|
+
endpoint: this.endpointIndex,
|
|
239
|
+
message: "Querying supported thermostat modes timed out, skipping interview...",
|
|
240
|
+
level: "warn",
|
|
241
|
+
});
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
await this.refreshValues(ctx);
|
|
245
|
+
// Remember that the interview is complete
|
|
246
|
+
this.setInterviewComplete(ctx, true);
|
|
189
247
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
|
|
198
|
-
priority: MessagePriority.NodeQuery,
|
|
199
|
-
});
|
|
200
|
-
// Query the current status
|
|
201
|
-
ctx.logNode(node.id, {
|
|
202
|
-
endpoint: this.endpointIndex,
|
|
203
|
-
message: "querying current thermostat mode...",
|
|
204
|
-
direction: "outbound",
|
|
205
|
-
});
|
|
206
|
-
const currentStatus = await api.get();
|
|
207
|
-
if (currentStatus) {
|
|
248
|
+
async refreshValues(ctx) {
|
|
249
|
+
const node = this.getNode(ctx);
|
|
250
|
+
const endpoint = this.getEndpoint(ctx);
|
|
251
|
+
const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
|
|
252
|
+
priority: MessagePriority.NodeQuery,
|
|
253
|
+
});
|
|
254
|
+
// Query the current status
|
|
208
255
|
ctx.logNode(node.id, {
|
|
209
256
|
endpoint: this.endpointIndex,
|
|
210
|
-
message: "
|
|
211
|
-
|
|
212
|
-
direction: "inbound",
|
|
257
|
+
message: "querying current thermostat mode...",
|
|
258
|
+
direction: "outbound",
|
|
213
259
|
});
|
|
260
|
+
const currentStatus = await api.get();
|
|
261
|
+
if (currentStatus) {
|
|
262
|
+
ctx.logNode(node.id, {
|
|
263
|
+
endpoint: this.endpointIndex,
|
|
264
|
+
message: "received current thermostat mode: "
|
|
265
|
+
+ getEnumMemberName(ThermostatMode, currentStatus.mode),
|
|
266
|
+
direction: "inbound",
|
|
267
|
+
});
|
|
268
|
+
}
|
|
214
269
|
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
commandClass(CommandClasses["Thermostat Mode"]),
|
|
219
|
-
implementedVersion(3),
|
|
220
|
-
ccValues(ThermostatModeCCValues)
|
|
221
|
-
], ThermostatModeCC);
|
|
270
|
+
};
|
|
271
|
+
return ThermostatModeCC = _classThis;
|
|
272
|
+
})();
|
|
222
273
|
export { ThermostatModeCC };
|
|
223
|
-
let ThermostatModeCCSet =
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
274
|
+
let ThermostatModeCCSet = (() => {
|
|
275
|
+
let _classDecorators = [CCCommand(ThermostatModeCommand.Set), useSupervision()];
|
|
276
|
+
let _classDescriptor;
|
|
277
|
+
let _classExtraInitializers = [];
|
|
278
|
+
let _classThis;
|
|
279
|
+
let _classSuper = ThermostatModeCC;
|
|
280
|
+
var ThermostatModeCCSet = class extends _classSuper {
|
|
281
|
+
static { _classThis = this; }
|
|
282
|
+
static {
|
|
283
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
284
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
285
|
+
ThermostatModeCCSet = _classThis = _classDescriptor.value;
|
|
286
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
287
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
229
288
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
289
|
+
constructor(options) {
|
|
290
|
+
super(options);
|
|
291
|
+
this.mode = options.mode;
|
|
292
|
+
if ("manufacturerData" in options) {
|
|
293
|
+
this.manufacturerData = options.manufacturerData;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
static from(raw, ctx) {
|
|
297
|
+
validatePayload(raw.payload.length >= 1);
|
|
298
|
+
const mode = raw.payload[0] & 0b11111;
|
|
299
|
+
if (mode !== ThermostatMode["Manufacturer specific"]) {
|
|
300
|
+
return new this({
|
|
301
|
+
nodeId: ctx.sourceNodeId,
|
|
302
|
+
mode,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
const manufacturerDataLength = (raw.payload[0] >>> 5) & 0b111;
|
|
306
|
+
validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
|
|
307
|
+
const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
|
|
308
|
+
return new this({
|
|
236
309
|
nodeId: ctx.sourceNodeId,
|
|
237
310
|
mode,
|
|
311
|
+
manufacturerData,
|
|
238
312
|
});
|
|
239
313
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
...super.toLogEntry(ctx),
|
|
274
|
-
message,
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
ThermostatModeCCSet = ThermostatModeCCSet_1 = __decorate([
|
|
279
|
-
CCCommand(ThermostatModeCommand.Set),
|
|
280
|
-
useSupervision()
|
|
281
|
-
], ThermostatModeCCSet);
|
|
314
|
+
mode;
|
|
315
|
+
manufacturerData;
|
|
316
|
+
serialize(ctx) {
|
|
317
|
+
const manufacturerData = this.mode === ThermostatMode["Manufacturer specific"]
|
|
318
|
+
&& this.manufacturerData
|
|
319
|
+
? this.manufacturerData
|
|
320
|
+
: new Uint8Array();
|
|
321
|
+
const manufacturerDataLength = manufacturerData.length;
|
|
322
|
+
this.payload = Bytes.concat([
|
|
323
|
+
Bytes.from([
|
|
324
|
+
((manufacturerDataLength & 0b111) << 5) + (this.mode & 0b11111),
|
|
325
|
+
]),
|
|
326
|
+
manufacturerData,
|
|
327
|
+
]);
|
|
328
|
+
return super.serialize(ctx);
|
|
329
|
+
}
|
|
330
|
+
toLogEntry(ctx) {
|
|
331
|
+
const message = {
|
|
332
|
+
mode: getEnumMemberName(ThermostatMode, this.mode),
|
|
333
|
+
};
|
|
334
|
+
if (this.manufacturerData != undefined) {
|
|
335
|
+
message["manufacturer data"] = buffer2hex(this.manufacturerData);
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
...super.toLogEntry(ctx),
|
|
339
|
+
message,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
return ThermostatModeCCSet = _classThis;
|
|
344
|
+
})();
|
|
282
345
|
export { ThermostatModeCCSet };
|
|
283
|
-
let ThermostatModeCCReport =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
346
|
+
let ThermostatModeCCReport = (() => {
|
|
347
|
+
let _classDecorators = [CCCommand(ThermostatModeCommand.Report), ccValueProperty("mode", ThermostatModeCCValues.thermostatMode), ccValueProperty("manufacturerData", ThermostatModeCCValues.manufacturerData)];
|
|
348
|
+
let _classDescriptor;
|
|
349
|
+
let _classExtraInitializers = [];
|
|
350
|
+
let _classThis;
|
|
351
|
+
let _classSuper = ThermostatModeCC;
|
|
352
|
+
var ThermostatModeCCReport = class extends _classSuper {
|
|
353
|
+
static { _classThis = this; }
|
|
354
|
+
static {
|
|
355
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
356
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
357
|
+
ThermostatModeCCReport = _classThis = _classDescriptor.value;
|
|
358
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
359
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
360
|
+
}
|
|
361
|
+
constructor(options) {
|
|
362
|
+
super(options);
|
|
363
|
+
this.mode = options.mode;
|
|
364
|
+
this.manufacturerData = options.manufacturerData;
|
|
365
|
+
}
|
|
366
|
+
static from(raw, ctx) {
|
|
367
|
+
validatePayload(raw.payload.length >= 1);
|
|
368
|
+
const mode = raw.payload[0] & 0b11111;
|
|
369
|
+
if (mode !== ThermostatMode["Manufacturer specific"]) {
|
|
370
|
+
return new this({
|
|
371
|
+
nodeId: ctx.sourceNodeId,
|
|
372
|
+
mode,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
// V3+
|
|
376
|
+
const manufacturerDataLength = raw.payload[0] >>> 5;
|
|
377
|
+
validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
|
|
378
|
+
const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
|
|
379
|
+
return new this({
|
|
294
380
|
nodeId: ctx.sourceNodeId,
|
|
295
381
|
mode,
|
|
382
|
+
manufacturerData,
|
|
296
383
|
});
|
|
297
384
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
385
|
+
persistValues(ctx) {
|
|
386
|
+
if (!super.persistValues(ctx))
|
|
387
|
+
return false;
|
|
388
|
+
// Update the supported modes if a mode is used that wasn't previously
|
|
389
|
+
// reported to be supported. This shouldn't happen, but well... it does anyways
|
|
390
|
+
const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
|
|
391
|
+
const supportedModesValue = ThermostatModeCCValues.supportedModes;
|
|
392
|
+
const supportedModes = this.getValue(ctx, supportedModesValue);
|
|
393
|
+
if (supportedModes
|
|
394
|
+
&& this.mode in ThermostatMode
|
|
395
|
+
&& !supportedModes.includes(this.mode)) {
|
|
396
|
+
supportedModes.push(this.mode);
|
|
397
|
+
supportedModes.sort();
|
|
398
|
+
this.setMetadata(ctx, thermostatModeValue, {
|
|
399
|
+
...thermostatModeValue.meta,
|
|
400
|
+
states: enumValuesToMetadataStates(ThermostatMode, supportedModes),
|
|
401
|
+
});
|
|
402
|
+
this.setValue(ctx, supportedModesValue, supportedModes);
|
|
403
|
+
}
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
mode;
|
|
407
|
+
manufacturerData;
|
|
408
|
+
serialize(ctx) {
|
|
409
|
+
const manufacturerDataLength = this.mode === ThermostatMode["Manufacturer specific"]
|
|
410
|
+
&& this.manufacturerData
|
|
411
|
+
? Math.min(0b111, this.manufacturerData.length)
|
|
412
|
+
: 0;
|
|
413
|
+
this.payload = new Bytes(1 + manufacturerDataLength);
|
|
414
|
+
this.payload[0] = (manufacturerDataLength << 5) + (this.mode & 0b11111);
|
|
415
|
+
if (manufacturerDataLength && this.manufacturerData) {
|
|
416
|
+
this.payload.set(this.manufacturerData.subarray(0, manufacturerDataLength), 1);
|
|
417
|
+
}
|
|
418
|
+
return super.serialize(ctx);
|
|
419
|
+
}
|
|
420
|
+
toLogEntry(ctx) {
|
|
421
|
+
const message = {
|
|
422
|
+
mode: getEnumMemberName(ThermostatMode, this.mode),
|
|
423
|
+
};
|
|
424
|
+
if (this.manufacturerData != undefined) {
|
|
425
|
+
message["manufacturer data"] = buffer2hex(this.manufacturerData);
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
...super.toLogEntry(ctx),
|
|
429
|
+
message,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
return ThermostatModeCCReport = _classThis;
|
|
434
|
+
})();
|
|
435
|
+
export { ThermostatModeCCReport };
|
|
436
|
+
let ThermostatModeCCGet = (() => {
|
|
437
|
+
let _classDecorators = [CCCommand(ThermostatModeCommand.Get), expectedCCResponse(ThermostatModeCCReport)];
|
|
438
|
+
let _classDescriptor;
|
|
439
|
+
let _classExtraInitializers = [];
|
|
440
|
+
let _classThis;
|
|
441
|
+
let _classSuper = ThermostatModeCC;
|
|
442
|
+
var ThermostatModeCCGet = class extends _classSuper {
|
|
443
|
+
static { _classThis = this; }
|
|
444
|
+
static {
|
|
445
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
446
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
447
|
+
ThermostatModeCCGet = _classThis = _classDescriptor.value;
|
|
448
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
449
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
return ThermostatModeCCGet = _classThis;
|
|
453
|
+
})();
|
|
454
|
+
export { ThermostatModeCCGet };
|
|
455
|
+
let ThermostatModeCCSupportedReport = (() => {
|
|
456
|
+
let _classDecorators = [CCCommand(ThermostatModeCommand.SupportedReport), ccValueProperty("supportedModes", ThermostatModeCCValues.supportedModes)];
|
|
457
|
+
let _classDescriptor;
|
|
458
|
+
let _classExtraInitializers = [];
|
|
459
|
+
let _classThis;
|
|
460
|
+
let _classSuper = ThermostatModeCC;
|
|
461
|
+
var ThermostatModeCCSupportedReport = class extends _classSuper {
|
|
462
|
+
static { _classThis = this; }
|
|
463
|
+
static {
|
|
464
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
465
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
466
|
+
ThermostatModeCCSupportedReport = _classThis = _classDescriptor.value;
|
|
467
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
468
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
469
|
+
}
|
|
470
|
+
constructor(options) {
|
|
471
|
+
super(options);
|
|
472
|
+
this.supportedModes = options.supportedModes;
|
|
473
|
+
}
|
|
474
|
+
static from(raw, ctx) {
|
|
475
|
+
const supportedModes = parseBitMask(raw.payload, ThermostatMode.Off);
|
|
476
|
+
return new this({
|
|
477
|
+
nodeId: ctx.sourceNodeId,
|
|
478
|
+
supportedModes,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
persistValues(ctx) {
|
|
482
|
+
if (!super.persistValues(ctx))
|
|
483
|
+
return false;
|
|
484
|
+
// Use this information to create the metadata for the mode property
|
|
485
|
+
const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
|
|
321
486
|
this.setMetadata(ctx, thermostatModeValue, {
|
|
322
487
|
...thermostatModeValue.meta,
|
|
323
|
-
states: enumValuesToMetadataStates(ThermostatMode, supportedModes),
|
|
488
|
+
states: enumValuesToMetadataStates(ThermostatMode, this.supportedModes),
|
|
324
489
|
});
|
|
325
|
-
|
|
490
|
+
return true;
|
|
326
491
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
mode: getEnumMemberName(ThermostatMode, this.mode),
|
|
346
|
-
};
|
|
347
|
-
if (this.manufacturerData != undefined) {
|
|
348
|
-
message["manufacturer data"] = buffer2hex(this.manufacturerData);
|
|
349
|
-
}
|
|
350
|
-
return {
|
|
351
|
-
...super.toLogEntry(ctx),
|
|
352
|
-
message,
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
__decorate([
|
|
357
|
-
ccValue(ThermostatModeCCValues.thermostatMode)
|
|
358
|
-
], ThermostatModeCCReport.prototype, "mode", void 0);
|
|
359
|
-
__decorate([
|
|
360
|
-
ccValue(ThermostatModeCCValues.manufacturerData)
|
|
361
|
-
], ThermostatModeCCReport.prototype, "manufacturerData", void 0);
|
|
362
|
-
ThermostatModeCCReport = ThermostatModeCCReport_1 = __decorate([
|
|
363
|
-
CCCommand(ThermostatModeCommand.Report)
|
|
364
|
-
], ThermostatModeCCReport);
|
|
365
|
-
export { ThermostatModeCCReport };
|
|
366
|
-
let ThermostatModeCCGet = class ThermostatModeCCGet extends ThermostatModeCC {
|
|
367
|
-
};
|
|
368
|
-
ThermostatModeCCGet = __decorate([
|
|
369
|
-
CCCommand(ThermostatModeCommand.Get),
|
|
370
|
-
expectedCCResponse(ThermostatModeCCReport)
|
|
371
|
-
], ThermostatModeCCGet);
|
|
372
|
-
export { ThermostatModeCCGet };
|
|
373
|
-
let ThermostatModeCCSupportedReport = ThermostatModeCCSupportedReport_1 = class ThermostatModeCCSupportedReport extends ThermostatModeCC {
|
|
374
|
-
constructor(options) {
|
|
375
|
-
super(options);
|
|
376
|
-
this.supportedModes = options.supportedModes;
|
|
377
|
-
}
|
|
378
|
-
static from(raw, ctx) {
|
|
379
|
-
const supportedModes = parseBitMask(raw.payload, ThermostatMode.Off);
|
|
380
|
-
return new ThermostatModeCCSupportedReport_1({
|
|
381
|
-
nodeId: ctx.sourceNodeId,
|
|
382
|
-
supportedModes,
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
persistValues(ctx) {
|
|
386
|
-
if (!super.persistValues(ctx))
|
|
387
|
-
return false;
|
|
388
|
-
// Use this information to create the metadata for the mode property
|
|
389
|
-
const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
|
|
390
|
-
this.setMetadata(ctx, thermostatModeValue, {
|
|
391
|
-
...thermostatModeValue.meta,
|
|
392
|
-
states: enumValuesToMetadataStates(ThermostatMode, this.supportedModes),
|
|
393
|
-
});
|
|
394
|
-
return true;
|
|
395
|
-
}
|
|
396
|
-
supportedModes;
|
|
397
|
-
serialize(ctx) {
|
|
398
|
-
this.payload = encodeBitMask(this.supportedModes, ThermostatMode["Manufacturer specific"], ThermostatMode.Off);
|
|
399
|
-
return super.serialize(ctx);
|
|
400
|
-
}
|
|
401
|
-
toLogEntry(ctx) {
|
|
402
|
-
return {
|
|
403
|
-
...super.toLogEntry(ctx),
|
|
404
|
-
message: {
|
|
405
|
-
"supported modes": this.supportedModes
|
|
406
|
-
.map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
|
|
407
|
-
.join(""),
|
|
408
|
-
},
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
__decorate([
|
|
413
|
-
ccValue(ThermostatModeCCValues.supportedModes)
|
|
414
|
-
], ThermostatModeCCSupportedReport.prototype, "supportedModes", void 0);
|
|
415
|
-
ThermostatModeCCSupportedReport = ThermostatModeCCSupportedReport_1 = __decorate([
|
|
416
|
-
CCCommand(ThermostatModeCommand.SupportedReport)
|
|
417
|
-
], ThermostatModeCCSupportedReport);
|
|
492
|
+
supportedModes;
|
|
493
|
+
serialize(ctx) {
|
|
494
|
+
this.payload = encodeBitMask(this.supportedModes, ThermostatMode["Manufacturer specific"], ThermostatMode.Off);
|
|
495
|
+
return super.serialize(ctx);
|
|
496
|
+
}
|
|
497
|
+
toLogEntry(ctx) {
|
|
498
|
+
return {
|
|
499
|
+
...super.toLogEntry(ctx),
|
|
500
|
+
message: {
|
|
501
|
+
"supported modes": this.supportedModes
|
|
502
|
+
.map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
|
|
503
|
+
.join(""),
|
|
504
|
+
},
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
return ThermostatModeCCSupportedReport = _classThis;
|
|
509
|
+
})();
|
|
418
510
|
export { ThermostatModeCCSupportedReport };
|
|
419
|
-
let ThermostatModeCCSupportedGet =
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
511
|
+
let ThermostatModeCCSupportedGet = (() => {
|
|
512
|
+
let _classDecorators = [CCCommand(ThermostatModeCommand.SupportedGet), expectedCCResponse(ThermostatModeCCSupportedReport)];
|
|
513
|
+
let _classDescriptor;
|
|
514
|
+
let _classExtraInitializers = [];
|
|
515
|
+
let _classThis;
|
|
516
|
+
let _classSuper = ThermostatModeCC;
|
|
517
|
+
var ThermostatModeCCSupportedGet = class extends _classSuper {
|
|
518
|
+
static { _classThis = this; }
|
|
519
|
+
static {
|
|
520
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
521
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
522
|
+
ThermostatModeCCSupportedGet = _classThis = _classDescriptor.value;
|
|
523
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
524
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
return ThermostatModeCCSupportedGet = _classThis;
|
|
528
|
+
})();
|
|
425
529
|
export { ThermostatModeCCSupportedGet };
|
|
426
530
|
//# sourceMappingURL=ThermostatModeCC.js.map
|