@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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cc/manufacturerProprietary/FibaroCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeUnknown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseMaybeNumber,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards/index.js\";\nimport {\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../../lib/API.js\";\nimport {\n\ttype CCRaw,\n\ttype CommandClassOptions,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport {\n\tManufacturerProprietaryCC,\n\tManufacturerProprietaryCCAPI,\n} from \"../ManufacturerProprietaryCC.js\";\nimport {\n\tfibaroCC,\n\tfibaroCCCommand,\n\tgetFibaroCCCommand,\n\tgetFibaroCCCommandConstructor,\n\tgetFibaroCCConstructor,\n\tgetFibaroCCId,\n\tmanufacturerId,\n\tmanufacturerProprietaryAPI,\n} from \"./Decorators.js\";\n\nexport const MANUFACTURERID_FIBARO = 0x10f;\n\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(\n\tendpoint: number,\n): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsPosition\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds position\",\n\t};\n}\n\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsTilt\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds tilt\",\n\t};\n}\n\nfunction getSupportedFibaroCCIDs(\n\tctx: GetDeviceConfig,\n\tnodeId: number,\n): FibaroCCIDs[] {\n\tconst proprietaryConfig = ctx.getDeviceConfig?.(\n\t\tnodeId,\n\t)?.proprietary;\n\tif (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n\t\treturn proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n\t}\n\n\treturn [];\n}\n\nexport enum FibaroCCIDs {\n\tVenetianBlind = 0x26,\n}\n\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async fibaroVenetianBlindsGet() {\n\t\tconst cc = new FibaroVenetianBlindCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tFibaroVenetianBlindCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"position\", \"tilt\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tposition: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttilt: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: FibaroCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\n\t\t\tif (propertyKey === \"venetianBlindsPosition\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetPosition(value);\n\t\t\t} else if (propertyKey === \"venetianBlindsTilt\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetTilt(value);\n\t\t\t} else {\n\t\t\t\t// unsupported property key, ignore...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Verify the current value after a delay\n\t\t\tthis.schedulePoll({ property, propertyKey }, value);\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: FibaroCCAPI, { property, propertyKey }) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t} else if (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t}\n\n\t\t\tswitch (propertyKey) {\n\t\t\t\tcase \"venetianBlindsPosition\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.position;\n\t\t\t\tcase \"venetianBlindsTilt\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.tilt;\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n}\n\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.fibaroCCId = getFibaroCCId(this);\n\t\tthis.fibaroCCCommand = getFibaroCCCommand(this);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst fibaroCCId = raw.payload[0];\n\t\tconst fibaroCCCommand = raw.payload[1];\n\n\t\tconst FibaroConstructor = getFibaroCCCommandConstructor(\n\t\t\tfibaroCCId,\n\t\t\tfibaroCCCommand,\n\t\t);\n\t\tif (FibaroConstructor) {\n\t\t\treturn FibaroConstructor.from(\n\t\t\t\traw.withPayload(raw.payload.subarray(2)),\n\t\t\t\tctx,\n\t\t\t);\n\t\t}\n\n\t\treturn new FibaroCC({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n\n\tpublic fibaroCCId?: number;\n\tpublic fibaroCCCommand?: number;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and interview them\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.interview(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and let them refresh their values\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.refreshValues(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tif (this.fibaroCCId == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC ID\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t} else if (this.fibaroCCCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC Command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.fibaroCCId, this.fibaroCCCommand]),\n\t\t\tthis.payload,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n}\n\nexport enum FibaroVenetianBlindCCCommand {\n\tSet = 0x01,\n\tGet = 0x02,\n\tReport = 0x03,\n}\n\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n\tdeclare fibaroCCId: FibaroCCIDs.VenetianBlind;\n\tdeclare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCId = FibaroCCIDs.VenetianBlind;\n\t}\n\n\tpublic async interview(ctx: InterviewContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing Fibaro Venetian Blind CC...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Nothing special, just get the values\n\t\tawait this.refreshValues(ctx);\n\t}\n\n\tpublic async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"Requesting venetian blind position and tilt...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(\n\t\t\tnew FibaroVenetianBlindCCGet({\n\t\t\t\tnodeId: this.nodeId,\n\t\t\t\tendpointIndex: this.endpointIndex,\n\t\t\t}),\n\t\t);\n\t\tif (resp) {\n\t\t\tconst logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions =\n\t| {\n\t\tposition: number;\n\t}\n\t| {\n\t\ttilt: number;\n\t}\n\t| {\n\t\tposition: number;\n\t\ttilt: number;\n\t};\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n\n\t\tif (\"position\" in options) this.position = options.position;\n\t\tif (\"tilt\" in options) this.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): FibaroVenetianBlindCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\t}\n\n\tpublic position: number | undefined;\n\tpublic tilt: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tconst controlByte = (this.position != undefined ? 0b10 : 0)\n\t\t\t| (this.tilt != undefined ? 0b01 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\tcontrolByte,\n\t\t\tthis.position ?? 0,\n\t\t\tthis.tilt ?? 0,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n\tposition?: MaybeUnknown<number>;\n\ttilt?: MaybeUnknown<number>;\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n\n\t\t// TODO: Check implementation:\n\t\tthis.position = options.position;\n\t\tthis.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\t// When the node sends a report, payload[0] === 0b11. This is probably a\n\t\t// bit mask for position and tilt\n\t\tlet position: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b10)) {\n\t\t\tposition = parseMaybeNumber(raw.payload[1]);\n\t\t}\n\n\t\tlet tilt: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b01)) {\n\t\t\ttilt = parseMaybeNumber(raw.payload[2]);\n\t\t}\n\n\t\treturn new FibaroVenetianBlindCCReport({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tposition,\n\t\t\ttilt,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tif (this.position != undefined) {\n\t\t\tconst positionValueId = getFibaroVenetianBlindPositionValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(positionValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds position\",\n\t\t\t});\n\t\t\tvalueDB.setValue(positionValueId, this.position);\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tconst tiltValueId = getFibaroVenetianBlindTiltValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(tiltValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds tilt\",\n\t\t\t});\n\t\t\tvalueDB.setValue(tiltValueId, this.tilt);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic position: MaybeUnknown<number> | undefined;\n\tpublic tilt: MaybeUnknown<number> | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCGet {\n\t\treturn new FibaroVenetianBlindCCGet({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAYO;AAOP,oBAA4B;AAE5B,wBAAwB;AACxB,iBASO;AAQP,oCAAmC;AACnC,uCAGO;AACP,wBASO
|
|
6
|
-
"names": ["FibaroCCIDs", "
|
|
4
|
+
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeUnknown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseMaybeNumber,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards/index.js\";\nimport {\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../../lib/API.js\";\nimport {\n\ttype CCRaw,\n\ttype CommandClassOptions,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport {\n\tManufacturerProprietaryCC,\n\tManufacturerProprietaryCCAPI,\n} from \"../ManufacturerProprietaryCC.js\";\nimport {\n\tfibaroCC,\n\tfibaroCCCommand,\n\tgetFibaroCCCommand,\n\tgetFibaroCCCommandConstructor,\n\tgetFibaroCCConstructor,\n\tgetFibaroCCId,\n\tmanufacturerId,\n\tmanufacturerProprietaryAPI,\n} from \"./Decorators.js\";\n\nexport const MANUFACTURERID_FIBARO = 0x10f;\n\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(\n\tendpoint: number,\n): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsPosition\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds position\",\n\t};\n}\n\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsTilt\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds tilt\",\n\t};\n}\n\nfunction getSupportedFibaroCCIDs(\n\tctx: GetDeviceConfig,\n\tnodeId: number,\n): FibaroCCIDs[] {\n\tconst proprietaryConfig = ctx.getDeviceConfig?.(\n\t\tnodeId,\n\t)?.proprietary;\n\tif (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n\t\treturn proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n\t}\n\n\treturn [];\n}\n\nexport enum FibaroCCIDs {\n\tVenetianBlind = 0x26,\n}\n\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async fibaroVenetianBlindsGet() {\n\t\tconst cc = new FibaroVenetianBlindCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tFibaroVenetianBlindCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"position\", \"tilt\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tposition: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttilt: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: FibaroCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\n\t\t\tif (propertyKey === \"venetianBlindsPosition\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetPosition(value);\n\t\t\t} else if (propertyKey === \"venetianBlindsTilt\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetTilt(value);\n\t\t\t} else {\n\t\t\t\t// unsupported property key, ignore...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Verify the current value after a delay\n\t\t\tthis.schedulePoll({ property, propertyKey }, value);\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: FibaroCCAPI, { property, propertyKey }) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t} else if (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t}\n\n\t\t\tswitch (propertyKey) {\n\t\t\t\tcase \"venetianBlindsPosition\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.position;\n\t\t\t\tcase \"venetianBlindsTilt\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.tilt;\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n}\n\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.fibaroCCId = getFibaroCCId(this);\n\t\tthis.fibaroCCCommand = getFibaroCCCommand(this);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst fibaroCCId = raw.payload[0];\n\t\tconst fibaroCCCommand = raw.payload[1];\n\n\t\tconst FibaroConstructor = getFibaroCCCommandConstructor(\n\t\t\tfibaroCCId,\n\t\t\tfibaroCCCommand,\n\t\t);\n\t\tif (FibaroConstructor) {\n\t\t\treturn FibaroConstructor.from(\n\t\t\t\traw.withPayload(raw.payload.subarray(2)),\n\t\t\t\tctx,\n\t\t\t);\n\t\t}\n\n\t\treturn new FibaroCC({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n\n\tpublic fibaroCCId?: number;\n\tpublic fibaroCCCommand?: number;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and interview them\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.interview(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and let them refresh their values\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.refreshValues(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tif (this.fibaroCCId == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC ID\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t} else if (this.fibaroCCCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC Command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.fibaroCCId, this.fibaroCCCommand]),\n\t\t\tthis.payload,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n}\n\nexport enum FibaroVenetianBlindCCCommand {\n\tSet = 0x01,\n\tGet = 0x02,\n\tReport = 0x03,\n}\n\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n\tdeclare fibaroCCId: FibaroCCIDs.VenetianBlind;\n\tdeclare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCId = FibaroCCIDs.VenetianBlind;\n\t}\n\n\tpublic async interview(ctx: InterviewContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing Fibaro Venetian Blind CC...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Nothing special, just get the values\n\t\tawait this.refreshValues(ctx);\n\t}\n\n\tpublic async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"Requesting venetian blind position and tilt...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(\n\t\t\tnew FibaroVenetianBlindCCGet({\n\t\t\t\tnodeId: this.nodeId,\n\t\t\t\tendpointIndex: this.endpointIndex,\n\t\t\t}),\n\t\t);\n\t\tif (resp) {\n\t\t\tconst logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions =\n\t| {\n\t\tposition: number;\n\t}\n\t| {\n\t\ttilt: number;\n\t}\n\t| {\n\t\tposition: number;\n\t\ttilt: number;\n\t};\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n\n\t\tif (\"position\" in options) this.position = options.position;\n\t\tif (\"tilt\" in options) this.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): FibaroVenetianBlindCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\t}\n\n\tpublic position: number | undefined;\n\tpublic tilt: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tconst controlByte = (this.position != undefined ? 0b10 : 0)\n\t\t\t| (this.tilt != undefined ? 0b01 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\tcontrolByte,\n\t\t\tthis.position ?? 0,\n\t\t\tthis.tilt ?? 0,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n\tposition?: MaybeUnknown<number>;\n\ttilt?: MaybeUnknown<number>;\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n\n\t\t// TODO: Check implementation:\n\t\tthis.position = options.position;\n\t\tthis.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\t// When the node sends a report, payload[0] === 0b11. This is probably a\n\t\t// bit mask for position and tilt\n\t\tlet position: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b10)) {\n\t\t\tposition = parseMaybeNumber(raw.payload[1]);\n\t\t}\n\n\t\tlet tilt: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b01)) {\n\t\t\ttilt = parseMaybeNumber(raw.payload[2]);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tposition,\n\t\t\ttilt,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tif (this.position != undefined) {\n\t\t\tconst positionValueId = getFibaroVenetianBlindPositionValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(positionValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds position\",\n\t\t\t});\n\t\t\tvalueDB.setValue(positionValueId, this.position);\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tconst tiltValueId = getFibaroVenetianBlindTiltValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(tiltValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds tilt\",\n\t\t\t});\n\t\t\tvalueDB.setValue(tiltValueId, this.tilt);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic position: MaybeUnknown<number> | undefined;\n\tpublic tilt: MaybeUnknown<number> | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCGet {\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAYO;AAOP,oBAA4B;AAE5B,wBAAwB;AACxB,iBASO;AAQP,oCAAmC;AACnC,uCAGO;AACP,wBASO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,wBAAwB;AAG/B,SAAU,sCACf,UAAgB;AAEhB,SAAO;IACN,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAEf;AAGM,SAAU,yCAAsC;AACrD,SAAO;IACN,GAAG,0BAAc;IACjB,OAAO;;AAET;AAGM,SAAU,kCAAkC,UAAgB;AACjE,SAAO;IACN,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAEf;AAGM,SAAU,qCAAkC;AACjD,SAAO;IACN,GAAG,0BAAc;IACjB,OAAO;;AAET;AAEA,SAAS,wBACR,KACA,QAAc;AAEd,QAAM,oBAAoB,IAAI,kBAC7B,MAAM,GACJ;AACH,MAAI,yBAAqB,2BAAQ,kBAAkB,SAAS,GAAG;AAC9D,WAAO,kBAAkB;EAC1B;AAEA,SAAO,CAAA;AACR;AAEA,IAAY;CAAZ,SAAYA,cAAW;AACtB,EAAAA,aAAAA,aAAA,eAAA,IAAA,EAAA,IAAA;AACD,GAFY,gBAAA,cAAW,CAAA,EAAA;IAKV,eAAW,MAAA;8BADvB,8CAA2B,qBAAqB,CAAC;;;;oBACjB;mCAAA,YAA4B;;;;;;AAA7D,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,k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Y,QAAW;AAC/B,cAAM,kBAAkB,sCACvB,KAAK,aAAa;AAEnB,gBAAQ,YAAY,iBAAiB;UACpC,GAAG,0BAAc;UACjB,OAAO;SACP;AACD,gBAAQ,SAAS,iBAAiB,KAAK,QAAQ;MAChD;AACA,UAAI,KAAK,QAAQ,QAAW;AAC3B,cAAM,cAAc,kCACnB,KAAK,aAAa;AAEnB,gBAAQ,YAAY,aAAa;UAChC,GAAG,0BAAc;UACjB,OAAO;SACP;AACD,gBAAQ,SAAS,aAAa,KAAK,IAAI;MACxC;AAEA,aAAO;IACR;IAEO;IACA;IAEA,WAAW,KAAgB;AACjC,YAAM,UAAyB,CAAA;AAC/B,UAAI,KAAK,YAAY,QAAW;AAC/B,gBAAQ,WAAW,KAAK;MACzB;AACA,UAAI,KAAK,QAAQ,QAAW;AAC3B,gBAAQ,OAAO,KAAK;MACrB;AACA,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB;;IAEF;;;;IAKY,4BAAwB,MAAA;8BAFpC,mCAAgB,6BAA6B,GAAG,OAChD,kDAAmB,2BAA2B,CAAC;;;;oBACF;gDAAA,YAAqB;;;;;;AAAnE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4B;AAE5B,YAAM,OAAO;AACb,WAAK,kBAAkB,6BAA6B;IACrD;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;OACZ;IACF;;;;",
|
|
6
|
+
"names": ["FibaroCCIDs", "fibaroCCCommand", "FibaroCC", "FibaroVenetianBlindCCCommand"]
|
|
7
7
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type CommandClasses } from "@zwave-js/core";
|
|
2
|
-
import type { TypedClassDecorator
|
|
2
|
+
import type { TypedClassDecorator } from "@zwave-js/shared";
|
|
3
3
|
import type { APIConstructor, CCAPI } from "./API.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type CCConstructor, type CCResponsePredicate, type CommandClass, type DynamicCCResponse } from "./CommandClass.js";
|
|
5
5
|
import type { DynamicCCValue, StaticCCValue, StaticCCValueFactory } from "./Values.js";
|
|
6
6
|
/**
|
|
7
7
|
* @publicAPI
|
|
8
8
|
* Defines the CC ID associated with a Z-Wave Command Class
|
|
9
9
|
*/
|
|
10
|
-
export declare const commandClass: <TTarget extends CommandClass>(ccId: CommandClasses) => TypedClassDecorator<TTarget>;
|
|
10
|
+
export declare const commandClass: <TTarget extends typeof CommandClass>(ccId: CommandClasses) => TypedClassDecorator<TTarget>;
|
|
11
11
|
/**
|
|
12
12
|
* @publicAPI
|
|
13
13
|
* Looks up the command class constructor for a given CC ID
|
|
@@ -17,7 +17,7 @@ export declare const getCCConstructor: (ccId: CommandClasses) => CCConstructor<C
|
|
|
17
17
|
* @publicAPI
|
|
18
18
|
* Defines the CC command a subclass of a CC implements
|
|
19
19
|
*/
|
|
20
|
-
export declare const CCCommand: <TTarget extends CommandClass>(ccCommand: number) => TypedClassDecorator<TTarget>;
|
|
20
|
+
export declare const CCCommand: <TTarget extends typeof CommandClass>(ccCommand: number) => TypedClassDecorator<TTarget>;
|
|
21
21
|
/**
|
|
22
22
|
* @publicAPI
|
|
23
23
|
* Retrieves the CC command a subclass of a CC implements
|
|
@@ -37,7 +37,7 @@ export declare function getCommandClassStatic<T extends CCConstructor<CommandCla
|
|
|
37
37
|
* @publicAPI
|
|
38
38
|
* Defines the CC ID a CC API implementation belongs to
|
|
39
39
|
*/
|
|
40
|
-
export declare const API: <TTarget extends CCAPI>(cc: CommandClasses) => TypedClassDecorator<TTarget>;
|
|
40
|
+
export declare const API: <TTarget extends typeof CCAPI>(cc: CommandClasses) => TypedClassDecorator<TTarget>;
|
|
41
41
|
/**
|
|
42
42
|
* @publicAPI
|
|
43
43
|
* Retrieves the CC API constructor that is defined for a Z-Wave CC ID
|
|
@@ -52,7 +52,7 @@ export declare function getCommandClass(cc: CommandClass | CCAPI): CommandClasse
|
|
|
52
52
|
* @publicAPI
|
|
53
53
|
* Defines the implemented version of a Z-Wave command class
|
|
54
54
|
*/
|
|
55
|
-
export declare const implementedVersion: <TTarget extends CommandClass>(version: number) => TypedClassDecorator<TTarget>;
|
|
55
|
+
export declare const implementedVersion: <TTarget extends typeof CommandClass>(version: number) => TypedClassDecorator<TTarget>;
|
|
56
56
|
/**
|
|
57
57
|
* @publicAPI
|
|
58
58
|
* Retrieves the implemented version defined for a Z-Wave command class
|
|
@@ -67,7 +67,7 @@ export declare function getImplementedVersionStatic<T extends CCConstructor<Comm
|
|
|
67
67
|
* @publicAPI
|
|
68
68
|
* Defines the expected response associated with a Z-Wave message
|
|
69
69
|
*/
|
|
70
|
-
export declare function expectedCCResponse<TSent extends CommandClass, TReceived extends CommandClass>(cc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>, predicate?: CCResponsePredicate<TSent, TReceived>): TypedClassDecorator<
|
|
70
|
+
export declare function expectedCCResponse<TTarget extends typeof CommandClass, TSent extends CommandClass, TReceived extends CommandClass>(cc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>, predicate?: CCResponsePredicate<TSent, TReceived>): TypedClassDecorator<TTarget>;
|
|
71
71
|
/**
|
|
72
72
|
* @publicAPI
|
|
73
73
|
* Retrieves the expected response (static or dynamic) defined for a Z-Wave message class
|
|
@@ -82,18 +82,14 @@ export declare function getCCResponsePredicate<T extends CommandClass>(ccClass:
|
|
|
82
82
|
* @publicAPI
|
|
83
83
|
* Defines which CC value definitions belong to a Z-Wave command class
|
|
84
84
|
*/
|
|
85
|
-
export declare const ccValues: <TTarget extends CommandClass>(valueDefinition: Record<string, StaticCCValue | DynamicCCValue>) => TypedClassDecorator<TTarget>;
|
|
85
|
+
export declare const ccValues: <TTarget extends typeof CommandClass>(valueDefinition: Record<string, StaticCCValue | DynamicCCValue>) => TypedClassDecorator<TTarget>;
|
|
86
86
|
/**
|
|
87
87
|
* @publicAPI
|
|
88
88
|
* Retrieves the CC value definitions which belong to a Z-Wave command class
|
|
89
89
|
*/
|
|
90
90
|
export declare function getCCValues<T extends CommandClass>(cc: T | CommandClasses): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* Defines which CC value a Z-Wave command class property belongs to
|
|
94
|
-
*/
|
|
95
|
-
export declare function ccValue<TTarget extends CommandClass>(value: StaticCCValue): TypedPropertyDecorator<TTarget>;
|
|
96
|
-
export declare function ccValue<TTarget extends CommandClass, TArgs extends any[]>(value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => Readonly<TArgs>): TypedPropertyDecorator<TTarget>;
|
|
91
|
+
export declare function ccValueProperty<Class extends abstract new (...args: any) => any>(property: keyof InstanceType<Class>, value: StaticCCValue): TypedClassDecorator<Class>;
|
|
92
|
+
export declare function ccValueProperty<Class extends abstract new (...args: any) => any, const TArgs extends any[]>(property: keyof InstanceType<Class>, value: DynamicCCValue<TArgs>, getArgs: (self: InstanceType<Class>) => TArgs): TypedClassDecorator<Class>;
|
|
97
93
|
/**
|
|
98
94
|
* @publicAPI
|
|
99
95
|
* Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance
|
|
@@ -103,7 +99,7 @@ export declare function getCCValueProperties<TTarget extends CommandClass>(targe
|
|
|
103
99
|
* @publicAPI
|
|
104
100
|
* Defines that this CC may be sent supervised
|
|
105
101
|
*/
|
|
106
|
-
export declare const useSupervision: <TTarget extends CommandClass>() => TypedClassDecorator<TTarget>;
|
|
102
|
+
export declare const useSupervision: <TTarget extends typeof CommandClass>() => TypedClassDecorator<TTarget>;
|
|
107
103
|
/**
|
|
108
104
|
* @publicAPI
|
|
109
105
|
* Checks if the given CC may be sent supervised
|
|
@@ -20,7 +20,7 @@ var CommandClassDecorators_exports = {};
|
|
|
20
20
|
__export(CommandClassDecorators_exports, {
|
|
21
21
|
API: () => API,
|
|
22
22
|
CCCommand: () => CCCommand,
|
|
23
|
-
|
|
23
|
+
ccValueProperty: () => ccValueProperty,
|
|
24
24
|
ccValues: () => ccValues,
|
|
25
25
|
commandClass: () => commandClass,
|
|
26
26
|
expectedCCResponse: () => expectedCCResponse,
|
|
@@ -124,25 +124,24 @@ function getCCValues(cc) {
|
|
|
124
124
|
return ccValuesDecorator.lookupValueStatic(constr);
|
|
125
125
|
}
|
|
126
126
|
const ccValue_METADATA = Symbol.for(`METADATA_ccValue`);
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
if (args.length === 1) {
|
|
130
|
-
valueOrFactory = args[0];
|
|
131
|
-
} else {
|
|
132
|
-
const [value, getArgs] = args;
|
|
133
|
-
valueOrFactory = (self) => {
|
|
134
|
-
const args2 = getArgs(self);
|
|
135
|
-
const base = value(...args2);
|
|
136
|
-
return {
|
|
137
|
-
...base,
|
|
138
|
-
is: value.is,
|
|
139
|
-
options: value.options
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
return function decoratorBody_ccValue(target, property) {
|
|
144
|
-
const constr = target.constructor;
|
|
127
|
+
function ccValueProperty(property, ...args) {
|
|
128
|
+
return function decorator_ccValueProperty(constr) {
|
|
145
129
|
const metadata = Reflect.getMetadata(ccValue_METADATA, constr) ?? /* @__PURE__ */ new Map();
|
|
130
|
+
let valueOrFactory;
|
|
131
|
+
if (args.length === 1) {
|
|
132
|
+
valueOrFactory = args[0];
|
|
133
|
+
} else {
|
|
134
|
+
const [value, getArgs] = args;
|
|
135
|
+
valueOrFactory = (self) => {
|
|
136
|
+
const args2 = getArgs(self);
|
|
137
|
+
const base = value(...args2);
|
|
138
|
+
return {
|
|
139
|
+
...base,
|
|
140
|
+
is: value.is,
|
|
141
|
+
options: value.options
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
146
145
|
metadata.set(property, valueOrFactory);
|
|
147
146
|
Reflect.defineMetadata(ccValue_METADATA, metadata, constr);
|
|
148
147
|
};
|
|
@@ -159,7 +158,7 @@ const shouldUseSupervision = supervisionDecorator.isDecorated;
|
|
|
159
158
|
0 && (module.exports = {
|
|
160
159
|
API,
|
|
161
160
|
CCCommand,
|
|
162
|
-
|
|
161
|
+
ccValueProperty,
|
|
163
162
|
ccValues,
|
|
164
163
|
commandClass,
|
|
165
164
|
expectedCCResponse,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/CommandClassDecorators.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core\";\nimport type {\n\tTypedClassDecorator,\n\tTypedPropertyDecorator,\n} from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport type {\n\tCCConstructor,\n\tCCResponsePredicate,\n\tCommandClass,\n\tDynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\tCommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\tCCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(constr)\n\t\t?? apiDecorator.lookupValueStatic(constr);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\tCommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\tCommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<CommandClass> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\tCommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n/**\n * @publicAPI\n * Defines which CC value a Z-Wave command class property belongs to\n */\nexport function ccValue<TTarget extends CommandClass>(\n\tvalue: StaticCCValue,\n): TypedPropertyDecorator<TTarget>;\n\nexport function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: TTarget) => Readonly<TArgs>,\n): TypedPropertyDecorator<TTarget>;\n\n// Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// target type in the getArgs function then.\nexport function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n): TypedPropertyDecorator<TTarget> {\n\t// Normalize the arguments to the expected format\n\tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n\tif (args.length === 1) {\n\t\tvalueOrFactory = args[0];\n\t} else {\n\t\tconst [value, getArgs] = args;\n\t\tvalueOrFactory = (self: TTarget) => {\n\t\t\tconst args = getArgs(self);\n\t\t\tconst base = value(...args);\n\t\t\treturn {\n\t\t\t\t...base,\n\t\t\t\tis: value.is,\n\t\t\t\toptions: value.options,\n\t\t\t};\n\t\t};\n\t}\n\n\treturn function decoratorBody_ccValue(\n\t\ttarget: TTarget,\n\t\tproperty: string | number | symbol,\n\t): void {\n\t\t// get the class constructor\n\t\tconst constr = target.constructor;\n\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Add the variable\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<CommandClass>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAOO;
|
|
4
|
+
"sourcesContent": ["import {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core\";\nimport type { TypedClassDecorator } from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport {\n\ttype CCConstructor,\n\ttype CCResponsePredicate,\n\ttype CommandClass,\n\ttype DynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\ttypeof CommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\ttypeof CCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(\n\t\tconstr as typeof CommandClass,\n\t)\n\t\t?? apiDecorator.lookupValueStatic(constr as typeof CCAPI);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTTarget extends typeof CommandClass,\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<TTarget> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export function ccValue<TTarget extends CommandClass>(\n// \tvalue: StaticCCValue,\n// ): TypedPropertyDecorator<TTarget>;\n\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \tvalue: DynamicCCValue<TArgs>,\n// \tgetArgs: (self: TTarget) => Readonly<TArgs>,\n// ): TypedPropertyDecorator<TTarget>;\n\n// // Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// // target type in the getArgs function then.\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \t...args:\n// \t\t| [value: StaticCCValue]\n// \t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n// ): TypedPropertyDecorator<TTarget> {\n// \t// Normalize the arguments to the expected format\n// \tdebugger;\n// \tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n// \tif (args.length === 1) {\n// \t\tvalueOrFactory = args[0];\n// \t} else {\n// \t\tconst [value, getArgs] = args;\n// \t\tvalueOrFactory = (self: TTarget) => {\n// \t\t\tconst args = getArgs(self);\n// \t\t\tconst base = value(...args);\n// \t\t\treturn {\n// \t\t\t\t...base,\n// \t\t\t\tis: value.is,\n// \t\t\t\toptions: value.options,\n// \t\t\t};\n// \t\t};\n// \t}\n\n// \treturn function decoratorBody_ccValue(\n// \t\ttarget: TTarget,\n// \t\tproperty: string | number | symbol,\n// \t): void {\n// \t\t// get the class constructor\n// \t\tconst constr = target.constructor;\n\n// \t\t// retrieve the current metadata\n// \t\tconst metadata: Map<\n// \t\t\tstring | number,\n// \t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n// \t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n// \t\t// Add the variable\n// \t\tmetadata.set(property as string | number, valueOrFactory);\n\n// \t\t// And store it back\n// \t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n// \t};\n// }\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: StaticCCValue,\n): TypedClassDecorator<Class>;\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: InstanceType<Class>) => TArgs,\n): TypedClassDecorator<Class>;\n\n/**\n * @publicAPI\n * Defines which CC values the properties of a Z-Wave Command Class correspond to\n */\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [\n\t\t\tvalue: DynamicCCValue<TArgs>,\n\t\t\tgetArgs: (self: InstanceType<Class>) => TArgs,\n\t\t]\n): TypedClassDecorator<Class> {\n\treturn function decorator_ccValueProperty(constr: Class): void {\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<InstanceType<Class>>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Determine the correct metadata\n\t\tlet valueOrFactory:\n\t\t\t| StaticCCValue\n\t\t\t| StaticCCValueFactory<InstanceType<Class>>;\n\t\tif (args.length === 1) {\n\t\t\tvalueOrFactory = args[0];\n\t\t} else {\n\t\t\tconst [value, getArgs] = args;\n\t\t\tvalueOrFactory = (self: InstanceType<Class>) => {\n\t\t\t\tconst args = getArgs(self);\n\t\t\t\tconst base = value(...args);\n\t\t\t\treturn {\n\t\t\t\t\t...base,\n\t\t\t\t\tis: value.is,\n\t\t\t\t\toptions: value.options,\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\t// Add the metadata\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<\n\ttypeof CommandClass\n>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAOO;AAeP,MAAM,4BAAwB,2CAK5B,EAAE,WAAW,QAAQ,SAAS,YAAW,CAAE;AAMtC,MAAM,eAAe,sBAAsB;AAM3C,MAAM,mBAAmB,sBAAsB;AAM/C,MAAM,YAAY,sBAAsB;AAMxC,MAAM,eAAe,sB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{
|
|
|
6
6
|
MOS = 4
|
|
7
7
|
}
|
|
8
8
|
/** Defines which S2 extension type a subclass of S2Extension has */
|
|
9
|
-
export declare const extensionType: <TTarget extends Security2Extension>(type: S2ExtensionType) => import("@zwave-js/shared/safe").TypedClassDecorator<TTarget>;
|
|
9
|
+
export declare const extensionType: <TTarget extends typeof Security2Extension>(type: S2ExtensionType) => import("@zwave-js/shared/safe").TypedClassDecorator<TTarget>;
|
|
10
10
|
/** Returns which S2 extension type a subclass of S2Extension has */
|
|
11
11
|
export declare const getExtensionType: (target: Security2Extension) => S2ExtensionType | undefined;
|
|
12
12
|
/**
|