@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,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 ThermostatSetpointCCSet_1, ThermostatSetpointCCReport_1, ThermostatSetpointCCGet_1, ThermostatSetpointCCCapabilitiesReport_1, ThermostatSetpointCCCapabilitiesGet_1, ThermostatSetpointCCSupportedReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -22,7 +49,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
22
49
|
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
23
50
|
import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
24
51
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
25
|
-
import { API, CCCommand,
|
|
52
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
26
53
|
import { V } from "../lib/Values.js";
|
|
27
54
|
import { ThermostatSetpointCommand, ThermostatSetpointType, } from "../lib/_Types.js";
|
|
28
55
|
// This array is used to map the advertised supported types (interpretation A)
|
|
@@ -64,236 +91,295 @@ export const ThermostatSetpointCCValues = Object.freeze({
|
|
|
64
91
|
...V.dynamicPropertyAndKeyWithName("setpointScale", "setpointScale", (setpointType) => setpointType, ({ property, propertyKey }) => property === "setpointScale" && typeof propertyKey === "number", undefined, { internal: true }),
|
|
65
92
|
}),
|
|
66
93
|
});
|
|
67
|
-
let ThermostatSetpointCCAPI =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// SDS14223: The Scale field value MUST be identical to the value received in the Thermostat Setpoint Report for the
|
|
92
|
-
// actual Setpoint Type during the node interview. Fall back to the first scale if none is known
|
|
93
|
-
const preferredScale = this.tryGetValueDB()?.getValue(ThermostatSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index));
|
|
94
|
-
const result = await this.set(propertyKey, value, preferredScale ?? 0);
|
|
95
|
-
// Verify the current value after a delay, unless the command was supervised and successful
|
|
96
|
-
if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
|
|
97
|
-
// TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
|
|
98
|
-
// aren't able to handle the GET this quickly.
|
|
99
|
-
this.schedulePoll({ property, propertyKey }, value);
|
|
94
|
+
let ThermostatSetpointCCAPI = (() => {
|
|
95
|
+
let _classDecorators = [API(CommandClasses["Thermostat Setpoint"])];
|
|
96
|
+
let _classDescriptor;
|
|
97
|
+
let _classExtraInitializers = [];
|
|
98
|
+
let _classThis;
|
|
99
|
+
let _classSuper = CCAPI;
|
|
100
|
+
var ThermostatSetpointCCAPI = class extends _classSuper {
|
|
101
|
+
static { _classThis = this; }
|
|
102
|
+
static {
|
|
103
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
104
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
105
|
+
ThermostatSetpointCCAPI = _classThis = _classDescriptor.value;
|
|
106
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
107
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
108
|
+
}
|
|
109
|
+
supportsCommand(cmd) {
|
|
110
|
+
switch (cmd) {
|
|
111
|
+
case ThermostatSetpointCommand.Get:
|
|
112
|
+
case ThermostatSetpointCommand.SupportedGet:
|
|
113
|
+
return this.isSinglecast();
|
|
114
|
+
case ThermostatSetpointCommand.Set:
|
|
115
|
+
return true; // This is mandatory
|
|
116
|
+
case ThermostatSetpointCommand.CapabilitiesGet:
|
|
117
|
+
return this.version >= 3 && this.isSinglecast();
|
|
100
118
|
}
|
|
101
|
-
return
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
switch (property) {
|
|
107
|
-
case "setpoint":
|
|
108
|
-
if (typeof propertyKey !== "number") {
|
|
109
|
-
throw new ZWaveError(`${CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);
|
|
110
|
-
}
|
|
111
|
-
return (await this.get(propertyKey))?.value;
|
|
112
|
-
default:
|
|
119
|
+
return super.supportsCommand(cmd);
|
|
120
|
+
}
|
|
121
|
+
get [SET_VALUE]() {
|
|
122
|
+
return async function ({ property, propertyKey }, value) {
|
|
123
|
+
if (property !== "setpoint") {
|
|
113
124
|
throwUnsupportedProperty(this.ccId, property);
|
|
125
|
+
}
|
|
126
|
+
if (typeof propertyKey !== "number") {
|
|
127
|
+
throw new ZWaveError(`${CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);
|
|
128
|
+
}
|
|
129
|
+
if (typeof value !== "number") {
|
|
130
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
131
|
+
}
|
|
132
|
+
// SDS14223: The Scale field value MUST be identical to the value received in the Thermostat Setpoint Report for the
|
|
133
|
+
// actual Setpoint Type during the node interview. Fall back to the first scale if none is known
|
|
134
|
+
const preferredScale = this.tryGetValueDB()?.getValue(ThermostatSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index));
|
|
135
|
+
const result = await this.set(propertyKey, value, preferredScale ?? 0);
|
|
136
|
+
// Verify the current value after a delay, unless the command was supervised and successful
|
|
137
|
+
if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
|
|
138
|
+
// TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
|
|
139
|
+
// aren't able to handle the GET this quickly.
|
|
140
|
+
this.schedulePoll({ property, propertyKey }, value);
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
get [POLL_VALUE]() {
|
|
146
|
+
return async function ({ property, propertyKey }) {
|
|
147
|
+
switch (property) {
|
|
148
|
+
case "setpoint":
|
|
149
|
+
if (typeof propertyKey !== "number") {
|
|
150
|
+
throw new ZWaveError(`${CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);
|
|
151
|
+
}
|
|
152
|
+
return (await this.get(propertyKey))?.value;
|
|
153
|
+
default:
|
|
154
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
async get(setpointType) {
|
|
159
|
+
__assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
160
|
+
this.assertSupportsCommand(ThermostatSetpointCommand, ThermostatSetpointCommand.Get);
|
|
161
|
+
const cc = new ThermostatSetpointCCGet({
|
|
162
|
+
nodeId: this.endpoint.nodeId,
|
|
163
|
+
endpointIndex: this.endpoint.index,
|
|
164
|
+
setpointType,
|
|
165
|
+
});
|
|
166
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
167
|
+
if (!response)
|
|
168
|
+
return;
|
|
169
|
+
if (response.type !== ThermostatSetpointType["N/A"]) {
|
|
170
|
+
// This is a supported setpoint
|
|
171
|
+
const scale = getScale(response.scale);
|
|
172
|
+
return {
|
|
173
|
+
value: response.value,
|
|
174
|
+
scale,
|
|
175
|
+
};
|
|
114
176
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (!response)
|
|
127
|
-
return;
|
|
128
|
-
if (response.type !== ThermostatSetpointType["N/A"]) {
|
|
129
|
-
// This is a supported setpoint
|
|
130
|
-
const scale = getScale(response.scale);
|
|
131
|
-
return {
|
|
132
|
-
value: response.value,
|
|
177
|
+
}
|
|
178
|
+
async set(setpointType, value, scale) {
|
|
179
|
+
__assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
180
|
+
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
181
|
+
__assertType("scale", "number", __assertType__number.bind(void 0, scale));
|
|
182
|
+
this.assertSupportsCommand(ThermostatSetpointCommand, ThermostatSetpointCommand.Set);
|
|
183
|
+
const cc = new ThermostatSetpointCCSet({
|
|
184
|
+
nodeId: this.endpoint.nodeId,
|
|
185
|
+
endpointIndex: this.endpoint.index,
|
|
186
|
+
setpointType,
|
|
187
|
+
value,
|
|
133
188
|
scale,
|
|
134
|
-
};
|
|
189
|
+
});
|
|
190
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
135
191
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.assertSupportsCommand(ThermostatSetpointCommand, ThermostatSetpointCommand.CapabilitiesGet);
|
|
154
|
-
const cc = new ThermostatSetpointCCCapabilitiesGet({
|
|
155
|
-
nodeId: this.endpoint.nodeId,
|
|
156
|
-
endpointIndex: this.endpoint.index,
|
|
157
|
-
setpointType,
|
|
158
|
-
});
|
|
159
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
160
|
-
if (response) {
|
|
161
|
-
return pick(response, [
|
|
162
|
-
"minValue",
|
|
163
|
-
"maxValue",
|
|
164
|
-
"minValueScale",
|
|
165
|
-
"maxValueScale",
|
|
166
|
-
]);
|
|
192
|
+
async getCapabilities(setpointType) {
|
|
193
|
+
__assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
194
|
+
this.assertSupportsCommand(ThermostatSetpointCommand, ThermostatSetpointCommand.CapabilitiesGet);
|
|
195
|
+
const cc = new ThermostatSetpointCCCapabilitiesGet({
|
|
196
|
+
nodeId: this.endpoint.nodeId,
|
|
197
|
+
endpointIndex: this.endpoint.index,
|
|
198
|
+
setpointType,
|
|
199
|
+
});
|
|
200
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
201
|
+
if (response) {
|
|
202
|
+
return pick(response, [
|
|
203
|
+
"minValue",
|
|
204
|
+
"maxValue",
|
|
205
|
+
"minValueScale",
|
|
206
|
+
"maxValueScale",
|
|
207
|
+
]);
|
|
208
|
+
}
|
|
167
209
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return response?.supportedSetpointTypes;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
ThermostatSetpointCCAPI = __decorate([
|
|
185
|
-
API(CommandClasses["Thermostat Setpoint"])
|
|
186
|
-
], ThermostatSetpointCCAPI);
|
|
187
|
-
export { ThermostatSetpointCCAPI };
|
|
188
|
-
let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass {
|
|
189
|
-
translatePropertyKey(ctx, property, propertyKey) {
|
|
190
|
-
if (property === "setpoint") {
|
|
191
|
-
return getEnumMemberName(ThermostatSetpointType, propertyKey);
|
|
210
|
+
/**
|
|
211
|
+
* Requests the supported setpoint types from the node. Due to inconsistencies it is NOT recommended
|
|
212
|
+
* to use this method on nodes with CC versions 1 and 2. Instead rely on the information determined
|
|
213
|
+
* during node interview.
|
|
214
|
+
*/
|
|
215
|
+
async getSupportedSetpointTypes() {
|
|
216
|
+
this.assertSupportsCommand(ThermostatSetpointCommand, ThermostatSetpointCommand.SupportedGet);
|
|
217
|
+
const cc = new ThermostatSetpointCCSupportedGet({
|
|
218
|
+
nodeId: this.endpoint.nodeId,
|
|
219
|
+
endpointIndex: this.endpoint.index,
|
|
220
|
+
});
|
|
221
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
222
|
+
return response?.supportedSetpointTypes;
|
|
192
223
|
}
|
|
193
|
-
|
|
194
|
-
|
|
224
|
+
};
|
|
225
|
+
return ThermostatSetpointCCAPI = _classThis;
|
|
226
|
+
})();
|
|
227
|
+
export { ThermostatSetpointCCAPI };
|
|
228
|
+
let ThermostatSetpointCC = (() => {
|
|
229
|
+
let _classDecorators = [commandClass(CommandClasses["Thermostat Setpoint"]), implementedVersion(3), ccValues(ThermostatSetpointCCValues)];
|
|
230
|
+
let _classDescriptor;
|
|
231
|
+
let _classExtraInitializers = [];
|
|
232
|
+
let _classThis;
|
|
233
|
+
let _classSuper = CommandClass;
|
|
234
|
+
var ThermostatSetpointCC = class extends _classSuper {
|
|
235
|
+
static { _classThis = this; }
|
|
236
|
+
static {
|
|
237
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
238
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
239
|
+
ThermostatSetpointCC = _classThis = _classDescriptor.value;
|
|
240
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
241
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
195
242
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
ctx.logNode(node.id, {
|
|
204
|
-
endpoint: this.endpointIndex,
|
|
205
|
-
message: `Interviewing ${this.ccName}...`,
|
|
206
|
-
direction: "none",
|
|
207
|
-
});
|
|
208
|
-
if (api.version <= 2) {
|
|
209
|
-
// It has been found that early implementations of this Command Class applied two non-interoperable
|
|
210
|
-
// interpretations of the bit mask advertising the support for specific Setpoint Types in the Thermostat
|
|
211
|
-
// Setpoint Supported Report Command.
|
|
212
|
-
// A controlling node SHOULD determine the supported Setpoint Types of a version 1 and version 2
|
|
213
|
-
// supporting node by sending one Thermostat Setpoint Get Command at a time while incrementing
|
|
214
|
-
// the requested Setpoint Type.
|
|
215
|
-
// If the same Setpoint Type is advertised in the returned Thermostat Setpoint Report Command, the
|
|
216
|
-
// controlling node MUST conclude that the actual Setpoint Type is supported.
|
|
217
|
-
// If the Setpoint Type 0x00 (type N/A) is advertised in the returned Thermostat Setpoint Report
|
|
218
|
-
// Command, the controlling node MUST conclude that the actual Setpoint Type is not supported.
|
|
219
|
-
// Now scan all endpoints. Each type we received a value for gets marked as supported
|
|
220
|
-
const supportedSetpointTypes = [];
|
|
221
|
-
for (let type = ThermostatSetpointType.Heating; type <= ThermostatSetpointType["Full Power"]; type++) {
|
|
222
|
-
const setpointName = getEnumMemberName(ThermostatSetpointType, type);
|
|
223
|
-
// Every time, query the current value
|
|
224
|
-
ctx.logNode(node.id, {
|
|
225
|
-
endpoint: this.endpointIndex,
|
|
226
|
-
message: `querying current value of setpoint ${setpointName}...`,
|
|
227
|
-
direction: "outbound",
|
|
228
|
-
});
|
|
229
|
-
const setpoint = await api.get(type);
|
|
230
|
-
// If the node did not respond, assume the setpoint type is not supported
|
|
231
|
-
let logMessage;
|
|
232
|
-
if (setpoint) {
|
|
233
|
-
// Setpoint supported, remember the type
|
|
234
|
-
supportedSetpointTypes.push(type);
|
|
235
|
-
logMessage =
|
|
236
|
-
`received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
// We're sure about the interpretation - this should not happen
|
|
240
|
-
logMessage = `setpoint ${setpointName} is not supported`;
|
|
241
|
-
}
|
|
242
|
-
ctx.logNode(node.id, {
|
|
243
|
-
endpoint: this.endpointIndex,
|
|
244
|
-
message: logMessage,
|
|
245
|
-
direction: "inbound",
|
|
246
|
-
});
|
|
243
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
244
|
+
if (property === "setpoint") {
|
|
245
|
+
return getEnumMemberName(ThermostatSetpointType, propertyKey);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
247
249
|
}
|
|
248
|
-
// Remember which setpoint types are actually supported
|
|
249
|
-
this.setValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
|
|
250
250
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
async interview(ctx) {
|
|
252
|
+
const node = this.getNode(ctx);
|
|
253
|
+
const endpoint = this.getEndpoint(ctx);
|
|
254
|
+
const api = CCAPI.create(CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
|
|
255
|
+
priority: MessagePriority.NodeQuery,
|
|
256
|
+
});
|
|
255
257
|
ctx.logNode(node.id, {
|
|
256
258
|
endpoint: this.endpointIndex,
|
|
257
|
-
message:
|
|
258
|
-
direction: "
|
|
259
|
+
message: `Interviewing ${this.ccName}...`,
|
|
260
|
+
direction: "none",
|
|
259
261
|
});
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
262
|
+
if (api.version <= 2) {
|
|
263
|
+
// It has been found that early implementations of this Command Class applied two non-interoperable
|
|
264
|
+
// interpretations of the bit mask advertising the support for specific Setpoint Types in the Thermostat
|
|
265
|
+
// Setpoint Supported Report Command.
|
|
266
|
+
// A controlling node SHOULD determine the supported Setpoint Types of a version 1 and version 2
|
|
267
|
+
// supporting node by sending one Thermostat Setpoint Get Command at a time while incrementing
|
|
268
|
+
// the requested Setpoint Type.
|
|
269
|
+
// If the same Setpoint Type is advertised in the returned Thermostat Setpoint Report Command, the
|
|
270
|
+
// controlling node MUST conclude that the actual Setpoint Type is supported.
|
|
271
|
+
// If the Setpoint Type 0x00 (type N/A) is advertised in the returned Thermostat Setpoint Report
|
|
272
|
+
// Command, the controlling node MUST conclude that the actual Setpoint Type is not supported.
|
|
273
|
+
// Now scan all endpoints. Each type we received a value for gets marked as supported
|
|
274
|
+
const supportedSetpointTypes = [];
|
|
275
|
+
for (let type = ThermostatSetpointType.Heating; type <= ThermostatSetpointType["Full Power"]; type++) {
|
|
276
|
+
const setpointName = getEnumMemberName(ThermostatSetpointType, type);
|
|
277
|
+
// Every time, query the current value
|
|
278
|
+
ctx.logNode(node.id, {
|
|
279
|
+
endpoint: this.endpointIndex,
|
|
280
|
+
message: `querying current value of setpoint ${setpointName}...`,
|
|
281
|
+
direction: "outbound",
|
|
282
|
+
});
|
|
283
|
+
const setpoint = await api.get(type);
|
|
284
|
+
// If the node did not respond, assume the setpoint type is not supported
|
|
285
|
+
let logMessage;
|
|
286
|
+
if (setpoint) {
|
|
287
|
+
// Setpoint supported, remember the type
|
|
288
|
+
supportedSetpointTypes.push(type);
|
|
289
|
+
logMessage =
|
|
290
|
+
`received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
// We're sure about the interpretation - this should not happen
|
|
294
|
+
logMessage = `setpoint ${setpointName} is not supported`;
|
|
295
|
+
}
|
|
296
|
+
ctx.logNode(node.id, {
|
|
297
|
+
endpoint: this.endpointIndex,
|
|
298
|
+
message: logMessage,
|
|
299
|
+
direction: "inbound",
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
// Remember which setpoint types are actually supported
|
|
303
|
+
this.setValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
|
|
273
304
|
}
|
|
274
305
|
else {
|
|
306
|
+
// Versions >= 3 adhere to bitmap interpretation A, so we can rely on getSupportedSetpointTypes
|
|
307
|
+
// Query the supported setpoint types
|
|
308
|
+
let setpointTypes = [];
|
|
275
309
|
ctx.logNode(node.id, {
|
|
276
310
|
endpoint: this.endpointIndex,
|
|
277
|
-
message: "
|
|
278
|
-
|
|
311
|
+
message: "retrieving supported setpoint types...",
|
|
312
|
+
direction: "outbound",
|
|
279
313
|
});
|
|
280
|
-
|
|
314
|
+
const resp = await api.getSupportedSetpointTypes();
|
|
315
|
+
if (resp) {
|
|
316
|
+
setpointTypes = [...resp];
|
|
317
|
+
const logMessage = "received supported setpoint types:\n"
|
|
318
|
+
+ setpointTypes
|
|
319
|
+
.map((type) => getEnumMemberName(ThermostatSetpointType, type))
|
|
320
|
+
.map((name) => `· ${name}`)
|
|
321
|
+
.join("\n");
|
|
322
|
+
ctx.logNode(node.id, {
|
|
323
|
+
endpoint: this.endpointIndex,
|
|
324
|
+
message: logMessage,
|
|
325
|
+
direction: "inbound",
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
ctx.logNode(node.id, {
|
|
330
|
+
endpoint: this.endpointIndex,
|
|
331
|
+
message: "Querying supported setpoint types timed out, skipping interview...",
|
|
332
|
+
level: "warn",
|
|
333
|
+
});
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
for (const type of setpointTypes) {
|
|
337
|
+
const setpointName = getEnumMemberName(ThermostatSetpointType, type);
|
|
338
|
+
// Find out the capabilities of this setpoint
|
|
339
|
+
ctx.logNode(node.id, {
|
|
340
|
+
endpoint: this.endpointIndex,
|
|
341
|
+
message: `retrieving capabilities for setpoint ${setpointName}...`,
|
|
342
|
+
direction: "outbound",
|
|
343
|
+
});
|
|
344
|
+
const setpointCaps = await api.getCapabilities(type);
|
|
345
|
+
if (setpointCaps) {
|
|
346
|
+
const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);
|
|
347
|
+
const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);
|
|
348
|
+
const logMessage = `received capabilities for setpoint ${setpointName}:
|
|
349
|
+
minimum value: ${setpointCaps.minValue} ${minValueUnit}
|
|
350
|
+
maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
351
|
+
ctx.logNode(node.id, {
|
|
352
|
+
endpoint: this.endpointIndex,
|
|
353
|
+
message: logMessage,
|
|
354
|
+
direction: "inbound",
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Query the current value for all setpoint types
|
|
359
|
+
await this.refreshValues(ctx);
|
|
281
360
|
}
|
|
361
|
+
// Remember that the interview is complete
|
|
362
|
+
this.setInterviewComplete(ctx, true);
|
|
363
|
+
}
|
|
364
|
+
async refreshValues(ctx) {
|
|
365
|
+
const node = this.getNode(ctx);
|
|
366
|
+
const endpoint = this.getEndpoint(ctx);
|
|
367
|
+
const api = CCAPI.create(CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
|
|
368
|
+
priority: MessagePriority.NodeQuery,
|
|
369
|
+
});
|
|
370
|
+
const setpointTypes = this.getValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes) ?? [];
|
|
371
|
+
// Query each setpoint's current value
|
|
282
372
|
for (const type of setpointTypes) {
|
|
283
373
|
const setpointName = getEnumMemberName(ThermostatSetpointType, type);
|
|
284
|
-
//
|
|
374
|
+
// Every time, query the current value
|
|
285
375
|
ctx.logNode(node.id, {
|
|
286
376
|
endpoint: this.endpointIndex,
|
|
287
|
-
message: `
|
|
377
|
+
message: `querying current value of setpoint ${setpointName}...`,
|
|
288
378
|
direction: "outbound",
|
|
289
379
|
});
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);
|
|
294
|
-
const logMessage = `received capabilities for setpoint ${setpointName}:
|
|
295
|
-
minimum value: ${setpointCaps.minValue} ${minValueUnit}
|
|
296
|
-
maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
380
|
+
const setpoint = await api.get(type);
|
|
381
|
+
if (setpoint) {
|
|
382
|
+
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
297
383
|
ctx.logNode(node.id, {
|
|
298
384
|
endpoint: this.endpointIndex,
|
|
299
385
|
message: logMessage,
|
|
@@ -301,355 +387,400 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
|
301
387
|
});
|
|
302
388
|
}
|
|
303
389
|
}
|
|
304
|
-
// Query the current value for all setpoint types
|
|
305
|
-
await this.refreshValues(ctx);
|
|
306
390
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
391
|
+
};
|
|
392
|
+
return ThermostatSetpointCC = _classThis;
|
|
393
|
+
})();
|
|
394
|
+
export { ThermostatSetpointCC };
|
|
395
|
+
let ThermostatSetpointCCSet = (() => {
|
|
396
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.Set), useSupervision()];
|
|
397
|
+
let _classDescriptor;
|
|
398
|
+
let _classExtraInitializers = [];
|
|
399
|
+
let _classThis;
|
|
400
|
+
let _classSuper = ThermostatSetpointCC;
|
|
401
|
+
var ThermostatSetpointCCSet = class extends _classSuper {
|
|
402
|
+
static { _classThis = this; }
|
|
403
|
+
static {
|
|
404
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
405
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
406
|
+
ThermostatSetpointCCSet = _classThis = _classDescriptor.value;
|
|
407
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
408
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
409
|
+
}
|
|
410
|
+
constructor(options) {
|
|
411
|
+
super(options);
|
|
412
|
+
this.setpointType = options.setpointType;
|
|
413
|
+
this.value = options.value;
|
|
414
|
+
this.scale = options.scale;
|
|
415
|
+
}
|
|
416
|
+
static from(raw, ctx) {
|
|
417
|
+
validatePayload(raw.payload.length >= 1);
|
|
418
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
419
|
+
// parseFloatWithScale does its own validation
|
|
420
|
+
const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));
|
|
421
|
+
return new this({
|
|
422
|
+
nodeId: ctx.sourceNodeId,
|
|
423
|
+
setpointType,
|
|
424
|
+
value,
|
|
425
|
+
scale,
|
|
325
426
|
});
|
|
326
|
-
const setpoint = await api.get(type);
|
|
327
|
-
if (setpoint) {
|
|
328
|
-
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
329
|
-
ctx.logNode(node.id, {
|
|
330
|
-
endpoint: this.endpointIndex,
|
|
331
|
-
message: logMessage,
|
|
332
|
-
direction: "inbound",
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
427
|
}
|
|
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
|
-
setpointType;
|
|
364
|
-
value;
|
|
365
|
-
scale;
|
|
366
|
-
serialize(ctx) {
|
|
367
|
-
// If a config file overwrites how the float should be encoded, use that information
|
|
368
|
-
const override = ctx.getDeviceConfig?.(this.nodeId)
|
|
369
|
-
?.compat?.overrideFloatEncoding;
|
|
370
|
-
this.payload = Bytes.concat([
|
|
371
|
-
Bytes.from([this.setpointType & 0b1111]),
|
|
372
|
-
encodeFloatWithScale(this.value, this.scale, override),
|
|
373
|
-
]);
|
|
374
|
-
return super.serialize(ctx);
|
|
375
|
-
}
|
|
376
|
-
toLogEntry(ctx) {
|
|
377
|
-
const scale = getScale(this.scale);
|
|
378
|
-
return {
|
|
379
|
-
...super.toLogEntry(ctx),
|
|
380
|
-
message: {
|
|
381
|
-
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.setpointType),
|
|
382
|
-
value: `${this.value} ${scale.unit}`,
|
|
383
|
-
},
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
ThermostatSetpointCCSet = ThermostatSetpointCCSet_1 = __decorate([
|
|
388
|
-
CCCommand(ThermostatSetpointCommand.Set),
|
|
389
|
-
useSupervision()
|
|
390
|
-
], ThermostatSetpointCCSet);
|
|
428
|
+
setpointType;
|
|
429
|
+
value;
|
|
430
|
+
scale;
|
|
431
|
+
serialize(ctx) {
|
|
432
|
+
// If a config file overwrites how the float should be encoded, use that information
|
|
433
|
+
const override = ctx.getDeviceConfig?.(this.nodeId)
|
|
434
|
+
?.compat?.overrideFloatEncoding;
|
|
435
|
+
this.payload = Bytes.concat([
|
|
436
|
+
Bytes.from([this.setpointType & 0b1111]),
|
|
437
|
+
encodeFloatWithScale(this.value, this.scale, override),
|
|
438
|
+
]);
|
|
439
|
+
return super.serialize(ctx);
|
|
440
|
+
}
|
|
441
|
+
toLogEntry(ctx) {
|
|
442
|
+
const scale = getScale(this.scale);
|
|
443
|
+
return {
|
|
444
|
+
...super.toLogEntry(ctx),
|
|
445
|
+
message: {
|
|
446
|
+
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.setpointType),
|
|
447
|
+
value: `${this.value} ${scale.unit}`,
|
|
448
|
+
},
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
return ThermostatSetpointCCSet = _classThis;
|
|
453
|
+
})();
|
|
391
454
|
export { ThermostatSetpointCCSet };
|
|
392
|
-
let ThermostatSetpointCCReport =
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
455
|
+
let ThermostatSetpointCCReport = (() => {
|
|
456
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.Report)];
|
|
457
|
+
let _classDescriptor;
|
|
458
|
+
let _classExtraInitializers = [];
|
|
459
|
+
let _classThis;
|
|
460
|
+
let _classSuper = ThermostatSetpointCC;
|
|
461
|
+
var ThermostatSetpointCCReport = 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
|
+
ThermostatSetpointCCReport = _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.type = options.type;
|
|
473
|
+
this.value = options.value;
|
|
474
|
+
this.scale = options.scale;
|
|
475
|
+
}
|
|
476
|
+
static from(raw, ctx) {
|
|
477
|
+
validatePayload(raw.payload.length >= 1);
|
|
478
|
+
const type = raw.payload[0] & 0b1111;
|
|
479
|
+
if (type === 0) {
|
|
480
|
+
// Not supported
|
|
481
|
+
return new this({
|
|
482
|
+
nodeId: ctx.sourceNodeId,
|
|
483
|
+
type,
|
|
484
|
+
value: 0,
|
|
485
|
+
scale: 0,
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
// parseFloatWithScale does its own validation
|
|
489
|
+
const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));
|
|
490
|
+
return new this({
|
|
405
491
|
nodeId: ctx.sourceNodeId,
|
|
406
492
|
type,
|
|
407
|
-
value
|
|
408
|
-
scale
|
|
493
|
+
value,
|
|
494
|
+
scale,
|
|
409
495
|
});
|
|
410
496
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
type
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
this.setMetadata(ctx, setpointValue, {
|
|
429
|
-
...(existingMetadata ?? setpointValue.meta),
|
|
430
|
-
unit: scale.unit,
|
|
431
|
-
});
|
|
497
|
+
persistValues(ctx) {
|
|
498
|
+
if (!super.persistValues(ctx))
|
|
499
|
+
return false;
|
|
500
|
+
const scale = getScale(this.scale);
|
|
501
|
+
const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
|
|
502
|
+
const existingMetadata = this.getMetadata(ctx, setpointValue);
|
|
503
|
+
// Update the metadata when it is missing or the unit has changed
|
|
504
|
+
if (existingMetadata?.unit !== scale.unit) {
|
|
505
|
+
this.setMetadata(ctx, setpointValue, {
|
|
506
|
+
...(existingMetadata ?? setpointValue.meta),
|
|
507
|
+
unit: scale.unit,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
this.setValue(ctx, setpointValue, this.value);
|
|
511
|
+
// Remember the device-preferred setpoint scale so it can be used in SET commands
|
|
512
|
+
this.setValue(ctx, ThermostatSetpointCCValues.setpointScale(this.type), scale.key);
|
|
513
|
+
return true;
|
|
432
514
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
ThermostatSetpointCCReport = ThermostatSetpointCCReport_1 = __decorate([
|
|
460
|
-
CCCommand(ThermostatSetpointCommand.Report)
|
|
461
|
-
], ThermostatSetpointCCReport);
|
|
515
|
+
type;
|
|
516
|
+
scale;
|
|
517
|
+
value;
|
|
518
|
+
serialize(ctx) {
|
|
519
|
+
this.payload = Bytes.concat([
|
|
520
|
+
Bytes.from([this.type & 0b1111]),
|
|
521
|
+
encodeFloatWithScale(this.value, this.scale),
|
|
522
|
+
]);
|
|
523
|
+
return super.serialize(ctx);
|
|
524
|
+
}
|
|
525
|
+
toLogEntry(ctx) {
|
|
526
|
+
const scale = getScale(this.scale);
|
|
527
|
+
return {
|
|
528
|
+
...super.toLogEntry(ctx),
|
|
529
|
+
message: {
|
|
530
|
+
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.type),
|
|
531
|
+
value: `${this.value} ${scale.unit}`,
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
return ThermostatSetpointCCReport = _classThis;
|
|
537
|
+
})();
|
|
462
538
|
export { ThermostatSetpointCCReport };
|
|
463
539
|
function testResponseForThermostatSetpointGet(sent, received) {
|
|
464
540
|
// We expect a Thermostat Setpoint Report that matches the requested setpoint type
|
|
465
541
|
return received.type === sent.setpointType;
|
|
466
542
|
}
|
|
467
|
-
let ThermostatSetpointCCGet =
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
543
|
+
let ThermostatSetpointCCGet = (() => {
|
|
544
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.Get), expectedCCResponse(ThermostatSetpointCCReport, testResponseForThermostatSetpointGet)];
|
|
545
|
+
let _classDescriptor;
|
|
546
|
+
let _classExtraInitializers = [];
|
|
547
|
+
let _classThis;
|
|
548
|
+
let _classSuper = ThermostatSetpointCC;
|
|
549
|
+
var ThermostatSetpointCCGet = class extends _classSuper {
|
|
550
|
+
static { _classThis = this; }
|
|
551
|
+
static {
|
|
552
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
553
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
554
|
+
ThermostatSetpointCCGet = _classThis = _classDescriptor.value;
|
|
555
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
556
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
557
|
+
}
|
|
558
|
+
constructor(options) {
|
|
559
|
+
super(options);
|
|
560
|
+
this.setpointType = options.setpointType;
|
|
561
|
+
}
|
|
562
|
+
static from(raw, ctx) {
|
|
563
|
+
validatePayload(raw.payload.length >= 1);
|
|
564
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
565
|
+
return new this({
|
|
566
|
+
nodeId: ctx.sourceNodeId,
|
|
567
|
+
setpointType,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
setpointType;
|
|
571
|
+
serialize(ctx) {
|
|
572
|
+
this.payload = Bytes.from([this.setpointType & 0b1111]);
|
|
573
|
+
return super.serialize(ctx);
|
|
574
|
+
}
|
|
575
|
+
toLogEntry(ctx) {
|
|
576
|
+
return {
|
|
577
|
+
...super.toLogEntry(ctx),
|
|
578
|
+
message: {
|
|
579
|
+
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.setpointType),
|
|
580
|
+
},
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
return ThermostatSetpointCCGet = _classThis;
|
|
585
|
+
})();
|
|
498
586
|
export { ThermostatSetpointCCGet };
|
|
499
|
-
let ThermostatSetpointCCCapabilitiesReport =
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
type
|
|
517
|
-
minValue
|
|
518
|
-
minValueScale
|
|
519
|
-
maxValue
|
|
520
|
-
maxValueScale
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
587
|
+
let ThermostatSetpointCCCapabilitiesReport = (() => {
|
|
588
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.CapabilitiesReport)];
|
|
589
|
+
let _classDescriptor;
|
|
590
|
+
let _classExtraInitializers = [];
|
|
591
|
+
let _classThis;
|
|
592
|
+
let _classSuper = ThermostatSetpointCC;
|
|
593
|
+
var ThermostatSetpointCCCapabilitiesReport = class extends _classSuper {
|
|
594
|
+
static { _classThis = this; }
|
|
595
|
+
static {
|
|
596
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
597
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
598
|
+
ThermostatSetpointCCCapabilitiesReport = _classThis = _classDescriptor.value;
|
|
599
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
600
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
601
|
+
}
|
|
602
|
+
constructor(options) {
|
|
603
|
+
super(options);
|
|
604
|
+
this.type = options.type;
|
|
605
|
+
this.minValue = options.minValue;
|
|
606
|
+
this.minValueScale = options.minValueScale;
|
|
607
|
+
this.maxValue = options.maxValue;
|
|
608
|
+
this.maxValueScale = options.maxValueScale;
|
|
609
|
+
}
|
|
610
|
+
static from(raw, ctx) {
|
|
611
|
+
validatePayload(raw.payload.length >= 1);
|
|
612
|
+
const type = raw.payload[0];
|
|
613
|
+
// parseFloatWithScale does its own validation
|
|
614
|
+
const { value: minValue, scale: minValueScale, bytesRead, } = parseFloatWithScale(raw.payload.subarray(1));
|
|
615
|
+
const { value: maxValue, scale: maxValueScale } = parseFloatWithScale(raw.payload.subarray(1 + bytesRead));
|
|
616
|
+
return new this({
|
|
617
|
+
nodeId: ctx.sourceNodeId,
|
|
618
|
+
type,
|
|
619
|
+
minValue,
|
|
620
|
+
minValueScale,
|
|
621
|
+
maxValue,
|
|
622
|
+
maxValueScale,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
persistValues(ctx) {
|
|
626
|
+
if (!super.persistValues(ctx))
|
|
627
|
+
return false;
|
|
628
|
+
// Predefine the metadata
|
|
629
|
+
const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
|
|
630
|
+
this.setMetadata(ctx, setpointValue, {
|
|
631
|
+
...setpointValue.meta,
|
|
632
|
+
min: this.minValue,
|
|
633
|
+
max: this.maxValue,
|
|
634
|
+
unit: getSetpointUnit(this.minValueScale)
|
|
635
|
+
|| getSetpointUnit(this.maxValueScale),
|
|
636
|
+
});
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
type;
|
|
640
|
+
minValue;
|
|
641
|
+
maxValue;
|
|
642
|
+
minValueScale;
|
|
643
|
+
maxValueScale;
|
|
644
|
+
serialize(ctx) {
|
|
645
|
+
const min = encodeFloatWithScale(this.minValue, this.minValueScale);
|
|
646
|
+
const max = encodeFloatWithScale(this.maxValue, this.maxValueScale);
|
|
647
|
+
this.payload = Bytes.concat([Bytes.from([this.type]), min, max]);
|
|
648
|
+
return super.serialize(ctx);
|
|
649
|
+
}
|
|
650
|
+
toLogEntry(ctx) {
|
|
651
|
+
const minValueScale = getScale(this.minValueScale);
|
|
652
|
+
const maxValueScale = getScale(this.maxValueScale);
|
|
653
|
+
return {
|
|
654
|
+
...super.toLogEntry(ctx),
|
|
655
|
+
message: {
|
|
656
|
+
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.type),
|
|
657
|
+
"min value": `${this.minValue} ${minValueScale.unit}`,
|
|
658
|
+
"max value": `${this.maxValue} ${maxValueScale.unit}`,
|
|
659
|
+
},
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
return ThermostatSetpointCCCapabilitiesReport = _classThis;
|
|
664
|
+
})();
|
|
564
665
|
export { ThermostatSetpointCCCapabilitiesReport };
|
|
565
|
-
let ThermostatSetpointCCCapabilitiesGet =
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
666
|
+
let ThermostatSetpointCCCapabilitiesGet = (() => {
|
|
667
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.CapabilitiesGet), expectedCCResponse(ThermostatSetpointCCCapabilitiesReport)];
|
|
668
|
+
let _classDescriptor;
|
|
669
|
+
let _classExtraInitializers = [];
|
|
670
|
+
let _classThis;
|
|
671
|
+
let _classSuper = ThermostatSetpointCC;
|
|
672
|
+
var ThermostatSetpointCCCapabilitiesGet = class extends _classSuper {
|
|
673
|
+
static { _classThis = this; }
|
|
674
|
+
static {
|
|
675
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
676
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
677
|
+
ThermostatSetpointCCCapabilitiesGet = _classThis = _classDescriptor.value;
|
|
678
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
679
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
680
|
+
}
|
|
681
|
+
constructor(options) {
|
|
682
|
+
super(options);
|
|
683
|
+
this.setpointType = options.setpointType;
|
|
684
|
+
}
|
|
685
|
+
static from(raw, ctx) {
|
|
686
|
+
validatePayload(raw.payload.length >= 1);
|
|
687
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
688
|
+
return new this({
|
|
689
|
+
nodeId: ctx.sourceNodeId,
|
|
690
|
+
setpointType,
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
setpointType;
|
|
694
|
+
serialize(ctx) {
|
|
695
|
+
this.payload = Bytes.from([this.setpointType & 0b1111]);
|
|
696
|
+
return super.serialize(ctx);
|
|
697
|
+
}
|
|
698
|
+
toLogEntry(ctx) {
|
|
699
|
+
return {
|
|
700
|
+
...super.toLogEntry(ctx),
|
|
701
|
+
message: {
|
|
702
|
+
"setpoint type": getEnumMemberName(ThermostatSetpointType, this.setpointType),
|
|
703
|
+
},
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
return ThermostatSetpointCCCapabilitiesGet = _classThis;
|
|
708
|
+
})();
|
|
596
709
|
export { ThermostatSetpointCCCapabilitiesGet };
|
|
597
|
-
let ThermostatSetpointCCSupportedReport =
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
710
|
+
let ThermostatSetpointCCSupportedReport = (() => {
|
|
711
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.SupportedReport), ccValueProperty("supportedSetpointTypes", ThermostatSetpointCCValues.supportedSetpointTypes)];
|
|
712
|
+
let _classDescriptor;
|
|
713
|
+
let _classExtraInitializers = [];
|
|
714
|
+
let _classThis;
|
|
715
|
+
let _classSuper = ThermostatSetpointCC;
|
|
716
|
+
var ThermostatSetpointCCSupportedReport = class extends _classSuper {
|
|
717
|
+
static { _classThis = this; }
|
|
718
|
+
static {
|
|
719
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
720
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
721
|
+
ThermostatSetpointCCSupportedReport = _classThis = _classDescriptor.value;
|
|
722
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
723
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
602
724
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
725
|
+
constructor(options) {
|
|
726
|
+
super(options);
|
|
727
|
+
if (options.supportedSetpointTypes.length === 0) {
|
|
728
|
+
throw new ZWaveError(`At least one setpoint type must be supported`, ZWaveErrorCodes.Argument_Invalid);
|
|
729
|
+
}
|
|
730
|
+
this.supportedSetpointTypes = options.supportedSetpointTypes;
|
|
731
|
+
}
|
|
732
|
+
static from(raw, ctx) {
|
|
733
|
+
validatePayload(raw.payload.length >= 1);
|
|
734
|
+
const bitMask = raw.payload;
|
|
735
|
+
const supported = parseBitMask(bitMask, ThermostatSetpointType["N/A"]);
|
|
736
|
+
// We use this command only when we are sure that bitmask interpretation A is used
|
|
737
|
+
// FIXME: Figure out if we can do this without the CC version
|
|
738
|
+
const supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
|
|
739
|
+
return new this({
|
|
740
|
+
nodeId: ctx.sourceNodeId,
|
|
741
|
+
supportedSetpointTypes,
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
supportedSetpointTypes;
|
|
745
|
+
serialize(ctx) {
|
|
746
|
+
this.payload = encodeBitMask(
|
|
747
|
+
// Encode as interpretation A
|
|
748
|
+
this.supportedSetpointTypes
|
|
749
|
+
.map((t) => thermostatSetpointTypeMap.indexOf(t))
|
|
750
|
+
.filter((t) => t !== -1), undefined, ThermostatSetpointType["N/A"]);
|
|
751
|
+
return super.serialize(ctx);
|
|
752
|
+
}
|
|
753
|
+
toLogEntry(ctx) {
|
|
754
|
+
return {
|
|
755
|
+
...super.toLogEntry(ctx),
|
|
756
|
+
message: {
|
|
757
|
+
"supported setpoint types": this.supportedSetpointTypes
|
|
758
|
+
.map((t) => `\n· ${getEnumMemberName(ThermostatSetpointType, t)}`)
|
|
759
|
+
.join(""),
|
|
760
|
+
},
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
return ThermostatSetpointCCSupportedReport = _classThis;
|
|
765
|
+
})();
|
|
643
766
|
export { ThermostatSetpointCCSupportedReport };
|
|
644
|
-
let ThermostatSetpointCCSupportedGet =
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
]
|
|
767
|
+
let ThermostatSetpointCCSupportedGet = (() => {
|
|
768
|
+
let _classDecorators = [CCCommand(ThermostatSetpointCommand.SupportedGet), expectedCCResponse(ThermostatSetpointCCSupportedReport)];
|
|
769
|
+
let _classDescriptor;
|
|
770
|
+
let _classExtraInitializers = [];
|
|
771
|
+
let _classThis;
|
|
772
|
+
let _classSuper = ThermostatSetpointCC;
|
|
773
|
+
var ThermostatSetpointCCSupportedGet = class extends _classSuper {
|
|
774
|
+
static { _classThis = this; }
|
|
775
|
+
static {
|
|
776
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
777
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
778
|
+
ThermostatSetpointCCSupportedGet = _classThis = _classDescriptor.value;
|
|
779
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
780
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
return ThermostatSetpointCCSupportedGet = _classThis;
|
|
784
|
+
})();
|
|
654
785
|
export { ThermostatSetpointCCSupportedGet };
|
|
655
786
|
//# sourceMappingURL=ThermostatSetpointCC.js.map
|