@zwave-js/cc 14.0.0-beta.1 → 14.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.d.ts +194 -0
- package/build/cjs/cc/AlarmSensorCC.js +395 -0
- package/build/cjs/cc/AlarmSensorCC.js.map +7 -0
- package/build/cjs/cc/AssociationCC.d.ts +253 -0
- package/build/cjs/cc/AssociationCC.js +711 -0
- package/build/cjs/cc/AssociationCC.js.map +7 -0
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js +746 -0
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +7 -0
- package/build/cjs/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/cjs/cc/BarrierOperatorCC.js +582 -0
- package/build/cjs/cc/BarrierOperatorCC.js.map +7 -0
- package/build/cjs/cc/BasicCC.d.ts +191 -0
- package/build/cjs/cc/BasicCC.js +384 -0
- package/build/cjs/cc/BasicCC.js.map +7 -0
- package/build/cjs/cc/BatteryCC.d.ts +406 -0
- package/build/cjs/cc/BatteryCC.js +508 -0
- package/build/cjs/cc/BatteryCC.js.map +7 -0
- package/build/cjs/cc/BinarySensorCC.d.ts +122 -0
- package/build/cjs/cc/BinarySensorCC.js +431 -0
- package/build/cjs/cc/BinarySensorCC.js.map +7 -0
- package/build/cjs/cc/BinarySwitchCC.d.ts +139 -0
- package/build/cjs/cc/BinarySwitchCC.js +378 -0
- package/build/cjs/cc/BinarySwitchCC.js.map +7 -0
- package/build/cjs/cc/CRC16CC.d.ts +29 -0
- package/build/cjs/cc/CRC16CC.js +133 -0
- package/build/cjs/cc/CRC16CC.js.map +7 -0
- package/build/cjs/cc/CentralSceneCC.d.ts +210 -0
- package/build/cjs/cc/CentralSceneCC.js +449 -0
- package/build/cjs/cc/CentralSceneCC.js.map +7 -0
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js +480 -0
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +7 -0
- package/build/cjs/cc/ClockCC.d.ts +47 -0
- package/build/cjs/cc/ClockCC.js +226 -0
- package/build/cjs/cc/ClockCC.js.map +7 -0
- package/build/cjs/cc/ColorSwitchCC.d.ts +339 -0
- package/build/cjs/cc/ColorSwitchCC.js +1117 -0
- package/build/cjs/cc/ColorSwitchCC.js.map +7 -0
- package/build/cjs/cc/ConfigurationCC.d.ts +396 -0
- package/build/cjs/cc/ConfigurationCC.js +2230 -0
- package/build/cjs/cc/ConfigurationCC.js.map +7 -0
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js +92 -0
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +7 -0
- package/build/cjs/cc/DoorLockCC.d.ts +837 -0
- package/build/cjs/cc/DoorLockCC.js +1239 -0
- package/build/cjs/cc/DoorLockCC.js.map +7 -0
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/cjs/cc/DoorLockLoggingCC.js +343 -0
- package/build/cjs/cc/DoorLockLoggingCC.js.map +7 -0
- package/build/cjs/cc/EnergyProductionCC.d.ts +77 -0
- package/build/cjs/cc/EnergyProductionCC.js +240 -0
- package/build/cjs/cc/EnergyProductionCC.js.map +7 -0
- package/build/cjs/cc/EntryControlCC.d.ts +231 -0
- package/build/cjs/cc/EntryControlCC.js +593 -0
- package/build/cjs/cc/EntryControlCC.js.map +7 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +1122 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +7 -0
- package/build/cjs/cc/HailCC.d.ts +6 -0
- package/build/cjs/cc/HailCC.js +45 -0
- package/build/cjs/cc/HailCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/cjs/cc/HumidityControlModeCC.js +323 -0
- package/build/cjs/cc/HumidityControlModeCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +164 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js +634 -0
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +7 -0
- package/build/cjs/cc/InclusionControllerCC.d.ts +42 -0
- package/build/cjs/cc/InclusionControllerCC.js +160 -0
- package/build/cjs/cc/InclusionControllerCC.js.map +7 -0
- package/build/cjs/cc/IndicatorCC.d.ts +338 -0
- package/build/cjs/cc/IndicatorCC.js +1234 -0
- package/build/cjs/cc/IndicatorCC.js.map +7 -0
- package/build/cjs/cc/IrrigationCC.d.ts +1496 -0
- package/build/cjs/cc/IrrigationCC.js +1978 -0
- package/build/cjs/cc/IrrigationCC.js.map +7 -0
- package/build/cjs/cc/LanguageCC.d.ts +101 -0
- package/build/cjs/cc/LanguageCC.js +267 -0
- package/build/cjs/cc/LanguageCC.js.map +7 -0
- package/build/cjs/cc/LockCC.d.ts +73 -0
- package/build/cjs/cc/LockCC.js +222 -0
- package/build/cjs/cc/LockCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js +209 -0
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +7 -0
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js +334 -0
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +7 -0
- package/build/cjs/cc/MeterCC.d.ts +318 -0
- package/build/cjs/cc/MeterCC.js +1235 -0
- package/build/cjs/cc/MeterCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js +956 -0
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +7 -0
- package/build/cjs/cc/MultiChannelCC.d.ts +394 -0
- package/build/cjs/cc/MultiChannelCC.js +1050 -0
- package/build/cjs/cc/MultiChannelCC.js.map +7 -0
- package/build/cjs/cc/MultiCommandCC.d.ts +27 -0
- package/build/cjs/cc/MultiCommandCC.js +159 -0
- package/build/cjs/cc/MultiCommandCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/cjs/cc/MultilevelSensorCC.js +716 -0
- package/build/cjs/cc/MultilevelSensorCC.js.map +7 -0
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/cjs/cc/MultilevelSwitchCC.js +780 -0
- package/build/cjs/cc/MultilevelSwitchCC.js.map +7 -0
- package/build/cjs/cc/NoOperationCC.d.ts +9 -0
- package/build/cjs/cc/NoOperationCC.js +64 -0
- package/build/cjs/cc/NoOperationCC.js.map +7 -0
- package/build/cjs/cc/NodeNamingCC.d.ts +118 -0
- package/build/cjs/cc/NodeNamingCC.js +364 -0
- package/build/cjs/cc/NodeNamingCC.js.map +7 -0
- package/build/cjs/cc/NotificationCC.d.ts +479 -0
- package/build/cjs/cc/NotificationCC.js +1245 -0
- package/build/cjs/cc/NotificationCC.js.map +7 -0
- package/build/cjs/cc/PowerlevelCC.d.ts +82 -0
- package/build/cjs/cc/PowerlevelCC.js +510 -0
- package/build/cjs/cc/PowerlevelCC.js.map +7 -0
- package/build/cjs/cc/ProtectionCC.d.ts +325 -0
- package/build/cjs/cc/ProtectionCC.js +667 -0
- package/build/cjs/cc/ProtectionCC.js.map +7 -0
- package/build/cjs/cc/SceneActivationCC.d.ts +89 -0
- package/build/cjs/cc/SceneActivationCC.js +193 -0
- package/build/cjs/cc/SceneActivationCC.js.map +7 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +370 -0
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +7 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js +423 -0
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +7 -0
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js +1763 -0
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +7 -0
- package/build/cjs/cc/Security2CC.d.ts +251 -0
- package/build/cjs/cc/Security2CC.js +1589 -0
- package/build/cjs/cc/Security2CC.js.map +7 -0
- package/build/cjs/cc/SecurityCC.d.ts +128 -0
- package/build/cjs/cc/SecurityCC.js +757 -0
- package/build/cjs/cc/SecurityCC.js.map +7 -0
- package/build/cjs/cc/SoundSwitchCC.d.ts +232 -0
- package/build/cjs/cc/SoundSwitchCC.js +661 -0
- package/build/cjs/cc/SoundSwitchCC.js.map +7 -0
- package/build/cjs/cc/SupervisionCC.d.ts +104 -0
- package/build/cjs/cc/SupervisionCC.js +308 -0
- package/build/cjs/cc/SupervisionCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/cjs/cc/ThermostatFanModeCC.js +372 -0
- package/build/cjs/cc/ThermostatFanModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/cjs/cc/ThermostatFanStateCC.js +166 -0
- package/build/cjs/cc/ThermostatFanStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatModeCC.d.ts +150 -0
- package/build/cjs/cc/ThermostatModeCC.js +436 -0
- package/build/cjs/cc/ThermostatModeCC.js.map +7 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js +162 -0
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/cjs/cc/ThermostatSetbackCC.js +262 -0
- package/build/cjs/cc/ThermostatSetbackCC.js.map +7 -0
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/cjs/cc/ThermostatSetpointCC.js +638 -0
- package/build/cjs/cc/ThermostatSetpointCC.js.map +7 -0
- package/build/cjs/cc/TimeCC.d.ts +88 -0
- package/build/cjs/cc/TimeCC.js +473 -0
- package/build/cjs/cc/TimeCC.js.map +7 -0
- package/build/cjs/cc/TimeParametersCC.d.ts +72 -0
- package/build/cjs/cc/TimeParametersCC.js +313 -0
- package/build/cjs/cc/TimeParametersCC.js.map +7 -0
- package/build/cjs/cc/TransportServiceCC.d.ts +107 -0
- package/build/cjs/cc/TransportServiceCC.js +404 -0
- package/build/cjs/cc/TransportServiceCC.js.map +7 -0
- package/build/cjs/cc/UserCodeCC.d.ts +683 -0
- package/build/cjs/cc/UserCodeCC.js +1620 -0
- package/build/cjs/cc/UserCodeCC.js.map +7 -0
- package/build/cjs/cc/VersionCC.d.ts +469 -0
- package/build/cjs/cc/VersionCC.js +828 -0
- package/build/cjs/cc/VersionCC.js.map +7 -0
- package/build/cjs/cc/WakeUpCC.d.ts +150 -0
- package/build/cjs/cc/WakeUpCC.js +456 -0
- package/build/cjs/cc/WakeUpCC.js.map +7 -0
- package/build/cjs/cc/WindowCoveringCC.d.ts +315 -0
- package/build/cjs/cc/WindowCoveringCC.js +776 -0
- package/build/cjs/cc/WindowCoveringCC.js.map +7 -0
- package/build/cjs/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js +43 -0
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +7 -0
- package/build/cjs/cc/ZWavePlusCC.d.ts +163 -0
- package/build/cjs/cc/ZWavePlusCC.js +288 -0
- package/build/cjs/cc/ZWavePlusCC.js.map +7 -0
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/cjs/cc/ZWaveProtocolCC.js +1071 -0
- package/build/cjs/cc/ZWaveProtocolCC.js.map +7 -0
- package/build/cjs/cc/index.d.ts +132 -0
- package/build/cjs/cc/index.js +1180 -0
- package/build/cjs/cc/index.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js +76 -0
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +412 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +7 -0
- package/build/cjs/index.d.ts +15 -0
- package/build/cjs/index.js +77 -0
- package/build/cjs/index.js.map +7 -0
- package/build/cjs/index_safe.d.ts +3 -0
- package/build/cjs/index_safe.js +25 -0
- package/build/cjs/index_safe.js.map +7 -0
- package/build/cjs/lib/API.d.ts +271 -0
- package/build/cjs/lib/API.js +413 -0
- package/build/cjs/lib/API.js.map +7 -0
- package/build/cjs/lib/CommandClass.d.ts +234 -0
- package/build/cjs/lib/CommandClass.js +692 -0
- package/build/cjs/lib/CommandClass.js.map +7 -0
- package/build/cjs/lib/CommandClassDecorators.d.ts +112 -0
- package/build/cjs/lib/CommandClassDecorators.js +182 -0
- package/build/cjs/lib/CommandClassDecorators.js.map +7 -0
- package/build/cjs/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js +71 -0
- package/build/cjs/lib/EncapsulatingCommandClass.js.map +7 -0
- package/build/cjs/lib/ICommandClassContainer.js +17 -0
- package/build/cjs/lib/ICommandClassContainer.js.map +7 -0
- package/build/cjs/lib/NotificationEventPayload.d.ts +10 -0
- package/build/cjs/lib/NotificationEventPayload.js +31 -0
- package/build/cjs/lib/NotificationEventPayload.js.map +7 -0
- package/build/cjs/lib/Security2/Extension.js +333 -0
- package/build/cjs/lib/Security2/Extension.js.map +7 -0
- package/build/cjs/lib/Security2/shared.js +69 -0
- package/build/cjs/lib/Security2/shared.js.map +7 -0
- package/build/cjs/lib/SetValueResult.js +65 -0
- package/build/cjs/lib/SetValueResult.js.map +7 -0
- package/build/cjs/lib/Values.d.ts +223 -0
- package/build/cjs/lib/Values.js +191 -0
- package/build/cjs/lib/Values.js.map +7 -0
- package/build/cjs/lib/_Types.js +1676 -0
- package/build/cjs/lib/_Types.js.map +7 -0
- package/build/cjs/lib/serializers.d.ts +34 -0
- package/build/cjs/lib/serializers.js +110 -0
- package/build/cjs/lib/serializers.js.map +7 -0
- package/build/cjs/lib/utils.d.ts +17 -0
- package/build/cjs/lib/utils.js +678 -0
- package/build/cjs/lib/utils.js.map +7 -0
- package/build/cjs/package.json +3 -0
- package/build/esm/cc/AlarmSensorCC.d.ts +194 -0
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -0
- package/build/esm/cc/AlarmSensorCC.js +392 -0
- package/build/esm/cc/AlarmSensorCC.js.map +1 -0
- package/build/esm/cc/AssociationCC.d.ts +253 -0
- package/build/esm/cc/AssociationCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationCC.js +706 -0
- package/build/esm/cc/AssociationCC.js.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +230 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.js +769 -0
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts +243 -0
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -0
- package/build/esm/cc/BarrierOperatorCC.js +610 -0
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -0
- package/build/esm/cc/BasicCC.d.ts +191 -0
- package/build/esm/cc/BasicCC.d.ts.map +1 -0
- package/build/esm/cc/BasicCC.js +390 -0
- package/build/esm/cc/BasicCC.js.map +1 -0
- package/build/esm/cc/BatteryCC.d.ts +406 -0
- package/build/esm/cc/BatteryCC.d.ts.map +1 -0
- package/build/esm/cc/BatteryCC.js +513 -0
- package/build/esm/cc/BatteryCC.js.map +1 -0
- package/build/esm/cc/BinarySensorCC.d.ts +122 -0
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySensorCC.js +417 -0
- package/build/esm/cc/BinarySensorCC.js.map +1 -0
- package/build/esm/cc/BinarySwitchCC.d.ts +139 -0
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -0
- package/build/esm/cc/BinarySwitchCC.js +362 -0
- package/build/esm/cc/BinarySwitchCC.js.map +1 -0
- package/build/esm/cc/CRC16CC.d.ts +29 -0
- package/build/esm/cc/CRC16CC.d.ts.map +1 -0
- package/build/esm/cc/CRC16CC.js +123 -0
- package/build/esm/cc/CRC16CC.js.map +1 -0
- package/build/esm/cc/CentralSceneCC.d.ts +210 -0
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -0
- package/build/esm/cc/CentralSceneCC.js +427 -0
- package/build/esm/cc/CentralSceneCC.js.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +177 -0
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -0
- package/build/esm/cc/ClimateControlScheduleCC.js +466 -0
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -0
- package/build/esm/cc/ClockCC.d.ts +47 -0
- package/build/esm/cc/ClockCC.d.ts.map +1 -0
- package/build/esm/cc/ClockCC.js +205 -0
- package/build/esm/cc/ClockCC.js.map +1 -0
- package/build/esm/cc/ColorSwitchCC.d.ts +339 -0
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/ColorSwitchCC.js +1149 -0
- package/build/esm/cc/ColorSwitchCC.js.map +1 -0
- package/build/esm/cc/ConfigurationCC.d.ts +396 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/ConfigurationCC.js +2454 -0
- package/build/esm/cc/ConfigurationCC.js.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +17 -0
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -0
- package/build/esm/cc/DeviceResetLocallyCC.js +73 -0
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -0
- package/build/esm/cc/DoorLockCC.d.ts +837 -0
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockCC.js +1270 -0
- package/build/esm/cc/DoorLockCC.js.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts +77 -0
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -0
- package/build/esm/cc/DoorLockLoggingCC.js +316 -0
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -0
- package/build/esm/cc/EnergyProductionCC.d.ts +77 -0
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -0
- package/build/esm/cc/EnergyProductionCC.js +213 -0
- package/build/esm/cc/EnergyProductionCC.js.map +1 -0
- package/build/esm/cc/EntryControlCC.d.ts +231 -0
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -0
- package/build/esm/cc/EntryControlCC.js +581 -0
- package/build/esm/cc/EntryControlCC.js.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +1142 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
- package/build/esm/cc/HailCC.d.ts +6 -0
- package/build/esm/cc/HailCC.d.ts.map +1 -0
- package/build/esm/cc/HailCC.js +21 -0
- package/build/esm/cc/HailCC.js.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts +111 -0
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlModeCC.js +305 -0
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +60 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js +137 -0
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +209 -0
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/HumidityControlSetpointCC.js +645 -0
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -0
- package/build/esm/cc/InclusionControllerCC.d.ts +42 -0
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -0
- package/build/esm/cc/InclusionControllerCC.js +133 -0
- package/build/esm/cc/InclusionControllerCC.js.map +1 -0
- package/build/esm/cc/IndicatorCC.d.ts +338 -0
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -0
- package/build/esm/cc/IndicatorCC.js +1317 -0
- package/build/esm/cc/IndicatorCC.js.map +1 -0
- package/build/esm/cc/IrrigationCC.d.ts +1496 -0
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -0
- package/build/esm/cc/IrrigationCC.js +2038 -0
- package/build/esm/cc/IrrigationCC.js.map +1 -0
- package/build/esm/cc/LanguageCC.d.ts +101 -0
- package/build/esm/cc/LanguageCC.d.ts.map +1 -0
- package/build/esm/cc/LanguageCC.js +243 -0
- package/build/esm/cc/LanguageCC.js.map +1 -0
- package/build/esm/cc/LockCC.d.ts +73 -0
- package/build/esm/cc/LockCC.d.ts.map +1 -0
- package/build/esm/cc/LockCC.js +197 -0
- package/build/esm/cc/LockCC.js.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +32 -0
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js +201 -0
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +171 -0
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -0
- package/build/esm/cc/ManufacturerSpecificCC.js +315 -0
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -0
- package/build/esm/cc/MeterCC.d.ts +318 -0
- package/build/esm/cc/MeterCC.d.ts.map +1 -0
- package/build/esm/cc/MeterCC.js +1308 -0
- package/build/esm/cc/MeterCC.js.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +241 -0
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelAssociationCC.js +981 -0
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -0
- package/build/esm/cc/MultiChannelCC.d.ts +394 -0
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -0
- package/build/esm/cc/MultiChannelCC.js +1127 -0
- package/build/esm/cc/MultiChannelCC.js.map +1 -0
- package/build/esm/cc/MultiCommandCC.d.ts +27 -0
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -0
- package/build/esm/cc/MultiCommandCC.js +142 -0
- package/build/esm/cc/MultiCommandCC.js.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts +185 -0
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSensorCC.js +753 -0
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts +357 -0
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/MultilevelSwitchCC.js +810 -0
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -0
- package/build/esm/cc/NoOperationCC.d.ts +9 -0
- package/build/esm/cc/NoOperationCC.d.ts.map +1 -0
- package/build/esm/cc/NoOperationCC.js +39 -0
- package/build/esm/cc/NoOperationCC.js.map +1 -0
- package/build/esm/cc/NodeNamingCC.d.ts +118 -0
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -0
- package/build/esm/cc/NodeNamingCC.js +345 -0
- package/build/esm/cc/NodeNamingCC.js.map +1 -0
- package/build/esm/cc/NotificationCC.d.ts +479 -0
- package/build/esm/cc/NotificationCC.d.ts.map +1 -0
- package/build/esm/cc/NotificationCC.js +1350 -0
- package/build/esm/cc/NotificationCC.js.map +1 -0
- package/build/esm/cc/PowerlevelCC.d.ts +82 -0
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -0
- package/build/esm/cc/PowerlevelCC.js +485 -0
- package/build/esm/cc/PowerlevelCC.js.map +1 -0
- package/build/esm/cc/ProtectionCC.d.ts +325 -0
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -0
- package/build/esm/cc/ProtectionCC.js +669 -0
- package/build/esm/cc/ProtectionCC.js.map +1 -0
- package/build/esm/cc/SceneActivationCC.d.ts +89 -0
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActivationCC.js +166 -0
- package/build/esm/cc/SceneActivationCC.js.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +120 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js +374 -0
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +129 -0
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js +446 -0
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +434 -0
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -0
- package/build/esm/cc/ScheduleEntryLockCC.js +1826 -0
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -0
- package/build/esm/cc/Security2CC.d.ts +251 -0
- package/build/esm/cc/Security2CC.d.ts.map +1 -0
- package/build/esm/cc/Security2CC.js +1814 -0
- package/build/esm/cc/Security2CC.js.map +1 -0
- package/build/esm/cc/SecurityCC.d.ts +128 -0
- package/build/esm/cc/SecurityCC.d.ts.map +1 -0
- package/build/esm/cc/SecurityCC.js +800 -0
- package/build/esm/cc/SecurityCC.js.map +1 -0
- package/build/esm/cc/SoundSwitchCC.d.ts +232 -0
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -0
- package/build/esm/cc/SoundSwitchCC.js +633 -0
- package/build/esm/cc/SoundSwitchCC.js.map +1 -0
- package/build/esm/cc/SupervisionCC.d.ts +104 -0
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -0
- package/build/esm/cc/SupervisionCC.js +319 -0
- package/build/esm/cc/SupervisionCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts +141 -0
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanModeCC.js +359 -0
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts +60 -0
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatFanStateCC.js +139 -0
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatModeCC.d.ts +150 -0
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatModeCC.js +426 -0
- package/build/esm/cc/ThermostatModeCC.js.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +61 -0
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js +135 -0
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts +46 -0
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetbackCC.js +244 -0
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts +197 -0
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -0
- package/build/esm/cc/ThermostatSetpointCC.js +655 -0
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -0
- package/build/esm/cc/TimeCC.d.ts +88 -0
- package/build/esm/cc/TimeCC.d.ts.map +1 -0
- package/build/esm/cc/TimeCC.js +451 -0
- package/build/esm/cc/TimeCC.js.map +1 -0
- package/build/esm/cc/TimeParametersCC.d.ts +72 -0
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -0
- package/build/esm/cc/TimeParametersCC.js +300 -0
- package/build/esm/cc/TimeParametersCC.js.map +1 -0
- package/build/esm/cc/TransportServiceCC.d.ts +107 -0
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -0
- package/build/esm/cc/TransportServiceCC.js +422 -0
- package/build/esm/cc/TransportServiceCC.js.map +1 -0
- package/build/esm/cc/UserCodeCC.d.ts +683 -0
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -0
- package/build/esm/cc/UserCodeCC.js +1695 -0
- package/build/esm/cc/UserCodeCC.js.map +1 -0
- package/build/esm/cc/VersionCC.d.ts +469 -0
- package/build/esm/cc/VersionCC.d.ts.map +1 -0
- package/build/esm/cc/VersionCC.js +862 -0
- package/build/esm/cc/VersionCC.js.map +1 -0
- package/build/esm/cc/WakeUpCC.d.ts +150 -0
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -0
- package/build/esm/cc/WakeUpCC.js +438 -0
- package/build/esm/cc/WakeUpCC.js.map +1 -0
- package/build/esm/cc/WindowCoveringCC.d.ts +315 -0
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -0
- package/build/esm/cc/WindowCoveringCC.js +780 -0
- package/build/esm/cc/WindowCoveringCC.js.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts +4 -0
- package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveLongRangeCC.js +17 -0
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -0
- package/build/esm/cc/ZWavePlusCC.d.ts +163 -0
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -0
- package/build/esm/cc/ZWavePlusCC.js +267 -0
- package/build/esm/cc/ZWavePlusCC.js.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts +344 -0
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -0
- package/build/esm/cc/ZWaveProtocolCC.js +1030 -0
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -0
- package/build/esm/cc/index.d.ts +132 -0
- package/build/esm/cc/index.d.ts.map +1 -0
- package/build/esm/cc/index.js +71 -0
- package/build/esm/cc/index.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +64 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js +79 -0
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +385 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
- package/build/esm/index.d.ts +15 -0
- package/build/esm/index.d.ts.map +1 -0
- package/build/esm/index.js +14 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/index_safe.d.ts +3 -0
- package/build/esm/index_safe.d.ts.map +1 -0
- package/build/esm/index_safe.js +4 -0
- package/build/esm/index_safe.js.map +1 -0
- package/build/esm/lib/API.d.ts +271 -0
- package/build/esm/lib/API.d.ts.map +1 -0
- package/build/esm/lib/API.js +448 -0
- package/build/esm/lib/API.js.map +1 -0
- package/build/esm/lib/CommandClass.d.ts +234 -0
- package/build/esm/lib/CommandClass.d.ts.map +1 -0
- package/build/esm/lib/CommandClass.js +781 -0
- package/build/esm/lib/CommandClass.js.map +1 -0
- package/build/esm/lib/CommandClassDecorators.d.ts +112 -0
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -0
- package/build/esm/lib/CommandClassDecorators.js +229 -0
- package/build/esm/lib/CommandClassDecorators.js.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts +22 -0
- package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -0
- package/build/esm/lib/EncapsulatingCommandClass.js +56 -0
- package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -0
- package/build/esm/lib/ICommandClassContainer.d.ts +2 -0
- package/build/esm/lib/ICommandClassContainer.d.ts.map +1 -0
- package/build/esm/lib/ICommandClassContainer.js +2 -0
- package/build/esm/lib/ICommandClassContainer.js.map +1 -0
- package/build/esm/lib/NotificationEventPayload.d.ts +10 -0
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -0
- package/build/esm/lib/NotificationEventPayload.js +7 -0
- package/build/esm/lib/NotificationEventPayload.js.map +1 -0
- package/build/esm/lib/Security2/Extension.d.ts +106 -0
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -0
- package/build/esm/lib/Security2/Extension.js +296 -0
- package/build/esm/lib/Security2/Extension.js.map +1 -0
- package/build/esm/lib/Security2/shared.d.ts +37 -0
- package/build/esm/lib/Security2/shared.d.ts.map +1 -0
- package/build/esm/lib/Security2/shared.js +40 -0
- package/build/esm/lib/Security2/shared.js.map +1 -0
- package/build/esm/lib/SetValueResult.d.ts +55 -0
- package/build/esm/lib/SetValueResult.d.ts.map +1 -0
- package/build/esm/lib/SetValueResult.js +53 -0
- package/build/esm/lib/SetValueResult.js.map +1 -0
- package/build/esm/lib/Values.d.ts +223 -0
- package/build/esm/lib/Values.d.ts.map +1 -0
- package/build/esm/lib/Values.js +169 -0
- package/build/esm/lib/Values.js.map +1 -0
- package/build/esm/lib/_Types.d.ts +1461 -0
- package/build/esm/lib/_Types.d.ts.map +1 -0
- package/build/esm/lib/_Types.js +1432 -0
- package/build/esm/lib/_Types.js.map +1 -0
- package/build/esm/lib/serializers.d.ts +34 -0
- package/build/esm/lib/serializers.d.ts.map +1 -0
- package/build/esm/lib/serializers.js +98 -0
- package/build/esm/lib/serializers.js.map +1 -0
- package/build/esm/lib/utils.d.ts +17 -0
- package/build/esm/lib/utils.d.ts.map +1 -0
- package/build/esm/lib/utils.js +847 -0
- package/build/esm/lib/utils.js.map +1 -0
- package/build/esm/package.json +3 -0
- package/package.json +28 -23
- package/build/cc/AlarmSensorCC.d.ts +0 -194
- package/build/cc/AlarmSensorCC.d.ts.map +0 -1
- package/build/cc/AlarmSensorCC.js +0 -395
- package/build/cc/AlarmSensorCC.js.map +0 -1
- package/build/cc/AssociationCC.d.ts +0 -253
- package/build/cc/AssociationCC.d.ts.map +0 -1
- package/build/cc/AssociationCC.js +0 -732
- package/build/cc/AssociationCC.js.map +0 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +0 -230
- package/build/cc/AssociationGroupInfoCC.d.ts.map +0 -1
- package/build/cc/AssociationGroupInfoCC.js +0 -772
- package/build/cc/AssociationGroupInfoCC.js.map +0 -1
- package/build/cc/BarrierOperatorCC.d.ts +0 -243
- package/build/cc/BarrierOperatorCC.d.ts.map +0 -1
- package/build/cc/BarrierOperatorCC.js +0 -613
- package/build/cc/BarrierOperatorCC.js.map +0 -1
- package/build/cc/BasicCC.d.ts +0 -191
- package/build/cc/BasicCC.d.ts.map +0 -1
- package/build/cc/BasicCC.js +0 -393
- package/build/cc/BasicCC.js.map +0 -1
- package/build/cc/BatteryCC.d.ts +0 -406
- package/build/cc/BatteryCC.d.ts.map +0 -1
- package/build/cc/BatteryCC.js +0 -516
- package/build/cc/BatteryCC.js.map +0 -1
- package/build/cc/BinarySensorCC.d.ts +0 -122
- package/build/cc/BinarySensorCC.d.ts.map +0 -1
- package/build/cc/BinarySensorCC.js +0 -420
- package/build/cc/BinarySensorCC.js.map +0 -1
- package/build/cc/BinarySwitchCC.d.ts +0 -139
- package/build/cc/BinarySwitchCC.d.ts.map +0 -1
- package/build/cc/BinarySwitchCC.js +0 -365
- package/build/cc/BinarySwitchCC.js.map +0 -1
- package/build/cc/CRC16CC.d.ts +0 -29
- package/build/cc/CRC16CC.d.ts.map +0 -1
- package/build/cc/CRC16CC.js +0 -126
- package/build/cc/CRC16CC.js.map +0 -1
- package/build/cc/CentralSceneCC.d.ts +0 -210
- package/build/cc/CentralSceneCC.d.ts.map +0 -1
- package/build/cc/CentralSceneCC.js +0 -453
- package/build/cc/CentralSceneCC.js.map +0 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +0 -177
- package/build/cc/ClimateControlScheduleCC.d.ts.map +0 -1
- package/build/cc/ClimateControlScheduleCC.js +0 -469
- package/build/cc/ClimateControlScheduleCC.js.map +0 -1
- package/build/cc/ClockCC.d.ts +0 -47
- package/build/cc/ClockCC.d.ts.map +0 -1
- package/build/cc/ClockCC.js +0 -208
- package/build/cc/ClockCC.js.map +0 -1
- package/build/cc/ColorSwitchCC.d.ts +0 -339
- package/build/cc/ColorSwitchCC.d.ts.map +0 -1
- package/build/cc/ColorSwitchCC.js +0 -1152
- package/build/cc/ColorSwitchCC.js.map +0 -1
- package/build/cc/ConfigurationCC.d.ts +0 -396
- package/build/cc/ConfigurationCC.d.ts.map +0 -1
- package/build/cc/ConfigurationCC.js +0 -2458
- package/build/cc/ConfigurationCC.js.map +0 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +0 -17
- package/build/cc/DeviceResetLocallyCC.d.ts.map +0 -1
- package/build/cc/DeviceResetLocallyCC.js +0 -76
- package/build/cc/DeviceResetLocallyCC.js.map +0 -1
- package/build/cc/DoorLockCC.d.ts +0 -837
- package/build/cc/DoorLockCC.d.ts.map +0 -1
- package/build/cc/DoorLockCC.js +0 -1273
- package/build/cc/DoorLockCC.js.map +0 -1
- package/build/cc/DoorLockLoggingCC.d.ts +0 -77
- package/build/cc/DoorLockLoggingCC.d.ts.map +0 -1
- package/build/cc/DoorLockLoggingCC.js +0 -319
- package/build/cc/DoorLockLoggingCC.js.map +0 -1
- package/build/cc/EnergyProductionCC.d.ts +0 -77
- package/build/cc/EnergyProductionCC.d.ts.map +0 -1
- package/build/cc/EnergyProductionCC.js +0 -216
- package/build/cc/EnergyProductionCC.js.map +0 -1
- package/build/cc/EntryControlCC.d.ts +0 -231
- package/build/cc/EntryControlCC.d.ts.map +0 -1
- package/build/cc/EntryControlCC.js +0 -607
- package/build/cc/EntryControlCC.js.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +0 -359
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +0 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +0 -1145
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +0 -1
- package/build/cc/HailCC.d.ts +0 -6
- package/build/cc/HailCC.d.ts.map +0 -1
- package/build/cc/HailCC.js +0 -24
- package/build/cc/HailCC.js.map +0 -1
- package/build/cc/HumidityControlModeCC.d.ts +0 -111
- package/build/cc/HumidityControlModeCC.d.ts.map +0 -1
- package/build/cc/HumidityControlModeCC.js +0 -308
- package/build/cc/HumidityControlModeCC.js.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +0 -60
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +0 -1
- package/build/cc/HumidityControlOperatingStateCC.js +0 -140
- package/build/cc/HumidityControlOperatingStateCC.js.map +0 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +0 -209
- package/build/cc/HumidityControlSetpointCC.d.ts.map +0 -1
- package/build/cc/HumidityControlSetpointCC.js +0 -648
- package/build/cc/HumidityControlSetpointCC.js.map +0 -1
- package/build/cc/InclusionControllerCC.d.ts +0 -42
- package/build/cc/InclusionControllerCC.d.ts.map +0 -1
- package/build/cc/InclusionControllerCC.js +0 -136
- package/build/cc/InclusionControllerCC.js.map +0 -1
- package/build/cc/IndicatorCC.d.ts +0 -338
- package/build/cc/IndicatorCC.d.ts.map +0 -1
- package/build/cc/IndicatorCC.js +0 -1320
- package/build/cc/IndicatorCC.js.map +0 -1
- package/build/cc/IrrigationCC.d.ts +0 -1496
- package/build/cc/IrrigationCC.d.ts.map +0 -1
- package/build/cc/IrrigationCC.js +0 -2041
- package/build/cc/IrrigationCC.js.map +0 -1
- package/build/cc/LanguageCC.d.ts +0 -101
- package/build/cc/LanguageCC.d.ts.map +0 -1
- package/build/cc/LanguageCC.js +0 -246
- package/build/cc/LanguageCC.js.map +0 -1
- package/build/cc/LockCC.d.ts +0 -73
- package/build/cc/LockCC.d.ts.map +0 -1
- package/build/cc/LockCC.js +0 -200
- package/build/cc/LockCC.js.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +0 -32
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +0 -1
- package/build/cc/ManufacturerProprietaryCC.js +0 -204
- package/build/cc/ManufacturerProprietaryCC.js.map +0 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +0 -171
- package/build/cc/ManufacturerSpecificCC.d.ts.map +0 -1
- package/build/cc/ManufacturerSpecificCC.js +0 -318
- package/build/cc/ManufacturerSpecificCC.js.map +0 -1
- package/build/cc/MeterCC.d.ts +0 -318
- package/build/cc/MeterCC.d.ts.map +0 -1
- package/build/cc/MeterCC.js +0 -1312
- package/build/cc/MeterCC.js.map +0 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +0 -241
- package/build/cc/MultiChannelAssociationCC.d.ts.map +0 -1
- package/build/cc/MultiChannelAssociationCC.js +0 -1007
- package/build/cc/MultiChannelAssociationCC.js.map +0 -1
- package/build/cc/MultiChannelCC.d.ts +0 -394
- package/build/cc/MultiChannelCC.d.ts.map +0 -1
- package/build/cc/MultiChannelCC.js +0 -1130
- package/build/cc/MultiChannelCC.js.map +0 -1
- package/build/cc/MultiCommandCC.d.ts +0 -27
- package/build/cc/MultiCommandCC.d.ts.map +0 -1
- package/build/cc/MultiCommandCC.js +0 -145
- package/build/cc/MultiCommandCC.js.map +0 -1
- package/build/cc/MultilevelSensorCC.d.ts +0 -185
- package/build/cc/MultilevelSensorCC.d.ts.map +0 -1
- package/build/cc/MultilevelSensorCC.js +0 -756
- package/build/cc/MultilevelSensorCC.js.map +0 -1
- package/build/cc/MultilevelSwitchCC.d.ts +0 -357
- package/build/cc/MultilevelSwitchCC.d.ts.map +0 -1
- package/build/cc/MultilevelSwitchCC.js +0 -813
- package/build/cc/MultilevelSwitchCC.js.map +0 -1
- package/build/cc/NoOperationCC.d.ts +0 -9
- package/build/cc/NoOperationCC.d.ts.map +0 -1
- package/build/cc/NoOperationCC.js +0 -42
- package/build/cc/NoOperationCC.js.map +0 -1
- package/build/cc/NodeNamingCC.d.ts +0 -118
- package/build/cc/NodeNamingCC.d.ts.map +0 -1
- package/build/cc/NodeNamingCC.js +0 -348
- package/build/cc/NodeNamingCC.js.map +0 -1
- package/build/cc/NotificationCC.d.ts +0 -479
- package/build/cc/NotificationCC.d.ts.map +0 -1
- package/build/cc/NotificationCC.js +0 -1379
- package/build/cc/NotificationCC.js.map +0 -1
- package/build/cc/PowerlevelCC.d.ts +0 -82
- package/build/cc/PowerlevelCC.d.ts.map +0 -1
- package/build/cc/PowerlevelCC.js +0 -488
- package/build/cc/PowerlevelCC.js.map +0 -1
- package/build/cc/ProtectionCC.d.ts +0 -325
- package/build/cc/ProtectionCC.d.ts.map +0 -1
- package/build/cc/ProtectionCC.js +0 -672
- package/build/cc/ProtectionCC.js.map +0 -1
- package/build/cc/SceneActivationCC.d.ts +0 -89
- package/build/cc/SceneActivationCC.d.ts.map +0 -1
- package/build/cc/SceneActivationCC.js +0 -169
- package/build/cc/SceneActivationCC.js.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +0 -120
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneActuatorConfigurationCC.js +0 -377
- package/build/cc/SceneActuatorConfigurationCC.js.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +0 -129
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +0 -1
- package/build/cc/SceneControllerConfigurationCC.js +0 -449
- package/build/cc/SceneControllerConfigurationCC.js.map +0 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +0 -434
- package/build/cc/ScheduleEntryLockCC.d.ts.map +0 -1
- package/build/cc/ScheduleEntryLockCC.js +0 -1829
- package/build/cc/ScheduleEntryLockCC.js.map +0 -1
- package/build/cc/Security2CC.d.ts +0 -251
- package/build/cc/Security2CC.d.ts.map +0 -1
- package/build/cc/Security2CC.js +0 -1817
- package/build/cc/Security2CC.js.map +0 -1
- package/build/cc/SecurityCC.d.ts +0 -128
- package/build/cc/SecurityCC.d.ts.map +0 -1
- package/build/cc/SecurityCC.js +0 -803
- package/build/cc/SecurityCC.js.map +0 -1
- package/build/cc/SoundSwitchCC.d.ts +0 -232
- package/build/cc/SoundSwitchCC.d.ts.map +0 -1
- package/build/cc/SoundSwitchCC.js +0 -636
- package/build/cc/SoundSwitchCC.js.map +0 -1
- package/build/cc/SupervisionCC.d.ts +0 -104
- package/build/cc/SupervisionCC.d.ts.map +0 -1
- package/build/cc/SupervisionCC.js +0 -322
- package/build/cc/SupervisionCC.js.map +0 -1
- package/build/cc/ThermostatFanModeCC.d.ts +0 -141
- package/build/cc/ThermostatFanModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanModeCC.js +0 -362
- package/build/cc/ThermostatFanModeCC.js.map +0 -1
- package/build/cc/ThermostatFanStateCC.d.ts +0 -60
- package/build/cc/ThermostatFanStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatFanStateCC.js +0 -142
- package/build/cc/ThermostatFanStateCC.js.map +0 -1
- package/build/cc/ThermostatModeCC.d.ts +0 -150
- package/build/cc/ThermostatModeCC.d.ts.map +0 -1
- package/build/cc/ThermostatModeCC.js +0 -429
- package/build/cc/ThermostatModeCC.js.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +0 -61
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +0 -1
- package/build/cc/ThermostatOperatingStateCC.js +0 -138
- package/build/cc/ThermostatOperatingStateCC.js.map +0 -1
- package/build/cc/ThermostatSetbackCC.d.ts +0 -46
- package/build/cc/ThermostatSetbackCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetbackCC.js +0 -247
- package/build/cc/ThermostatSetbackCC.js.map +0 -1
- package/build/cc/ThermostatSetpointCC.d.ts +0 -197
- package/build/cc/ThermostatSetpointCC.d.ts.map +0 -1
- package/build/cc/ThermostatSetpointCC.js +0 -658
- package/build/cc/ThermostatSetpointCC.js.map +0 -1
- package/build/cc/TimeCC.d.ts +0 -88
- package/build/cc/TimeCC.d.ts.map +0 -1
- package/build/cc/TimeCC.js +0 -454
- package/build/cc/TimeCC.js.map +0 -1
- package/build/cc/TimeParametersCC.d.ts +0 -72
- package/build/cc/TimeParametersCC.d.ts.map +0 -1
- package/build/cc/TimeParametersCC.js +0 -303
- package/build/cc/TimeParametersCC.js.map +0 -1
- package/build/cc/TransportServiceCC.d.ts +0 -107
- package/build/cc/TransportServiceCC.d.ts.map +0 -1
- package/build/cc/TransportServiceCC.js +0 -426
- package/build/cc/TransportServiceCC.js.map +0 -1
- package/build/cc/UserCodeCC.d.ts +0 -683
- package/build/cc/UserCodeCC.d.ts.map +0 -1
- package/build/cc/UserCodeCC.js +0 -1699
- package/build/cc/UserCodeCC.js.map +0 -1
- package/build/cc/VersionCC.d.ts +0 -469
- package/build/cc/VersionCC.d.ts.map +0 -1
- package/build/cc/VersionCC.js +0 -865
- package/build/cc/VersionCC.js.map +0 -1
- package/build/cc/WakeUpCC.d.ts +0 -150
- package/build/cc/WakeUpCC.d.ts.map +0 -1
- package/build/cc/WakeUpCC.js +0 -441
- package/build/cc/WakeUpCC.js.map +0 -1
- package/build/cc/WindowCoveringCC.d.ts +0 -315
- package/build/cc/WindowCoveringCC.d.ts.map +0 -1
- package/build/cc/WindowCoveringCC.js +0 -783
- package/build/cc/WindowCoveringCC.js.map +0 -1
- package/build/cc/ZWaveLongRangeCC.d.ts +0 -4
- package/build/cc/ZWaveLongRangeCC.d.ts.map +0 -1
- package/build/cc/ZWaveLongRangeCC.js +0 -20
- package/build/cc/ZWaveLongRangeCC.js.map +0 -1
- package/build/cc/ZWavePlusCC.d.ts +0 -163
- package/build/cc/ZWavePlusCC.d.ts.map +0 -1
- package/build/cc/ZWavePlusCC.js +0 -270
- package/build/cc/ZWavePlusCC.js.map +0 -1
- package/build/cc/ZWaveProtocolCC.d.ts +0 -344
- package/build/cc/ZWaveProtocolCC.d.ts.map +0 -1
- package/build/cc/ZWaveProtocolCC.js +0 -1033
- package/build/cc/ZWaveProtocolCC.js.map +0 -1
- package/build/cc/index.d.ts +0 -132
- package/build/cc/index.d.ts.map +0 -1
- package/build/cc/index.js +0 -627
- package/build/cc/index.js.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.d.ts +0 -64
- package/build/cc/manufacturerProprietary/Decorators.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/Decorators.js +0 -83
- package/build/cc/manufacturerProprietary/Decorators.js.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +0 -79
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +0 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +0 -392
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +0 -1
- package/build/index.d.ts +0 -15
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -52
- package/build/index.js.map +0 -1
- package/build/index_safe.d.ts +0 -3
- package/build/index_safe.d.ts.map +0 -1
- package/build/index_safe.js +0 -20
- package/build/index_safe.js.map +0 -1
- package/build/lib/API.d.ts +0 -271
- package/build/lib/API.d.ts.map +0 -1
- package/build/lib/API.js +0 -458
- package/build/lib/API.js.map +0 -1
- package/build/lib/CommandClass.d.ts +0 -234
- package/build/lib/CommandClass.d.ts.map +0 -1
- package/build/lib/CommandClass.js +0 -788
- package/build/lib/CommandClass.js.map +0 -1
- package/build/lib/CommandClassDecorators.d.ts +0 -112
- package/build/lib/CommandClassDecorators.d.ts.map +0 -1
- package/build/lib/CommandClassDecorators.js +0 -243
- package/build/lib/CommandClassDecorators.js.map +0 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +0 -22
- package/build/lib/EncapsulatingCommandClass.d.ts.map +0 -1
- package/build/lib/EncapsulatingCommandClass.js +0 -61
- package/build/lib/EncapsulatingCommandClass.js.map +0 -1
- package/build/lib/ICommandClassContainer.d.ts.map +0 -1
- package/build/lib/ICommandClassContainer.js +0 -3
- package/build/lib/ICommandClassContainer.js.map +0 -1
- package/build/lib/NotificationEventPayload.d.ts +0 -10
- package/build/lib/NotificationEventPayload.d.ts.map +0 -1
- package/build/lib/NotificationEventPayload.js +0 -10
- package/build/lib/NotificationEventPayload.js.map +0 -1
- package/build/lib/Security2/Extension.d.ts.map +0 -1
- package/build/lib/Security2/Extension.js +0 -303
- package/build/lib/Security2/Extension.js.map +0 -1
- package/build/lib/Security2/shared.d.ts.map +0 -1
- package/build/lib/Security2/shared.js +0 -43
- package/build/lib/Security2/shared.js.map +0 -1
- package/build/lib/SetValueResult.d.ts.map +0 -1
- package/build/lib/SetValueResult.js +0 -60
- package/build/lib/SetValueResult.js.map +0 -1
- package/build/lib/Values.d.ts +0 -223
- package/build/lib/Values.d.ts.map +0 -1
- package/build/lib/Values.js +0 -172
- package/build/lib/Values.js.map +0 -1
- package/build/lib/_Types.d.ts.map +0 -1
- package/build/lib/_Types.js +0 -1443
- package/build/lib/_Types.js.map +0 -1
- package/build/lib/serializers.d.ts +0 -34
- package/build/lib/serializers.d.ts.map +0 -1
- package/build/lib/serializers.js +0 -107
- package/build/lib/serializers.js.map +0 -1
- package/build/lib/utils.d.ts +0 -17
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -860
- package/build/lib/utils.js.map +0 -1
- /package/build/{lib → cjs/lib}/ICommandClassContainer.d.ts +0 -0
- /package/build/{lib → cjs/lib}/Security2/Extension.d.ts +0 -0
- /package/build/{lib → cjs/lib}/Security2/shared.d.ts +0 -0
- /package/build/{lib → cjs/lib}/SetValueResult.d.ts +0 -0
- /package/build/{lib → cjs/lib}/_Types.d.ts +0 -0
|
@@ -1,2458 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var ConfigurationCCReport_1, ConfigurationCCGet_1, ConfigurationCCSet_1, ConfigurationCCBulkReport_1, ConfigurationCCNameReport_1, ConfigurationCCNameGet_1, ConfigurationCCInfoReport_1, ConfigurationCCInfoGet_1, ConfigurationCCPropertiesReport_1, ConfigurationCCPropertiesGet_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ConfigurationCCDefaultReset = exports.ConfigurationCCPropertiesGet = exports.ConfigurationCCPropertiesReport = exports.ConfigurationCCInfoGet = exports.ConfigurationCCInfoReport = exports.ConfigurationCCNameGet = exports.ConfigurationCCNameReport = exports.ConfigurationCCBulkGet = exports.ConfigurationCCBulkReport = exports.ConfigurationCCBulkSet = exports.ConfigurationCCSet = exports.ConfigurationCCGet = exports.ConfigurationCCReport = exports.ConfigurationCC = exports.ConfigurationCCAPI = exports.ConfigurationCCValues = exports.ConfigurationCCError = void 0;
|
|
11
|
-
function __assertType(argName, typeName, boundHasError) {
|
|
12
|
-
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
13
|
-
if (boundHasError()) {
|
|
14
|
-
throw new ZWaveError(typeName ? `${argName} is not a ${typeName}` : `${argName} has the wrong type`, ZWaveErrorCodes.Argument_Invalid);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const __assertType__number = $o => {
|
|
18
|
-
function _number($o) {
|
|
19
|
-
return typeof $o !== "number" ? {} : null;
|
|
20
|
-
}
|
|
21
|
-
return _number($o);
|
|
22
|
-
};
|
|
23
|
-
const __assertType__optional__0 = $o => {
|
|
24
|
-
function _number($o) {
|
|
25
|
-
return typeof $o !== "number" ? {} : null;
|
|
26
|
-
}
|
|
27
|
-
function _boolean($o) {
|
|
28
|
-
return typeof $o !== "boolean" ? {} : null;
|
|
29
|
-
}
|
|
30
|
-
function _0($o) {
|
|
31
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
32
|
-
return {};
|
|
33
|
-
if ("valueBitMask" in $o && $o["valueBitMask"] !== undefined) {
|
|
34
|
-
const error = _number($o["valueBitMask"]);
|
|
35
|
-
if (error)
|
|
36
|
-
return error;
|
|
37
|
-
}
|
|
38
|
-
if ("allowUnexpectedResponse" in $o && $o["allowUnexpectedResponse"] !== undefined) {
|
|
39
|
-
const error = _boolean($o["allowUnexpectedResponse"]);
|
|
40
|
-
if (error)
|
|
41
|
-
return error;
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
function optional__0($o) {
|
|
46
|
-
if ($o !== undefined) {
|
|
47
|
-
const error = _0($o);
|
|
48
|
-
if (error)
|
|
49
|
-
return error;
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
return optional__0($o);
|
|
54
|
-
};
|
|
55
|
-
const __assertType__sa__2_ea_2 = $o => {
|
|
56
|
-
function _number($o) {
|
|
57
|
-
return typeof $o !== "number" ? {} : null;
|
|
58
|
-
}
|
|
59
|
-
function _2($o) {
|
|
60
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
61
|
-
return {};
|
|
62
|
-
if ("parameter" in $o && $o["parameter"] !== undefined) {
|
|
63
|
-
const error = _number($o["parameter"]);
|
|
64
|
-
if (error)
|
|
65
|
-
return error;
|
|
66
|
-
}
|
|
67
|
-
else
|
|
68
|
-
return {};
|
|
69
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
70
|
-
const error = _number($o["bitMask"]);
|
|
71
|
-
if (error)
|
|
72
|
-
return error;
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
function sa__2_ea_2($o) {
|
|
77
|
-
if (!Array.isArray($o))
|
|
78
|
-
return {};
|
|
79
|
-
for (let i = 0; i < $o.length; i++) {
|
|
80
|
-
const error = _2($o[i]);
|
|
81
|
-
if (error)
|
|
82
|
-
return error;
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
return sa__2_ea_2($o);
|
|
87
|
-
};
|
|
88
|
-
const __assertType__ConfigurationCCAPISetOptions = $o => {
|
|
89
|
-
function _number($o) {
|
|
90
|
-
return typeof $o !== "number" ? {} : null;
|
|
91
|
-
}
|
|
92
|
-
function _2($o) {
|
|
93
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
94
|
-
return {};
|
|
95
|
-
if ("parameter" in $o && $o["parameter"] !== undefined) {
|
|
96
|
-
const error = _number($o["parameter"]);
|
|
97
|
-
if (error)
|
|
98
|
-
return error;
|
|
99
|
-
}
|
|
100
|
-
else
|
|
101
|
-
return {};
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
function _undefined($o) {
|
|
105
|
-
return $o !== undefined ? {} : null;
|
|
106
|
-
}
|
|
107
|
-
function _3($o) {
|
|
108
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
109
|
-
return {};
|
|
110
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
111
|
-
const error = _undefined($o["bitMask"]);
|
|
112
|
-
if (error)
|
|
113
|
-
return error;
|
|
114
|
-
}
|
|
115
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
116
|
-
const error = _number($o["value"]);
|
|
117
|
-
if (error)
|
|
118
|
-
return error;
|
|
119
|
-
}
|
|
120
|
-
else
|
|
121
|
-
return {};
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
function si__2__3_ei($o) {
|
|
125
|
-
const conditions = [_2, _3];
|
|
126
|
-
for (const condition of conditions) {
|
|
127
|
-
const error = condition($o);
|
|
128
|
-
if (error)
|
|
129
|
-
return error;
|
|
130
|
-
}
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
function _9($o) {
|
|
134
|
-
return $o !== 1 ? {} : null;
|
|
135
|
-
}
|
|
136
|
-
function _10($o) {
|
|
137
|
-
return $o !== 2 ? {} : null;
|
|
138
|
-
}
|
|
139
|
-
function _11($o) {
|
|
140
|
-
return $o !== 4 ? {} : null;
|
|
141
|
-
}
|
|
142
|
-
function su__9__10__11_eu($o) {
|
|
143
|
-
const conditions = [_9, _10, _11];
|
|
144
|
-
for (const condition of conditions) {
|
|
145
|
-
const error = condition($o);
|
|
146
|
-
if (!error)
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
return {};
|
|
150
|
-
}
|
|
151
|
-
function su__13__14__15__16_eu($o) {
|
|
152
|
-
return ![0, 1, 2, 3].includes($o) ? {} : null;
|
|
153
|
-
}
|
|
154
|
-
function _5($o) {
|
|
155
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
156
|
-
return {};
|
|
157
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
158
|
-
const error = _undefined($o["bitMask"]);
|
|
159
|
-
if (error)
|
|
160
|
-
return error;
|
|
161
|
-
}
|
|
162
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
163
|
-
const error = _number($o["value"]);
|
|
164
|
-
if (error)
|
|
165
|
-
return error;
|
|
166
|
-
}
|
|
167
|
-
else
|
|
168
|
-
return {};
|
|
169
|
-
if ("valueSize" in $o && $o["valueSize"] !== undefined) {
|
|
170
|
-
const error = su__9__10__11_eu($o["valueSize"]);
|
|
171
|
-
if (error)
|
|
172
|
-
return error;
|
|
173
|
-
}
|
|
174
|
-
else
|
|
175
|
-
return {};
|
|
176
|
-
if ("valueFormat" in $o && $o["valueFormat"] !== undefined) {
|
|
177
|
-
const error = su__13__14__15__16_eu($o["valueFormat"]);
|
|
178
|
-
if (error)
|
|
179
|
-
return error;
|
|
180
|
-
}
|
|
181
|
-
else
|
|
182
|
-
return {};
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
function si__2__5_ei($o) {
|
|
186
|
-
const conditions = [_2, _5];
|
|
187
|
-
for (const condition of conditions) {
|
|
188
|
-
const error = condition($o);
|
|
189
|
-
if (error)
|
|
190
|
-
return error;
|
|
191
|
-
}
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
function _7($o) {
|
|
195
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
196
|
-
return {};
|
|
197
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
198
|
-
const error = _number($o["bitMask"]);
|
|
199
|
-
if (error)
|
|
200
|
-
return error;
|
|
201
|
-
}
|
|
202
|
-
else
|
|
203
|
-
return {};
|
|
204
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
205
|
-
const error = _number($o["value"]);
|
|
206
|
-
if (error)
|
|
207
|
-
return error;
|
|
208
|
-
}
|
|
209
|
-
else
|
|
210
|
-
return {};
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
function si__2__7_ei($o) {
|
|
214
|
-
const conditions = [_2, _7];
|
|
215
|
-
for (const condition of conditions) {
|
|
216
|
-
const error = condition($o);
|
|
217
|
-
if (error)
|
|
218
|
-
return error;
|
|
219
|
-
}
|
|
220
|
-
return null;
|
|
221
|
-
}
|
|
222
|
-
function su_si__2__3_ei_si__2__5_ei_si__2__7_ei_eu($o) {
|
|
223
|
-
const conditions = [si__2__3_ei, si__2__5_ei, si__2__7_ei];
|
|
224
|
-
for (const condition of conditions) {
|
|
225
|
-
const error = condition($o);
|
|
226
|
-
if (!error)
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
return {};
|
|
230
|
-
}
|
|
231
|
-
return su_si__2__3_ei_si__2__5_ei_si__2__7_ei_eu($o);
|
|
232
|
-
};
|
|
233
|
-
const __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2 = $o => {
|
|
234
|
-
function _number($o) {
|
|
235
|
-
return typeof $o !== "number" ? {} : null;
|
|
236
|
-
}
|
|
237
|
-
function _4($o) {
|
|
238
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
239
|
-
return {};
|
|
240
|
-
if ("parameter" in $o && $o["parameter"] !== undefined) {
|
|
241
|
-
const error = _number($o["parameter"]);
|
|
242
|
-
if (error)
|
|
243
|
-
return error;
|
|
244
|
-
}
|
|
245
|
-
else
|
|
246
|
-
return {};
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
function _undefined($o) {
|
|
250
|
-
return $o !== undefined ? {} : null;
|
|
251
|
-
}
|
|
252
|
-
function _5($o) {
|
|
253
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
254
|
-
return {};
|
|
255
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
256
|
-
const error = _undefined($o["bitMask"]);
|
|
257
|
-
if (error)
|
|
258
|
-
return error;
|
|
259
|
-
}
|
|
260
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
261
|
-
const error = _number($o["value"]);
|
|
262
|
-
if (error)
|
|
263
|
-
return error;
|
|
264
|
-
}
|
|
265
|
-
else
|
|
266
|
-
return {};
|
|
267
|
-
return null;
|
|
268
|
-
}
|
|
269
|
-
function si__4__5_ei($o) {
|
|
270
|
-
const conditions = [_4, _5];
|
|
271
|
-
for (const condition of conditions) {
|
|
272
|
-
const error = condition($o);
|
|
273
|
-
if (error)
|
|
274
|
-
return error;
|
|
275
|
-
}
|
|
276
|
-
return null;
|
|
277
|
-
}
|
|
278
|
-
function _11($o) {
|
|
279
|
-
return $o !== 1 ? {} : null;
|
|
280
|
-
}
|
|
281
|
-
function _12($o) {
|
|
282
|
-
return $o !== 2 ? {} : null;
|
|
283
|
-
}
|
|
284
|
-
function _13($o) {
|
|
285
|
-
return $o !== 4 ? {} : null;
|
|
286
|
-
}
|
|
287
|
-
function su__11__12__13_eu($o) {
|
|
288
|
-
const conditions = [_11, _12, _13];
|
|
289
|
-
for (const condition of conditions) {
|
|
290
|
-
const error = condition($o);
|
|
291
|
-
if (!error)
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
return {};
|
|
295
|
-
}
|
|
296
|
-
function su__15__16__17__18_eu($o) {
|
|
297
|
-
return ![0, 1, 2, 3].includes($o) ? {} : null;
|
|
298
|
-
}
|
|
299
|
-
function _7($o) {
|
|
300
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
301
|
-
return {};
|
|
302
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
303
|
-
const error = _undefined($o["bitMask"]);
|
|
304
|
-
if (error)
|
|
305
|
-
return error;
|
|
306
|
-
}
|
|
307
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
308
|
-
const error = _number($o["value"]);
|
|
309
|
-
if (error)
|
|
310
|
-
return error;
|
|
311
|
-
}
|
|
312
|
-
else
|
|
313
|
-
return {};
|
|
314
|
-
if ("valueSize" in $o && $o["valueSize"] !== undefined) {
|
|
315
|
-
const error = su__11__12__13_eu($o["valueSize"]);
|
|
316
|
-
if (error)
|
|
317
|
-
return error;
|
|
318
|
-
}
|
|
319
|
-
else
|
|
320
|
-
return {};
|
|
321
|
-
if ("valueFormat" in $o && $o["valueFormat"] !== undefined) {
|
|
322
|
-
const error = su__15__16__17__18_eu($o["valueFormat"]);
|
|
323
|
-
if (error)
|
|
324
|
-
return error;
|
|
325
|
-
}
|
|
326
|
-
else
|
|
327
|
-
return {};
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
330
|
-
function si__4__7_ei($o) {
|
|
331
|
-
const conditions = [_4, _7];
|
|
332
|
-
for (const condition of conditions) {
|
|
333
|
-
const error = condition($o);
|
|
334
|
-
if (error)
|
|
335
|
-
return error;
|
|
336
|
-
}
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
function _9($o) {
|
|
340
|
-
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
341
|
-
return {};
|
|
342
|
-
if ("bitMask" in $o && $o["bitMask"] !== undefined) {
|
|
343
|
-
const error = _number($o["bitMask"]);
|
|
344
|
-
if (error)
|
|
345
|
-
return error;
|
|
346
|
-
}
|
|
347
|
-
else
|
|
348
|
-
return {};
|
|
349
|
-
if ("value" in $o && $o["value"] !== undefined) {
|
|
350
|
-
const error = _number($o["value"]);
|
|
351
|
-
if (error)
|
|
352
|
-
return error;
|
|
353
|
-
}
|
|
354
|
-
else
|
|
355
|
-
return {};
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
function si__4__9_ei($o) {
|
|
359
|
-
const conditions = [_4, _9];
|
|
360
|
-
for (const condition of conditions) {
|
|
361
|
-
const error = condition($o);
|
|
362
|
-
if (error)
|
|
363
|
-
return error;
|
|
364
|
-
}
|
|
365
|
-
return null;
|
|
366
|
-
}
|
|
367
|
-
function su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu($o) {
|
|
368
|
-
const conditions = [si__4__5_ei, si__4__7_ei, si__4__9_ei];
|
|
369
|
-
for (const condition of conditions) {
|
|
370
|
-
const error = condition($o);
|
|
371
|
-
if (!error)
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
return {};
|
|
375
|
-
}
|
|
376
|
-
function sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2($o) {
|
|
377
|
-
if (!Array.isArray($o))
|
|
378
|
-
return {};
|
|
379
|
-
for (let i = 0; i < $o.length; i++) {
|
|
380
|
-
const error = su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu($o[i]);
|
|
381
|
-
if (error)
|
|
382
|
-
return error;
|
|
383
|
-
}
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
return sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2($o);
|
|
387
|
-
};
|
|
388
|
-
const __assertType__sa__number_ea_2 = $o => {
|
|
389
|
-
function _number($o) {
|
|
390
|
-
return typeof $o !== "number" ? {} : null;
|
|
391
|
-
}
|
|
392
|
-
function sa__number_ea_2($o) {
|
|
393
|
-
if (!Array.isArray($o))
|
|
394
|
-
return {};
|
|
395
|
-
for (let i = 0; i < $o.length; i++) {
|
|
396
|
-
const error = _number($o[i]);
|
|
397
|
-
if (error)
|
|
398
|
-
return error;
|
|
399
|
-
}
|
|
400
|
-
return null;
|
|
401
|
-
}
|
|
402
|
-
return sa__number_ea_2($o);
|
|
403
|
-
};
|
|
404
|
-
const safe_1 = require("@zwave-js/core/safe");
|
|
405
|
-
const safe_2 = require("@zwave-js/shared/safe");
|
|
406
|
-
const safe_3 = require("@zwave-js/shared/safe");
|
|
407
|
-
const arrays_1 = require("alcalzone-shared/arrays");
|
|
408
|
-
const objects_1 = require("alcalzone-shared/objects");
|
|
409
|
-
const strings_1 = require("alcalzone-shared/strings");
|
|
410
|
-
const API_1 = require("../lib/API");
|
|
411
|
-
const CommandClass_1 = require("../lib/CommandClass");
|
|
412
|
-
const CommandClassDecorators_1 = require("../lib/CommandClassDecorators");
|
|
413
|
-
const Values_1 = require("../lib/Values");
|
|
414
|
-
const _Types_1 = require("../lib/_Types");
|
|
415
|
-
function configValueToString(value) {
|
|
416
|
-
if (typeof value === "number")
|
|
417
|
-
return value.toString();
|
|
418
|
-
else
|
|
419
|
-
return [...value].join(", ");
|
|
420
|
-
}
|
|
421
|
-
class ConfigurationCCError extends safe_1.ZWaveError {
|
|
422
|
-
message;
|
|
423
|
-
code;
|
|
424
|
-
argument;
|
|
425
|
-
constructor(message, code, argument) {
|
|
426
|
-
super(message, code);
|
|
427
|
-
this.message = message;
|
|
428
|
-
this.code = code;
|
|
429
|
-
this.argument = argument;
|
|
430
|
-
// We need to set the prototype explicitly
|
|
431
|
-
Object.setPrototypeOf(this, ConfigurationCCError.prototype);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
exports.ConfigurationCCError = ConfigurationCCError;
|
|
435
|
-
exports.ConfigurationCCValues = Object.freeze({
|
|
436
|
-
...Values_1.V.defineStaticCCValues(safe_1.CommandClasses.Configuration, {
|
|
437
|
-
...Values_1.V.staticProperty("isParamInformationFromConfig", undefined, // meta
|
|
438
|
-
{ internal: true, supportsEndpoints: false }),
|
|
439
|
-
}),
|
|
440
|
-
...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses.Configuration, {
|
|
441
|
-
...Values_1.V.dynamicPropertyAndKeyWithName("paramInformation",
|
|
442
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
443
|
-
(parameter, bitMask) => parameter, (parameter, bitMask) => bitMask, ({ property, propertyKey }) => typeof property === "number"
|
|
444
|
-
&& (typeof propertyKey === "number"
|
|
445
|
-
|| propertyKey == undefined),
|
|
446
|
-
// Metadata is determined dynamically depending on other factors
|
|
447
|
-
undefined),
|
|
448
|
-
}),
|
|
449
|
-
});
|
|
450
|
-
function createConfigurationCCInstance(endpoint) {
|
|
451
|
-
return CommandClass_1.CommandClass.createInstanceUnchecked(endpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint, ConfigurationCC);
|
|
452
|
-
}
|
|
453
|
-
function normalizeConfigurationCCAPISetOptions(ctx, endpoint, options) {
|
|
454
|
-
if ("bitMask" in options && options.bitMask) {
|
|
455
|
-
// Variant 3: Partial param, look it up in the device config
|
|
456
|
-
const ccc = createConfigurationCCInstance(endpoint);
|
|
457
|
-
const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);
|
|
458
|
-
if (!paramInfo.isFromConfig) {
|
|
459
|
-
throw new safe_1.ZWaveError("Setting a partial configuration parameter requires it to be defined in a device config file!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
460
|
-
}
|
|
461
|
-
return {
|
|
462
|
-
parameter: options.parameter,
|
|
463
|
-
bitMask: options.bitMask,
|
|
464
|
-
value: options.value,
|
|
465
|
-
valueSize: paramInfo.valueSize,
|
|
466
|
-
valueFormat: paramInfo.format,
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
else if ("valueSize" in options) {
|
|
470
|
-
// Variant 2: Normal parameter, not defined in a config file
|
|
471
|
-
return (0, safe_3.pick)(options, [
|
|
472
|
-
"parameter",
|
|
473
|
-
"value",
|
|
474
|
-
"valueSize",
|
|
475
|
-
"valueFormat",
|
|
476
|
-
]);
|
|
477
|
-
}
|
|
478
|
-
else {
|
|
479
|
-
// Variant 1: Normal parameter, defined in a config file
|
|
480
|
-
const ccc = createConfigurationCCInstance(endpoint);
|
|
481
|
-
const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);
|
|
482
|
-
if (!paramInfo.isFromConfig) {
|
|
483
|
-
throw new safe_1.ZWaveError("Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
484
|
-
}
|
|
485
|
-
return {
|
|
486
|
-
parameter: options.parameter,
|
|
487
|
-
value: options.value,
|
|
488
|
-
valueSize: paramInfo.valueSize,
|
|
489
|
-
valueFormat: paramInfo.format,
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
function bulkMergePartialParamValues(ctx, endpoint, options) {
|
|
494
|
-
// Merge partial parameters before doing anything else. Therefore, take the non-partials, ...
|
|
495
|
-
const allParams = options.filter((o) => o.bitMask == undefined);
|
|
496
|
-
// ... group the partials by parameter
|
|
497
|
-
const unmergedPartials = new Map();
|
|
498
|
-
for (const partial of options.filter((o) => o.bitMask != undefined)) {
|
|
499
|
-
if (!unmergedPartials.has(partial.parameter)) {
|
|
500
|
-
unmergedPartials.set(partial.parameter, []);
|
|
501
|
-
}
|
|
502
|
-
unmergedPartials.get(partial.parameter).push(partial);
|
|
503
|
-
}
|
|
504
|
-
// and push the merged result into the array we'll be working with
|
|
505
|
-
if (unmergedPartials.size) {
|
|
506
|
-
const ccc = createConfigurationCCInstance(endpoint);
|
|
507
|
-
for (const [parameter, partials] of unmergedPartials) {
|
|
508
|
-
allParams.push({
|
|
509
|
-
parameter,
|
|
510
|
-
value: ccc.composePartialParamValues(ctx, parameter, partials.map((p) => ({
|
|
511
|
-
bitMask: p.bitMask,
|
|
512
|
-
partialValue: p.value,
|
|
513
|
-
}))),
|
|
514
|
-
valueSize: partials[0].valueSize,
|
|
515
|
-
valueFormat: partials[0].valueFormat,
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return allParams;
|
|
520
|
-
}
|
|
521
|
-
/** Determines whether a partial parameter needs to be interpreted as signed */
|
|
522
|
-
function isSignedPartial(bitMask, format) {
|
|
523
|
-
// Only treat partial params as signed if they span more than 1 bit.
|
|
524
|
-
// Otherwise we cannot model 0/1 properly.
|
|
525
|
-
return ((0, safe_1.getBitMaskWidth)(bitMask) > 1
|
|
526
|
-
&& (format ?? safe_1.ConfigValueFormat.SignedInteger)
|
|
527
|
-
=== safe_1.ConfigValueFormat.SignedInteger);
|
|
528
|
-
}
|
|
529
|
-
function reInterpretSignedValue(value, valueSize, targetFormat) {
|
|
530
|
-
// Re-interpret the value with the new format
|
|
531
|
-
const raw = new safe_2.Bytes(valueSize);
|
|
532
|
-
serializeValue(raw, 0, valueSize, safe_1.ConfigValueFormat.SignedInteger, value);
|
|
533
|
-
return parseValue(raw, valueSize, targetFormat);
|
|
534
|
-
}
|
|
535
|
-
function getParamInformationFromConfigFile(ctx, nodeId, endpointIndex) {
|
|
536
|
-
const deviceConfig = ctx.getDeviceConfig?.(nodeId);
|
|
537
|
-
if (endpointIndex === 0) {
|
|
538
|
-
return (deviceConfig?.paramInformation
|
|
539
|
-
?? deviceConfig?.endpoints?.get(0)?.paramInformation);
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
546
|
-
supportsCommand(cmd) {
|
|
547
|
-
switch (cmd) {
|
|
548
|
-
case _Types_1.ConfigurationCommand.Get:
|
|
549
|
-
case _Types_1.ConfigurationCommand.Set:
|
|
550
|
-
return true; // This is mandatory
|
|
551
|
-
case _Types_1.ConfigurationCommand.BulkGet:
|
|
552
|
-
case _Types_1.ConfigurationCommand.BulkSet:
|
|
553
|
-
return this.version >= 2;
|
|
554
|
-
case _Types_1.ConfigurationCommand.NameGet:
|
|
555
|
-
case _Types_1.ConfigurationCommand.InfoGet:
|
|
556
|
-
case _Types_1.ConfigurationCommand.PropertiesGet:
|
|
557
|
-
return this.version >= 3;
|
|
558
|
-
case _Types_1.ConfigurationCommand.DefaultReset:
|
|
559
|
-
return this.version >= 4;
|
|
560
|
-
}
|
|
561
|
-
return super.supportsCommand(cmd);
|
|
562
|
-
}
|
|
563
|
-
get [API_1.SET_VALUE]() {
|
|
564
|
-
return async function ({ property, propertyKey }, value) {
|
|
565
|
-
// Config parameters are addressed with numeric properties/keys
|
|
566
|
-
if (typeof property !== "number") {
|
|
567
|
-
(0, API_1.throwUnsupportedProperty)(this.ccId, property);
|
|
568
|
-
}
|
|
569
|
-
if (propertyKey != undefined && typeof propertyKey !== "number") {
|
|
570
|
-
(0, API_1.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
571
|
-
}
|
|
572
|
-
if (typeof value !== "number") {
|
|
573
|
-
(0, API_1.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
574
|
-
}
|
|
575
|
-
let ccInstance;
|
|
576
|
-
const applHost = this.host;
|
|
577
|
-
if (this.isSinglecast()) {
|
|
578
|
-
ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
579
|
-
}
|
|
580
|
-
else if (this.isMulticast()) {
|
|
581
|
-
// Multicast is only possible if the parameter definition is the same on all target nodes
|
|
582
|
-
const nodes = this.endpoint.node.physicalNodes;
|
|
583
|
-
if (!nodes.every((node) => node
|
|
584
|
-
.getEndpoint(this.endpoint.index)
|
|
585
|
-
?.supportsCC(safe_1.CommandClasses.Configuration))) {
|
|
586
|
-
throw new safe_1.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, safe_1.ZWaveErrorCodes.CC_Invalid);
|
|
587
|
-
}
|
|
588
|
-
// Figure out if all the relevant info is the same
|
|
589
|
-
const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)).getParamInformation(this.host, property, propertyKey));
|
|
590
|
-
if (!paramInfos.length
|
|
591
|
-
|| !paramInfos.every((info, index) => {
|
|
592
|
-
if (index === 0)
|
|
593
|
-
return true;
|
|
594
|
-
return (info.valueSize === paramInfos[0].valueSize
|
|
595
|
-
&& info.format === paramInfos[0].format);
|
|
596
|
-
})) {
|
|
597
|
-
throw new safe_1.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, safe_1.ZWaveErrorCodes.CC_Invalid);
|
|
598
|
-
}
|
|
599
|
-
// If it is, just use the first node to create the CC instance
|
|
600
|
-
ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
throw new safe_1.ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, safe_1.ZWaveErrorCodes.CC_NotSupported);
|
|
604
|
-
}
|
|
605
|
-
let { valueSize, format: valueFormat = safe_1.ConfigValueFormat.SignedInteger, } = ccInstance.getParamInformation(applHost, property);
|
|
606
|
-
let targetValue;
|
|
607
|
-
if (propertyKey) {
|
|
608
|
-
// This is a partial value, we need to update some bits only
|
|
609
|
-
// Find out the correct value size
|
|
610
|
-
if (!valueSize) {
|
|
611
|
-
valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;
|
|
612
|
-
}
|
|
613
|
-
// Add the target value to the remaining partial values
|
|
614
|
-
targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);
|
|
615
|
-
// Partial parameters are internally converted to unsigned values - update the valueFormat accordingly
|
|
616
|
-
valueFormat = safe_1.ConfigValueFormat.UnsignedInteger;
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
targetValue = value;
|
|
620
|
-
}
|
|
621
|
-
if (!valueSize) {
|
|
622
|
-
// If there's no value size configured, figure out a matching value size
|
|
623
|
-
valueSize = (0, safe_1.getMinIntegerSize)(targetValue, valueFormat === safe_1.ConfigValueFormat.SignedInteger);
|
|
624
|
-
// Throw if the value is too large or too small
|
|
625
|
-
if (!valueSize) {
|
|
626
|
-
throw new safe_1.ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
// Make sure that the given value fits into the value size
|
|
630
|
-
if (!isSafeValue(targetValue, valueSize, valueFormat)) {
|
|
631
|
-
// If there is a value size configured, check that the given value is compatible
|
|
632
|
-
throwInvalidValueError(targetValue, property, valueSize, valueFormat);
|
|
633
|
-
}
|
|
634
|
-
const result = await this.set({
|
|
635
|
-
parameter: property,
|
|
636
|
-
value: targetValue,
|
|
637
|
-
valueSize: valueSize,
|
|
638
|
-
valueFormat,
|
|
639
|
-
});
|
|
640
|
-
if (!(0, safe_1.supervisedCommandSucceeded)(result)
|
|
641
|
-
&& this.isSinglecast()) {
|
|
642
|
-
// Verify the current value after a delay, unless the command was supervised and successful
|
|
643
|
-
this.schedulePoll({ property, propertyKey }, targetValue,
|
|
644
|
-
// Configuration changes are instant
|
|
645
|
-
{ transition: "fast" });
|
|
646
|
-
}
|
|
647
|
-
return result;
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
get [API_1.POLL_VALUE]() {
|
|
651
|
-
return async function ({ property, propertyKey }) {
|
|
652
|
-
// Config parameters are addressed with numeric properties/keys
|
|
653
|
-
if (typeof property !== "number") {
|
|
654
|
-
(0, API_1.throwUnsupportedProperty)(this.ccId, property);
|
|
655
|
-
}
|
|
656
|
-
if (propertyKey != undefined && typeof propertyKey !== "number") {
|
|
657
|
-
(0, API_1.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
658
|
-
}
|
|
659
|
-
return this.get(property, { valueBitMask: propertyKey });
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Requests the current value of a given config parameter from the device.
|
|
664
|
-
* This may timeout and return `undefined` if the node does not respond.
|
|
665
|
-
* If the node replied with a different parameter number, a `ConfigurationCCError`
|
|
666
|
-
* is thrown with the `argument` property set to the reported parameter number.
|
|
667
|
-
*/
|
|
668
|
-
async get(parameter, options) {
|
|
669
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
670
|
-
__assertType("options", undefined, __assertType__optional__0.bind(void 0, options));
|
|
671
|
-
// Get-type commands are only possible in singlecast
|
|
672
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
673
|
-
// Two-byte parameter numbers can only be read using the BulkGet command
|
|
674
|
-
if (parameter > 255) {
|
|
675
|
-
const result = await this.getBulk([
|
|
676
|
-
{
|
|
677
|
-
parameter,
|
|
678
|
-
bitMask: options?.valueBitMask,
|
|
679
|
-
},
|
|
680
|
-
]);
|
|
681
|
-
return result.find((r) => r.parameter === parameter)?.value;
|
|
682
|
-
}
|
|
683
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Get);
|
|
684
|
-
const { valueBitMask, allowUnexpectedResponse } = options ?? {};
|
|
685
|
-
const cc = new ConfigurationCCGet({
|
|
686
|
-
nodeId: this.endpoint.nodeId,
|
|
687
|
-
endpointIndex: this.endpoint.index,
|
|
688
|
-
parameter,
|
|
689
|
-
allowUnexpectedResponse,
|
|
690
|
-
});
|
|
691
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
692
|
-
if (!response)
|
|
693
|
-
return;
|
|
694
|
-
// Nodes may respond with a different parameter, e.g. if we
|
|
695
|
-
// requested a non-existing one
|
|
696
|
-
if (response.parameter === parameter) {
|
|
697
|
-
if (!valueBitMask)
|
|
698
|
-
return response.value;
|
|
699
|
-
// If a partial parameter was requested, extract that value
|
|
700
|
-
const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);
|
|
701
|
-
return (0, safe_1.parsePartial)(response.value, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));
|
|
702
|
-
}
|
|
703
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
704
|
-
endpoint: this.endpoint.index,
|
|
705
|
-
message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,
|
|
706
|
-
direction: "inbound",
|
|
707
|
-
level: "error",
|
|
708
|
-
});
|
|
709
|
-
throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, safe_1.ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);
|
|
710
|
-
}
|
|
711
|
-
/**
|
|
712
|
-
* Requests the current value of the config parameters from the device.
|
|
713
|
-
* When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.
|
|
714
|
-
*/
|
|
715
|
-
async getBulk(options) {
|
|
716
|
-
__assertType("options", undefined, __assertType__sa__2_ea_2.bind(void 0, options));
|
|
717
|
-
// Get-type commands are only possible in singlecast
|
|
718
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
719
|
-
let values;
|
|
720
|
-
// If the parameters are consecutive, we may use BulkGet
|
|
721
|
-
const distinctParameters = (0, arrays_1.distinct)(options.map((o) => o.parameter));
|
|
722
|
-
if (this.supportsCommand(_Types_1.ConfigurationCommand.BulkGet)
|
|
723
|
-
&& (0, safe_1.isConsecutiveArray)(distinctParameters)) {
|
|
724
|
-
const cc = new ConfigurationCCBulkGet({
|
|
725
|
-
nodeId: this.endpoint.nodeId,
|
|
726
|
-
endpointIndex: this.endpoint.index,
|
|
727
|
-
parameters: distinctParameters,
|
|
728
|
-
});
|
|
729
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
730
|
-
if (response)
|
|
731
|
-
values = response.values;
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Get);
|
|
735
|
-
const _values = new Map();
|
|
736
|
-
for (const parameter of distinctParameters) {
|
|
737
|
-
const cc = new ConfigurationCCGet({
|
|
738
|
-
nodeId: this.endpoint.nodeId,
|
|
739
|
-
endpointIndex: this.endpoint.index,
|
|
740
|
-
parameter,
|
|
741
|
-
});
|
|
742
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
743
|
-
if (response) {
|
|
744
|
-
_values.set(response.parameter, response.value);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
values = _values;
|
|
748
|
-
}
|
|
749
|
-
// Combine the returned values with the requested ones
|
|
750
|
-
const cc = createConfigurationCCInstance(this.endpoint);
|
|
751
|
-
return options.map((o) => {
|
|
752
|
-
let value = values?.get(o.parameter);
|
|
753
|
-
if (typeof value === "number" && o.bitMask) {
|
|
754
|
-
const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);
|
|
755
|
-
value = (0, safe_1.parsePartial)(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));
|
|
756
|
-
}
|
|
757
|
-
return { ...o, value };
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Sets a new value for a given config parameter of the device.
|
|
762
|
-
*/
|
|
763
|
-
async set(options) {
|
|
764
|
-
__assertType("options", "ConfigurationCCAPISetOptions", __assertType__ConfigurationCCAPISetOptions.bind(void 0, options));
|
|
765
|
-
// Two-byte parameter numbers can only be set using the BulkSet command
|
|
766
|
-
if (options.parameter > 255) {
|
|
767
|
-
return this.setBulk([options]);
|
|
768
|
-
}
|
|
769
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
770
|
-
const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);
|
|
771
|
-
let value = normalized.value;
|
|
772
|
-
if (normalized.bitMask) {
|
|
773
|
-
const ccc = createConfigurationCCInstance(this.endpoint);
|
|
774
|
-
value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);
|
|
775
|
-
}
|
|
776
|
-
const cc = new ConfigurationCCSet({
|
|
777
|
-
nodeId: this.endpoint.nodeId,
|
|
778
|
-
endpointIndex: this.endpoint.index,
|
|
779
|
-
resetToDefault: false,
|
|
780
|
-
parameter: normalized.parameter,
|
|
781
|
-
value,
|
|
782
|
-
valueSize: normalized.valueSize,
|
|
783
|
-
valueFormat: normalized.valueFormat,
|
|
784
|
-
});
|
|
785
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.
|
|
789
|
-
*/
|
|
790
|
-
async setBulk(values) {
|
|
791
|
-
__assertType("values", undefined, __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2.bind(void 0, values));
|
|
792
|
-
// Normalize the values so we can better work with them
|
|
793
|
-
const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));
|
|
794
|
-
// And merge multiple partials that belong the same "full" value
|
|
795
|
-
const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);
|
|
796
|
-
const canUseBulkSet = this.supportsCommand(_Types_1.ConfigurationCommand.BulkSet)
|
|
797
|
-
// For Bulk Set we need consecutive parameters
|
|
798
|
-
&& (0, safe_1.isConsecutiveArray)(allParams.map((v) => v.parameter))
|
|
799
|
-
// and identical format
|
|
800
|
-
&& new Set(allParams.map((v) => v.valueFormat)).size === 1
|
|
801
|
-
// and identical size
|
|
802
|
-
&& new Set(allParams.map((v) => v.valueSize)).size === 1;
|
|
803
|
-
if (canUseBulkSet) {
|
|
804
|
-
const cc = new ConfigurationCCBulkSet({
|
|
805
|
-
nodeId: this.endpoint.nodeId,
|
|
806
|
-
endpointIndex: this.endpoint.index,
|
|
807
|
-
parameters: allParams.map((v) => v.parameter),
|
|
808
|
-
valueSize: allParams[0].valueSize,
|
|
809
|
-
valueFormat: allParams[0].valueFormat,
|
|
810
|
-
values: allParams.map((v) => v.value),
|
|
811
|
-
handshake: true,
|
|
812
|
-
});
|
|
813
|
-
// The handshake flag is set, so we expect a BulkReport in response
|
|
814
|
-
const result = await this.host.sendCommand(cc, this.commandOptions);
|
|
815
|
-
// If we did receive a response, we also received the updated parameters,
|
|
816
|
-
// so if any one was not accepted, we know by looking at the values.
|
|
817
|
-
// Translate the result into a SupervisionResult by comparing the values
|
|
818
|
-
if (result) {
|
|
819
|
-
const sentValues = cc.values;
|
|
820
|
-
const receivedValues = [...result.values.values()];
|
|
821
|
-
const success = sentValues.length === receivedValues.length
|
|
822
|
-
&& sentValues.every((v, i) => v === receivedValues[i]);
|
|
823
|
-
return {
|
|
824
|
-
status: success
|
|
825
|
-
? safe_1.SupervisionStatus.Success
|
|
826
|
-
: safe_1.SupervisionStatus.Fail,
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
else {
|
|
830
|
-
return undefined;
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
else {
|
|
834
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
835
|
-
const supervisionResults = [];
|
|
836
|
-
for (const { parameter, value, valueSize, valueFormat, } of allParams) {
|
|
837
|
-
const cc = new ConfigurationCCSet({
|
|
838
|
-
nodeId: this.endpoint.nodeId,
|
|
839
|
-
endpointIndex: this.endpoint.index,
|
|
840
|
-
parameter,
|
|
841
|
-
value,
|
|
842
|
-
valueSize,
|
|
843
|
-
valueFormat,
|
|
844
|
-
});
|
|
845
|
-
supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));
|
|
846
|
-
}
|
|
847
|
-
return (0, safe_1.mergeSupervisionResults)(supervisionResults);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Resets a configuration parameter to its default value.
|
|
852
|
-
*
|
|
853
|
-
* WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
|
|
854
|
-
*/
|
|
855
|
-
async reset(parameter) {
|
|
856
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
857
|
-
// Two-byte parameter numbers can only be reset using the BulkSet command
|
|
858
|
-
if (parameter > 255) {
|
|
859
|
-
return this.resetBulk([parameter]);
|
|
860
|
-
}
|
|
861
|
-
// According to SDS14223 this flag SHOULD NOT be set
|
|
862
|
-
// Because we don't want to test the behavior, we enforce that it MUST not be set
|
|
863
|
-
// on legacy nodes
|
|
864
|
-
if (this.version <= 3) {
|
|
865
|
-
throw new safe_1.ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, safe_1.ZWaveErrorCodes
|
|
866
|
-
.ConfigurationCC_NoResetToDefaultOnLegacyDevices);
|
|
867
|
-
}
|
|
868
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
869
|
-
const cc = new ConfigurationCCSet({
|
|
870
|
-
nodeId: this.endpoint.nodeId,
|
|
871
|
-
endpointIndex: this.endpoint.index,
|
|
872
|
-
parameter,
|
|
873
|
-
resetToDefault: true,
|
|
874
|
-
});
|
|
875
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.
|
|
879
|
-
*
|
|
880
|
-
* WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
|
|
881
|
-
*/
|
|
882
|
-
async resetBulk(parameters) {
|
|
883
|
-
__assertType("parameters", undefined, __assertType__sa__number_ea_2.bind(void 0, parameters));
|
|
884
|
-
if ((0, safe_1.isConsecutiveArray)(parameters)
|
|
885
|
-
&& this.supportsCommand(_Types_1.ConfigurationCommand.BulkSet)) {
|
|
886
|
-
const cc = new ConfigurationCCBulkSet({
|
|
887
|
-
nodeId: this.endpoint.nodeId,
|
|
888
|
-
endpointIndex: this.endpoint.index,
|
|
889
|
-
parameters,
|
|
890
|
-
resetToDefault: true,
|
|
891
|
-
});
|
|
892
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
896
|
-
const CCs = (0, arrays_1.distinct)(parameters).map((parameter) => new ConfigurationCCSet({
|
|
897
|
-
nodeId: this.endpoint.nodeId,
|
|
898
|
-
endpointIndex: this.endpoint.index,
|
|
899
|
-
parameter,
|
|
900
|
-
resetToDefault: true,
|
|
901
|
-
}));
|
|
902
|
-
for (const cc of CCs) {
|
|
903
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
/** Resets all configuration parameters to their default value */
|
|
908
|
-
async resetAll() {
|
|
909
|
-
// This is dangerous - don't allow resetting all parameters via multicast
|
|
910
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
911
|
-
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.DefaultReset);
|
|
912
|
-
const cc = new ConfigurationCCDefaultReset({
|
|
913
|
-
nodeId: this.endpoint.nodeId,
|
|
914
|
-
endpointIndex: this.endpoint.index,
|
|
915
|
-
});
|
|
916
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
917
|
-
}
|
|
918
|
-
async getProperties(parameter) {
|
|
919
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
920
|
-
// Get-type commands are only possible in singlecast
|
|
921
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
922
|
-
const cc = new ConfigurationCCPropertiesGet({
|
|
923
|
-
nodeId: this.endpoint.nodeId,
|
|
924
|
-
endpointIndex: this.endpoint.index,
|
|
925
|
-
parameter,
|
|
926
|
-
});
|
|
927
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
928
|
-
if (response) {
|
|
929
|
-
return (0, safe_3.pick)(response, [
|
|
930
|
-
"valueSize",
|
|
931
|
-
"valueFormat",
|
|
932
|
-
"minValue",
|
|
933
|
-
"maxValue",
|
|
934
|
-
"defaultValue",
|
|
935
|
-
"nextParameter",
|
|
936
|
-
"altersCapabilities",
|
|
937
|
-
"isReadonly",
|
|
938
|
-
"isAdvanced",
|
|
939
|
-
"noBulkSupport",
|
|
940
|
-
]);
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
/** Requests the name of a configuration parameter from the node */
|
|
944
|
-
async getName(parameter) {
|
|
945
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
946
|
-
// Get-type commands are only possible in singlecast
|
|
947
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
948
|
-
const cc = new ConfigurationCCNameGet({
|
|
949
|
-
nodeId: this.endpoint.nodeId,
|
|
950
|
-
endpointIndex: this.endpoint.index,
|
|
951
|
-
parameter,
|
|
952
|
-
});
|
|
953
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
954
|
-
return response?.name;
|
|
955
|
-
}
|
|
956
|
-
/** Requests usage info for a configuration parameter from the node */
|
|
957
|
-
async getInfo(parameter) {
|
|
958
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
959
|
-
// Get-type commands are only possible in singlecast
|
|
960
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
961
|
-
const cc = new ConfigurationCCInfoGet({
|
|
962
|
-
nodeId: this.endpoint.nodeId,
|
|
963
|
-
endpointIndex: this.endpoint.index,
|
|
964
|
-
parameter,
|
|
965
|
-
});
|
|
966
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
967
|
-
return response?.info;
|
|
968
|
-
}
|
|
969
|
-
/**
|
|
970
|
-
* This scans the node for the existing parameters. Found parameters will be reported
|
|
971
|
-
* through the `value added` and `value updated` events.
|
|
972
|
-
*
|
|
973
|
-
* WARNING: This method throws for newer devices.
|
|
974
|
-
*
|
|
975
|
-
* WARNING: On nodes implementing V1 and V2, this process may take
|
|
976
|
-
* **up to an hour**, depending on the configured timeout.
|
|
977
|
-
*
|
|
978
|
-
* WARNING: On nodes implementing V2, all parameters after 255 will be ignored.
|
|
979
|
-
*/
|
|
980
|
-
async scanParametersLegacy() {
|
|
981
|
-
if (this.version >= 3) {
|
|
982
|
-
throw new safe_1.ZWaveError("Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.", safe_1.ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);
|
|
983
|
-
}
|
|
984
|
-
// Get-type commands are only possible in singlecast
|
|
985
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
986
|
-
// TODO: Reduce the priority of the messages
|
|
987
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
988
|
-
endpoint: this.endpoint.index,
|
|
989
|
-
message: `Scanning available parameters...`,
|
|
990
|
-
});
|
|
991
|
-
const ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
992
|
-
for (let param = 1; param <= 255; param++) {
|
|
993
|
-
// Check if the parameter is readable
|
|
994
|
-
let originalValue;
|
|
995
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
996
|
-
endpoint: this.endpoint.index,
|
|
997
|
-
message: ` trying param ${param}...`,
|
|
998
|
-
direction: "outbound",
|
|
999
|
-
});
|
|
1000
|
-
try {
|
|
1001
|
-
originalValue = await this.get(param, {
|
|
1002
|
-
// When requesting a non-existing parameter, a node SHOULD respond with the
|
|
1003
|
-
// first available parameter. We use this for the first param only,
|
|
1004
|
-
// because delayed responses might otherwise confuse the interview process
|
|
1005
|
-
allowUnexpectedResponse: param === 1,
|
|
1006
|
-
});
|
|
1007
|
-
if (originalValue != undefined) {
|
|
1008
|
-
const logMessage = ` Param ${param}:
|
|
1009
|
-
readable = true
|
|
1010
|
-
valueSize = ${ccInstance.getParamInformation(this.host, param)
|
|
1011
|
-
.valueSize}
|
|
1012
|
-
value = ${originalValue.toString()}`;
|
|
1013
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
1014
|
-
endpoint: this.endpoint.index,
|
|
1015
|
-
message: logMessage,
|
|
1016
|
-
direction: "inbound",
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
catch (e) {
|
|
1021
|
-
if (e instanceof ConfigurationCCError
|
|
1022
|
-
&& e.code
|
|
1023
|
-
=== safe_1.ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {
|
|
1024
|
-
// Continue iterating with the next param
|
|
1025
|
-
if (e.argument - 1 > param)
|
|
1026
|
-
param = e.argument - 1;
|
|
1027
|
-
continue;
|
|
1028
|
-
}
|
|
1029
|
-
throw e;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
exports.ConfigurationCCAPI = ConfigurationCCAPI;
|
|
1035
|
-
exports.ConfigurationCCAPI = ConfigurationCCAPI = __decorate([
|
|
1036
|
-
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses.Configuration)
|
|
1037
|
-
], ConfigurationCCAPI);
|
|
1038
|
-
let ConfigurationCC = class ConfigurationCC extends CommandClass_1.CommandClass {
|
|
1039
|
-
async interview(ctx) {
|
|
1040
|
-
const node = this.getNode(ctx);
|
|
1041
|
-
const endpoint = this.getEndpoint(ctx);
|
|
1042
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Configuration, ctx, endpoint).withOptions({
|
|
1043
|
-
priority: safe_1.MessagePriority.NodeQuery,
|
|
1044
|
-
});
|
|
1045
|
-
ctx.logNode(node.id, {
|
|
1046
|
-
endpoint: this.endpointIndex,
|
|
1047
|
-
message: `Interviewing ${this.ccName}...`,
|
|
1048
|
-
direction: "none",
|
|
1049
|
-
});
|
|
1050
|
-
const deviceConfig = ctx.getDeviceConfig?.(node.id);
|
|
1051
|
-
const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
|
|
1052
|
-
if (paramInfo) {
|
|
1053
|
-
ctx.logNode(node.id, {
|
|
1054
|
-
endpoint: this.endpointIndex,
|
|
1055
|
-
message: `${this.constructor.name}: Loading configuration parameters from device config`,
|
|
1056
|
-
direction: "none",
|
|
1057
|
-
});
|
|
1058
|
-
this.deserializeParamInformationFromConfig(ctx, paramInfo);
|
|
1059
|
-
}
|
|
1060
|
-
const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));
|
|
1061
|
-
if (api.version >= 3) {
|
|
1062
|
-
ctx.logNode(node.id, {
|
|
1063
|
-
endpoint: this.endpointIndex,
|
|
1064
|
-
message: "finding first configuration parameter...",
|
|
1065
|
-
direction: "outbound",
|
|
1066
|
-
});
|
|
1067
|
-
const param0props = await api.getProperties(0);
|
|
1068
|
-
let param;
|
|
1069
|
-
if (param0props) {
|
|
1070
|
-
param = param0props.nextParameter;
|
|
1071
|
-
if (param === 0) {
|
|
1072
|
-
ctx.logNode(node.id, {
|
|
1073
|
-
endpoint: this.endpointIndex,
|
|
1074
|
-
message: `didn't report any config params, trying #1 just to be sure...`,
|
|
1075
|
-
direction: "inbound",
|
|
1076
|
-
});
|
|
1077
|
-
param = 1;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
else {
|
|
1081
|
-
ctx.logNode(node.id, {
|
|
1082
|
-
endpoint: this.endpointIndex,
|
|
1083
|
-
message: "Finding first configuration parameter timed out, skipping interview...",
|
|
1084
|
-
level: "warn",
|
|
1085
|
-
});
|
|
1086
|
-
return;
|
|
1087
|
-
}
|
|
1088
|
-
while (param > 0) {
|
|
1089
|
-
ctx.logNode(node.id, {
|
|
1090
|
-
endpoint: this.endpointIndex,
|
|
1091
|
-
message: `querying parameter #${param} information...`,
|
|
1092
|
-
direction: "outbound",
|
|
1093
|
-
});
|
|
1094
|
-
// Query properties and the next param
|
|
1095
|
-
const props = await api.getProperties(param).catch(
|
|
1096
|
-
// If querying the properties fails, don't abort the entire interview
|
|
1097
|
-
() => undefined);
|
|
1098
|
-
if (!props) {
|
|
1099
|
-
ctx.logNode(node.id, {
|
|
1100
|
-
endpoint: this.endpointIndex,
|
|
1101
|
-
message: `Querying parameter #${param} information timed out, skipping scan...`,
|
|
1102
|
-
level: "warn",
|
|
1103
|
-
});
|
|
1104
|
-
break;
|
|
1105
|
-
}
|
|
1106
|
-
const { nextParameter, ...properties } = props;
|
|
1107
|
-
let logMessage;
|
|
1108
|
-
if (properties.valueSize === 0) {
|
|
1109
|
-
logMessage =
|
|
1110
|
-
`Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;
|
|
1111
|
-
}
|
|
1112
|
-
else {
|
|
1113
|
-
let name;
|
|
1114
|
-
// Query the name and info for parameters that are NOT defined in a config file
|
|
1115
|
-
if (!documentedParamNumbers.has(param)) {
|
|
1116
|
-
// Skip the name query for bugged devices
|
|
1117
|
-
if (!deviceConfig?.compat?.skipConfigurationNameQuery) {
|
|
1118
|
-
name = await api.getName(param).catch(
|
|
1119
|
-
// If querying the name fails, don't abort the entire interview
|
|
1120
|
-
() => undefined);
|
|
1121
|
-
}
|
|
1122
|
-
// Skip the info query for bugged devices
|
|
1123
|
-
if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {
|
|
1124
|
-
await api.getInfo(param).catch(
|
|
1125
|
-
// If querying the info fails, don't abort the entire interview
|
|
1126
|
-
() => undefined);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
logMessage =
|
|
1130
|
-
`received information for parameter #${param}:`;
|
|
1131
|
-
if (name) {
|
|
1132
|
-
logMessage += `
|
|
1133
|
-
parameter name: ${name}`;
|
|
1134
|
-
}
|
|
1135
|
-
logMessage += `
|
|
1136
|
-
value format: ${(0, safe_3.getEnumMemberName)(safe_1.ConfigValueFormat, properties.valueFormat)}
|
|
1137
|
-
value size: ${properties.valueSize} bytes
|
|
1138
|
-
min value: ${properties.minValue?.toString() ?? "undefined"}
|
|
1139
|
-
max value: ${properties.maxValue?.toString() ?? "undefined"}
|
|
1140
|
-
default value: ${properties.defaultValue?.toString() ?? "undefined"}
|
|
1141
|
-
is read-only: ${!!properties.isReadonly}
|
|
1142
|
-
is advanced (UI): ${!!properties.isAdvanced}
|
|
1143
|
-
has bulk support: ${!properties.noBulkSupport}
|
|
1144
|
-
alters capabilities: ${!!properties.altersCapabilities}`;
|
|
1145
|
-
}
|
|
1146
|
-
ctx.logNode(node.id, {
|
|
1147
|
-
endpoint: this.endpointIndex,
|
|
1148
|
-
message: logMessage,
|
|
1149
|
-
direction: "inbound",
|
|
1150
|
-
});
|
|
1151
|
-
// Some devices report their parameter 1 instead of 0 as the next one
|
|
1152
|
-
// when reaching the end. To avoid infinite loops, stop scanning
|
|
1153
|
-
// once the next parameter is lower than the current one
|
|
1154
|
-
if (nextParameter > param) {
|
|
1155
|
-
param = nextParameter;
|
|
1156
|
-
}
|
|
1157
|
-
else {
|
|
1158
|
-
break;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
await this.refreshValues(ctx);
|
|
1163
|
-
// Remember that the interview is complete
|
|
1164
|
-
this.setInterviewComplete(ctx, true);
|
|
1165
|
-
}
|
|
1166
|
-
async refreshValues(ctx) {
|
|
1167
|
-
const node = this.getNode(ctx);
|
|
1168
|
-
const endpoint = this.getEndpoint(ctx);
|
|
1169
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Configuration, ctx, endpoint).withOptions({
|
|
1170
|
-
priority: safe_1.MessagePriority.NodeQuery,
|
|
1171
|
-
});
|
|
1172
|
-
if (api.version < 3) {
|
|
1173
|
-
// V1/V2: Query all values defined in the config file
|
|
1174
|
-
const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
|
|
1175
|
-
if (paramInfo?.size) {
|
|
1176
|
-
// Because partial params share the same parameter number,
|
|
1177
|
-
// we need to remember which ones we have already queried.
|
|
1178
|
-
const alreadyQueried = new Set();
|
|
1179
|
-
for (const param of paramInfo.keys()) {
|
|
1180
|
-
// No need to query writeonly params
|
|
1181
|
-
if (paramInfo.get(param)?.writeOnly)
|
|
1182
|
-
continue;
|
|
1183
|
-
// Don't double-query params
|
|
1184
|
-
if (alreadyQueried.has(param.parameter))
|
|
1185
|
-
continue;
|
|
1186
|
-
alreadyQueried.add(param.parameter);
|
|
1187
|
-
// Query the current value
|
|
1188
|
-
ctx.logNode(node.id, {
|
|
1189
|
-
endpoint: this.endpointIndex,
|
|
1190
|
-
message: `querying parameter #${param.parameter} value...`,
|
|
1191
|
-
direction: "outbound",
|
|
1192
|
-
});
|
|
1193
|
-
// ... at least try to
|
|
1194
|
-
const paramValue = await api.get(param.parameter);
|
|
1195
|
-
if (typeof paramValue === "number") {
|
|
1196
|
-
ctx.logNode(node.id, {
|
|
1197
|
-
endpoint: this.endpointIndex,
|
|
1198
|
-
message: `parameter #${param.parameter} has value: ${paramValue}`,
|
|
1199
|
-
direction: "inbound",
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
else if (!paramValue) {
|
|
1203
|
-
ctx.logNode(node.id, {
|
|
1204
|
-
endpoint: this.endpointIndex,
|
|
1205
|
-
message: `received no value for parameter #${param.parameter}`,
|
|
1206
|
-
direction: "inbound",
|
|
1207
|
-
level: "warn",
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
else {
|
|
1213
|
-
ctx.logNode(node.id, {
|
|
1214
|
-
endpoint: this.endpointIndex,
|
|
1215
|
-
message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,
|
|
1216
|
-
direction: "none",
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
else {
|
|
1221
|
-
// V3+: Query the values of discovered parameters
|
|
1222
|
-
const parameters = (0, arrays_1.distinct)(this.getDefinedValueIDs(ctx)
|
|
1223
|
-
.map((v) => v.property)
|
|
1224
|
-
.filter((p) => typeof p === "number"));
|
|
1225
|
-
for (const param of parameters) {
|
|
1226
|
-
if (this.getParamInformation(ctx, param).readable !== false) {
|
|
1227
|
-
ctx.logNode(node.id, {
|
|
1228
|
-
endpoint: this.endpointIndex,
|
|
1229
|
-
message: `querying parameter #${param} value...`,
|
|
1230
|
-
direction: "outbound",
|
|
1231
|
-
});
|
|
1232
|
-
await api.get(param);
|
|
1233
|
-
}
|
|
1234
|
-
else {
|
|
1235
|
-
ctx.logNode(node.id, {
|
|
1236
|
-
endpoint: this.endpointIndex,
|
|
1237
|
-
message: `not querying parameter #${param} value, because it is writeonly`,
|
|
1238
|
-
direction: "none",
|
|
1239
|
-
});
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
/**
|
|
1245
|
-
* Whether this node's param information was loaded from a config file.
|
|
1246
|
-
* If this is true, we don't trust what the node reports
|
|
1247
|
-
*/
|
|
1248
|
-
paramExistsInConfigFile(ctx, parameter, valueBitMask) {
|
|
1249
|
-
if (this.getValue(ctx, exports.ConfigurationCCValues.isParamInformationFromConfig) !== true) {
|
|
1250
|
-
return false;
|
|
1251
|
-
}
|
|
1252
|
-
const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId, this.endpointIndex);
|
|
1253
|
-
if (!paramInformation)
|
|
1254
|
-
return false;
|
|
1255
|
-
// Check if the param is defined in the config file, either as a normal param or a partial
|
|
1256
|
-
if (paramInformation.has({ parameter, valueBitMask })) {
|
|
1257
|
-
return true;
|
|
1258
|
-
}
|
|
1259
|
-
else if (valueBitMask == undefined) {
|
|
1260
|
-
// Also consider partials when looking for plain params
|
|
1261
|
-
for (const key of paramInformation.keys()) {
|
|
1262
|
-
if (key.parameter === parameter)
|
|
1263
|
-
return true;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
return false;
|
|
1267
|
-
}
|
|
1268
|
-
/**
|
|
1269
|
-
* @internal
|
|
1270
|
-
* Stores config parameter metadata for this CC's node
|
|
1271
|
-
*/
|
|
1272
|
-
extendParamInformation(ctx, parameter, valueBitMask, info) {
|
|
1273
|
-
// Don't trust param information that a node reports if we have already loaded it from a config file
|
|
1274
|
-
if (valueBitMask === undefined
|
|
1275
|
-
&& this.paramExistsInConfigFile(ctx, parameter)) {
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
// Retrieve the base metadata
|
|
1279
|
-
const metadata = this.getParamInformation(ctx, parameter, valueBitMask);
|
|
1280
|
-
// Override it with new data
|
|
1281
|
-
Object.assign(metadata, info);
|
|
1282
|
-
// And store it back
|
|
1283
|
-
this.setMetadata(ctx, exports.ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* @internal
|
|
1287
|
-
* Returns stored config parameter metadata for this CC's node
|
|
1288
|
-
*/
|
|
1289
|
-
getParamInformation(ctx, parameter, valueBitMask) {
|
|
1290
|
-
return (this.getMetadata(ctx, exports.ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {
|
|
1291
|
-
...safe_1.ValueMetadata.Any,
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node
|
|
1296
|
-
* and does not include partial parameters.
|
|
1297
|
-
*/
|
|
1298
|
-
getQueriedParamInfos(ctx) {
|
|
1299
|
-
const parameters = (0, arrays_1.distinct)(this.getDefinedValueIDs(ctx)
|
|
1300
|
-
.map((v) => v.property)
|
|
1301
|
-
.filter((p) => typeof p === "number"));
|
|
1302
|
-
return (0, objects_1.composeObject)(parameters.map((p) => [
|
|
1303
|
-
p,
|
|
1304
|
-
this.getParamInformation(ctx, p),
|
|
1305
|
-
]));
|
|
1306
|
-
}
|
|
1307
|
-
/**
|
|
1308
|
-
* Returns stored config parameter metadata for all partial config params addressed with the given parameter number
|
|
1309
|
-
*/
|
|
1310
|
-
getPartialParamInfos(ctx, parameter) {
|
|
1311
|
-
const valueDB = this.getValueDB(ctx);
|
|
1312
|
-
return valueDB.findMetadata((id) => id.commandClass === this.ccId
|
|
1313
|
-
&& (id.endpoint ?? 0) === this.endpointIndex
|
|
1314
|
-
&& id.property === parameter
|
|
1315
|
-
&& id.propertyKey != undefined);
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Computes the full value of a parameter after applying a partial param value
|
|
1319
|
-
*/
|
|
1320
|
-
composePartialParamValue(ctx, parameter, bitMask, partialValue) {
|
|
1321
|
-
return this.composePartialParamValues(ctx, parameter, [
|
|
1322
|
-
{ bitMask, partialValue },
|
|
1323
|
-
]);
|
|
1324
|
-
}
|
|
1325
|
-
/**
|
|
1326
|
-
* Computes the full value of a parameter after applying multiple partial param values
|
|
1327
|
-
*/
|
|
1328
|
-
composePartialParamValues(ctx, parameter, partials) {
|
|
1329
|
-
const valueDB = this.getValueDB(ctx);
|
|
1330
|
-
// Add the other values together
|
|
1331
|
-
const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId
|
|
1332
|
-
&& (id.endpoint ?? 0) === this.endpointIndex
|
|
1333
|
-
&& id.property === parameter
|
|
1334
|
-
&& id.propertyKey != undefined
|
|
1335
|
-
&& !partials.some((p) => id.propertyKey === p.bitMask));
|
|
1336
|
-
let ret = 0;
|
|
1337
|
-
for (const { propertyKey: bitMask, value: partialValue, } of otherValues) {
|
|
1338
|
-
ret = (0, safe_1.encodePartial)(ret, partialValue, bitMask);
|
|
1339
|
-
}
|
|
1340
|
-
for (const { bitMask, partialValue } of partials) {
|
|
1341
|
-
ret = (0, safe_1.encodePartial)(ret, partialValue, bitMask);
|
|
1342
|
-
}
|
|
1343
|
-
return ret;
|
|
1344
|
-
}
|
|
1345
|
-
/** Deserializes the config parameter info from a config file */
|
|
1346
|
-
deserializeParamInformationFromConfig(ctx, config) {
|
|
1347
|
-
const valueDB = this.getValueDB(ctx);
|
|
1348
|
-
// Clear old param information
|
|
1349
|
-
for (const meta of valueDB.getAllMetadata(this.ccId)) {
|
|
1350
|
-
if (typeof meta.property === "number"
|
|
1351
|
-
&& (meta.endpoint ?? 0) === this.endpointIndex) {
|
|
1352
|
-
// this is a param information, delete it
|
|
1353
|
-
valueDB.setMetadata(meta, undefined,
|
|
1354
|
-
// Don't emit the added/updated events, as this will spam applications with untranslated events
|
|
1355
|
-
{ noEvent: true });
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
// Allow overwriting the param info (mark it as unloaded)
|
|
1359
|
-
this.setValue(ctx, exports.ConfigurationCCValues.isParamInformationFromConfig, false);
|
|
1360
|
-
for (const [param, info] of config.entries()) {
|
|
1361
|
-
// We need to make the config information compatible with the
|
|
1362
|
-
// format that ConfigurationCC reports
|
|
1363
|
-
const paramInfo = (0, safe_1.stripUndefined)({
|
|
1364
|
-
// TODO: Make this smarter! (0...1 ==> boolean)
|
|
1365
|
-
type: "number",
|
|
1366
|
-
valueSize: info.valueSize,
|
|
1367
|
-
min: info.minValue,
|
|
1368
|
-
max: info.maxValue,
|
|
1369
|
-
default: info.defaultValue,
|
|
1370
|
-
unit: info.unit,
|
|
1371
|
-
format: info.unsigned
|
|
1372
|
-
? safe_1.ConfigValueFormat.UnsignedInteger
|
|
1373
|
-
: safe_1.ConfigValueFormat.SignedInteger,
|
|
1374
|
-
readable: !info.writeOnly,
|
|
1375
|
-
writeable: !info.readOnly,
|
|
1376
|
-
allowManualEntry: info.allowManualEntry,
|
|
1377
|
-
states: info.options.length > 0
|
|
1378
|
-
? (0, objects_1.composeObject)(info.options.map(({ label, value }) => [
|
|
1379
|
-
value.toString(),
|
|
1380
|
-
label,
|
|
1381
|
-
]))
|
|
1382
|
-
: undefined,
|
|
1383
|
-
label: info.label,
|
|
1384
|
-
description: info.description,
|
|
1385
|
-
isFromConfig: true,
|
|
1386
|
-
});
|
|
1387
|
-
this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);
|
|
1388
|
-
}
|
|
1389
|
-
// Remember that we loaded the param information from a config file
|
|
1390
|
-
this.setValue(ctx, exports.ConfigurationCCValues.isParamInformationFromConfig, true);
|
|
1391
|
-
}
|
|
1392
|
-
translatePropertyKey(ctx, property, propertyKey) {
|
|
1393
|
-
if (typeof property === "number"
|
|
1394
|
-
&& (propertyKey == undefined || typeof propertyKey === "number")) {
|
|
1395
|
-
// This CC names all configuration parameters differently,
|
|
1396
|
-
// so no name for the property key is required
|
|
1397
|
-
return undefined;
|
|
1398
|
-
}
|
|
1399
|
-
return super.translateProperty(ctx, property, propertyKey);
|
|
1400
|
-
}
|
|
1401
|
-
translateProperty(ctx, property, propertyKey) {
|
|
1402
|
-
// Try to retrieve the configured param label
|
|
1403
|
-
if (typeof property === "number"
|
|
1404
|
-
&& (propertyKey == undefined || typeof propertyKey === "number")) {
|
|
1405
|
-
const paramInfo = this.getParamInformation(ctx, property, propertyKey);
|
|
1406
|
-
if (paramInfo.label)
|
|
1407
|
-
return paramInfo.label;
|
|
1408
|
-
// fall back to paramXYZ[_key] if none is defined
|
|
1409
|
-
let ret = `param${(0, strings_1.padStart)(property.toString(), 3, "0")}`;
|
|
1410
|
-
if (propertyKey != undefined) {
|
|
1411
|
-
ret += "_" + propertyKey.toString();
|
|
1412
|
-
}
|
|
1413
|
-
return ret;
|
|
1414
|
-
}
|
|
1415
|
-
return super.translateProperty(ctx, property, propertyKey);
|
|
1416
|
-
}
|
|
1417
|
-
};
|
|
1418
|
-
exports.ConfigurationCC = ConfigurationCC;
|
|
1419
|
-
exports.ConfigurationCC = ConfigurationCC = __decorate([
|
|
1420
|
-
(0, CommandClassDecorators_1.commandClass)(safe_1.CommandClasses.Configuration),
|
|
1421
|
-
(0, CommandClassDecorators_1.implementedVersion)(4),
|
|
1422
|
-
(0, CommandClassDecorators_1.ccValues)(exports.ConfigurationCCValues)
|
|
1423
|
-
], ConfigurationCC);
|
|
1424
|
-
let ConfigurationCCReport = ConfigurationCCReport_1 = class ConfigurationCCReport extends ConfigurationCC {
|
|
1425
|
-
constructor(options) {
|
|
1426
|
-
super(options);
|
|
1427
|
-
this.parameter = options.parameter;
|
|
1428
|
-
this.value = options.value;
|
|
1429
|
-
this.valueSize = options.valueSize;
|
|
1430
|
-
this.valueFormat = options.valueFormat;
|
|
1431
|
-
}
|
|
1432
|
-
static from(raw, ctx) {
|
|
1433
|
-
// All fields must be present
|
|
1434
|
-
(0, safe_1.validatePayload)(raw.payload.length > 2);
|
|
1435
|
-
const parameter = raw.payload[0];
|
|
1436
|
-
const valueSize = raw.payload[1] & 0b111;
|
|
1437
|
-
// Ensure we received a valid report
|
|
1438
|
-
(0, safe_1.validatePayload)(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
|
|
1439
|
-
// Default to parsing the value as SignedInteger, like the specs say.
|
|
1440
|
-
// We try to re-interpret the value in persistValues()
|
|
1441
|
-
const value = parseValue(raw.payload.subarray(2), valueSize, safe_1.ConfigValueFormat.SignedInteger);
|
|
1442
|
-
return new ConfigurationCCReport_1({
|
|
1443
|
-
nodeId: ctx.sourceNodeId,
|
|
1444
|
-
parameter,
|
|
1445
|
-
valueSize,
|
|
1446
|
-
value,
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
parameter;
|
|
1450
|
-
value;
|
|
1451
|
-
valueSize;
|
|
1452
|
-
valueFormat; // only used for serialization
|
|
1453
|
-
persistValues(ctx) {
|
|
1454
|
-
if (!super.persistValues(ctx))
|
|
1455
|
-
return false;
|
|
1456
|
-
const ccVersion = (0, CommandClass_1.getEffectiveCCVersion)(ctx, this);
|
|
1457
|
-
// This parameter may be a partial param in the following cases:
|
|
1458
|
-
// * a config file defines it as such
|
|
1459
|
-
// * it was reported by the device as a bit field
|
|
1460
|
-
const partialParams = this.getPartialParamInfos(ctx, this.parameter);
|
|
1461
|
-
let cachedValueFormat;
|
|
1462
|
-
if (partialParams.length > 0) {
|
|
1463
|
-
// This is a partial param. All definitions should have the same format, so we just take the first one
|
|
1464
|
-
cachedValueFormat = partialParams[0].metadata.format;
|
|
1465
|
-
}
|
|
1466
|
-
else {
|
|
1467
|
-
// Check if the initial assumption of SignedInteger holds true
|
|
1468
|
-
const oldParamInformation = this.getParamInformation(ctx, this.parameter);
|
|
1469
|
-
cachedValueFormat = oldParamInformation.format;
|
|
1470
|
-
// On older CC versions, these reports may be the only way we can retrieve the value size
|
|
1471
|
-
// Therefore we store it here
|
|
1472
|
-
this.extendParamInformation(ctx, this.parameter, undefined, {
|
|
1473
|
-
valueSize: this.valueSize,
|
|
1474
|
-
});
|
|
1475
|
-
if (ccVersion < 3
|
|
1476
|
-
&& !this.paramExistsInConfigFile(ctx, this.parameter)
|
|
1477
|
-
&& oldParamInformation.min == undefined
|
|
1478
|
-
&& oldParamInformation.max == undefined) {
|
|
1479
|
-
const isSigned = oldParamInformation.format == undefined
|
|
1480
|
-
|| oldParamInformation.format
|
|
1481
|
-
=== safe_1.ConfigValueFormat.SignedInteger;
|
|
1482
|
-
this.extendParamInformation(ctx, this.parameter, undefined, (0, safe_1.getIntegerLimits)(this.valueSize, isSigned));
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
// We may have to re-interpret the value as unsigned, depending on the cached value format
|
|
1486
|
-
if (cachedValueFormat != undefined
|
|
1487
|
-
&& cachedValueFormat !== safe_1.ConfigValueFormat.SignedInteger) {
|
|
1488
|
-
// Re-interpret the value with the new format
|
|
1489
|
-
this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);
|
|
1490
|
-
}
|
|
1491
|
-
// And store the value itself
|
|
1492
|
-
// If we have partial config params defined, we need to split the value
|
|
1493
|
-
if (partialParams.length > 0) {
|
|
1494
|
-
for (const param of partialParams) {
|
|
1495
|
-
if (typeof param.propertyKey === "number") {
|
|
1496
|
-
this.setValue(ctx, exports.ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), (0, safe_1.parsePartial)(this.value, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
else {
|
|
1501
|
-
// This is a single param
|
|
1502
|
-
this.setValue(ctx, exports.ConfigurationCCValues.paramInformation(this.parameter), this.value);
|
|
1503
|
-
}
|
|
1504
|
-
return true;
|
|
1505
|
-
}
|
|
1506
|
-
serialize(ctx) {
|
|
1507
|
-
this.payload = safe_2.Bytes.concat([
|
|
1508
|
-
safe_2.Bytes.from([this.parameter, this.valueSize & 0b111]),
|
|
1509
|
-
new safe_2.Bytes(this.valueSize),
|
|
1510
|
-
]);
|
|
1511
|
-
serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? safe_1.ConfigValueFormat.SignedInteger, this.value);
|
|
1512
|
-
return super.serialize(ctx);
|
|
1513
|
-
}
|
|
1514
|
-
toLogEntry(ctx) {
|
|
1515
|
-
return {
|
|
1516
|
-
...super.toLogEntry(ctx),
|
|
1517
|
-
message: {
|
|
1518
|
-
"parameter #": this.parameter,
|
|
1519
|
-
"value size": this.valueSize,
|
|
1520
|
-
value: configValueToString(this.value),
|
|
1521
|
-
},
|
|
1522
|
-
};
|
|
1523
|
-
}
|
|
1524
|
-
};
|
|
1525
|
-
exports.ConfigurationCCReport = ConfigurationCCReport;
|
|
1526
|
-
exports.ConfigurationCCReport = ConfigurationCCReport = ConfigurationCCReport_1 = __decorate([
|
|
1527
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.Report)
|
|
1528
|
-
], ConfigurationCCReport);
|
|
1529
|
-
function testResponseForConfigurationGet(sent, received) {
|
|
1530
|
-
// We expect a Configuration Report that matches the requested parameter
|
|
1531
|
-
return (sent.parameter === received.parameter || sent.allowUnexpectedResponse);
|
|
1532
|
-
}
|
|
1533
|
-
let ConfigurationCCGet = ConfigurationCCGet_1 = class ConfigurationCCGet extends ConfigurationCC {
|
|
1534
|
-
constructor(options) {
|
|
1535
|
-
super(options);
|
|
1536
|
-
this.parameter = options.parameter;
|
|
1537
|
-
this.allowUnexpectedResponse = options.allowUnexpectedResponse
|
|
1538
|
-
?? false;
|
|
1539
|
-
}
|
|
1540
|
-
static from(raw, ctx) {
|
|
1541
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
1542
|
-
const parameter = raw.payload[0];
|
|
1543
|
-
return new ConfigurationCCGet_1({
|
|
1544
|
-
nodeId: ctx.sourceNodeId,
|
|
1545
|
-
parameter,
|
|
1546
|
-
});
|
|
1547
|
-
}
|
|
1548
|
-
parameter;
|
|
1549
|
-
allowUnexpectedResponse;
|
|
1550
|
-
serialize(ctx) {
|
|
1551
|
-
this.payload = safe_2.Bytes.from([this.parameter]);
|
|
1552
|
-
return super.serialize(ctx);
|
|
1553
|
-
}
|
|
1554
|
-
toLogEntry(ctx) {
|
|
1555
|
-
return {
|
|
1556
|
-
...super.toLogEntry(ctx),
|
|
1557
|
-
message: { "parameter #": this.parameter },
|
|
1558
|
-
};
|
|
1559
|
-
}
|
|
1560
|
-
};
|
|
1561
|
-
exports.ConfigurationCCGet = ConfigurationCCGet;
|
|
1562
|
-
exports.ConfigurationCCGet = ConfigurationCCGet = ConfigurationCCGet_1 = __decorate([
|
|
1563
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.Get),
|
|
1564
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(ConfigurationCCReport, testResponseForConfigurationGet)
|
|
1565
|
-
], ConfigurationCCGet);
|
|
1566
|
-
let ConfigurationCCSet = ConfigurationCCSet_1 = class ConfigurationCCSet extends ConfigurationCC {
|
|
1567
|
-
constructor(options) {
|
|
1568
|
-
super(options);
|
|
1569
|
-
this.parameter = options.parameter;
|
|
1570
|
-
this.resetToDefault = !!options.resetToDefault;
|
|
1571
|
-
if (!options.resetToDefault) {
|
|
1572
|
-
// TODO: Default to the stored value size
|
|
1573
|
-
this.valueSize = options.valueSize;
|
|
1574
|
-
this.valueFormat = options.valueFormat
|
|
1575
|
-
?? safe_1.ConfigValueFormat.SignedInteger;
|
|
1576
|
-
this.value = options.value;
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
static from(raw, ctx) {
|
|
1580
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
1581
|
-
const parameter = raw.payload[0];
|
|
1582
|
-
const resetToDefault = !!(raw.payload[1] & 0b1000_0000);
|
|
1583
|
-
const valueSize = raw.payload[1] & 0b111;
|
|
1584
|
-
// Ensure we received a valid report
|
|
1585
|
-
(0, safe_1.validatePayload)(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
|
|
1586
|
-
// Parse the value as signed integer. We don't know the format here.
|
|
1587
|
-
const value = parseValue(raw.payload.subarray(2), valueSize, safe_1.ConfigValueFormat.SignedInteger);
|
|
1588
|
-
return new ConfigurationCCSet_1({
|
|
1589
|
-
nodeId: ctx.sourceNodeId,
|
|
1590
|
-
parameter,
|
|
1591
|
-
resetToDefault,
|
|
1592
|
-
valueSize,
|
|
1593
|
-
value,
|
|
1594
|
-
});
|
|
1595
|
-
}
|
|
1596
|
-
resetToDefault;
|
|
1597
|
-
parameter;
|
|
1598
|
-
valueSize;
|
|
1599
|
-
valueFormat;
|
|
1600
|
-
value;
|
|
1601
|
-
serialize(ctx) {
|
|
1602
|
-
const valueSize = this.resetToDefault ? 1 : this.valueSize;
|
|
1603
|
-
const payloadLength = 2 + valueSize;
|
|
1604
|
-
this.payload = safe_2.Bytes.alloc(payloadLength, 0);
|
|
1605
|
-
this.payload[0] = this.parameter;
|
|
1606
|
-
this.payload[1] = (this.resetToDefault ? 0b1000_0000 : 0)
|
|
1607
|
-
| (valueSize & 0b111);
|
|
1608
|
-
if (!this.resetToDefault) {
|
|
1609
|
-
// Make sure that the given value fits into the value size
|
|
1610
|
-
if (typeof this.value === "number"
|
|
1611
|
-
&& !isSafeValue(this.value, valueSize, this.valueFormat)) {
|
|
1612
|
-
// If there is a value size configured, check that the given value is compatible
|
|
1613
|
-
throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat);
|
|
1614
|
-
}
|
|
1615
|
-
try {
|
|
1616
|
-
serializeValue(this.payload, 2, valueSize, this.valueFormat, this.value);
|
|
1617
|
-
}
|
|
1618
|
-
catch (e) {
|
|
1619
|
-
tryCatchOutOfBoundsError(e, this.value, this.parameter, valueSize, this.valueFormat);
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
return super.serialize(ctx);
|
|
1623
|
-
}
|
|
1624
|
-
toLogEntry(ctx) {
|
|
1625
|
-
const message = {
|
|
1626
|
-
"parameter #": this.parameter,
|
|
1627
|
-
"reset to default": this.resetToDefault,
|
|
1628
|
-
};
|
|
1629
|
-
if (this.valueSize != undefined) {
|
|
1630
|
-
message["value size"] = this.valueSize;
|
|
1631
|
-
}
|
|
1632
|
-
if (this.valueFormat != undefined) {
|
|
1633
|
-
message["value format"] = (0, safe_3.getEnumMemberName)(safe_1.ConfigValueFormat, this.valueFormat);
|
|
1634
|
-
}
|
|
1635
|
-
if (this.value != undefined) {
|
|
1636
|
-
message.value = configValueToString(this.value);
|
|
1637
|
-
}
|
|
1638
|
-
return {
|
|
1639
|
-
...super.toLogEntry(ctx),
|
|
1640
|
-
message,
|
|
1641
|
-
};
|
|
1642
|
-
}
|
|
1643
|
-
};
|
|
1644
|
-
exports.ConfigurationCCSet = ConfigurationCCSet;
|
|
1645
|
-
exports.ConfigurationCCSet = ConfigurationCCSet = ConfigurationCCSet_1 = __decorate([
|
|
1646
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.Set),
|
|
1647
|
-
(0, CommandClassDecorators_1.useSupervision)()
|
|
1648
|
-
], ConfigurationCCSet);
|
|
1649
|
-
function getResponseForBulkSet(cc) {
|
|
1650
|
-
return cc.handshake ? ConfigurationCCBulkReport : undefined;
|
|
1651
|
-
}
|
|
1652
|
-
let ConfigurationCCBulkSet = class ConfigurationCCBulkSet extends ConfigurationCC {
|
|
1653
|
-
constructor(options) {
|
|
1654
|
-
super(options);
|
|
1655
|
-
this._parameters = options.parameters;
|
|
1656
|
-
if (this._parameters.length < 1) {
|
|
1657
|
-
throw new safe_1.ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, safe_1.ZWaveErrorCodes.CC_Invalid);
|
|
1658
|
-
}
|
|
1659
|
-
else if (!(0, safe_1.isConsecutiveArray)(this._parameters)) {
|
|
1660
|
-
throw new safe_1.ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, safe_1.ZWaveErrorCodes.CC_Invalid);
|
|
1661
|
-
}
|
|
1662
|
-
this._handshake = !!options.handshake;
|
|
1663
|
-
this._resetToDefault = !!options.resetToDefault;
|
|
1664
|
-
if (!!options.resetToDefault) {
|
|
1665
|
-
this._valueSize = 1;
|
|
1666
|
-
this._valueFormat = safe_1.ConfigValueFormat.SignedInteger;
|
|
1667
|
-
this._values = this._parameters.map(() => 0);
|
|
1668
|
-
}
|
|
1669
|
-
else {
|
|
1670
|
-
this._valueSize = options.valueSize;
|
|
1671
|
-
this._valueFormat = options.valueFormat
|
|
1672
|
-
?? safe_1.ConfigValueFormat.SignedInteger;
|
|
1673
|
-
this._values = options.values;
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
static from(_raw, _ctx) {
|
|
1677
|
-
// TODO: Deserialize payload
|
|
1678
|
-
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1679
|
-
// return new ConfigurationCCBulkSet({
|
|
1680
|
-
// nodeId: ctx.sourceNodeId,
|
|
1681
|
-
// });
|
|
1682
|
-
}
|
|
1683
|
-
_parameters;
|
|
1684
|
-
get parameters() {
|
|
1685
|
-
return this._parameters;
|
|
1686
|
-
}
|
|
1687
|
-
_resetToDefault;
|
|
1688
|
-
get resetToDefault() {
|
|
1689
|
-
return this._resetToDefault;
|
|
1690
|
-
}
|
|
1691
|
-
_valueSize;
|
|
1692
|
-
get valueSize() {
|
|
1693
|
-
return this._valueSize;
|
|
1694
|
-
}
|
|
1695
|
-
_valueFormat;
|
|
1696
|
-
get valueFormat() {
|
|
1697
|
-
return this._valueFormat;
|
|
1698
|
-
}
|
|
1699
|
-
_values;
|
|
1700
|
-
get values() {
|
|
1701
|
-
return this._values;
|
|
1702
|
-
}
|
|
1703
|
-
_handshake;
|
|
1704
|
-
get handshake() {
|
|
1705
|
-
return this._handshake;
|
|
1706
|
-
}
|
|
1707
|
-
serialize(ctx) {
|
|
1708
|
-
const valueSize = this._resetToDefault ? 1 : this.valueSize;
|
|
1709
|
-
const payloadLength = 4 + valueSize * this.parameters.length;
|
|
1710
|
-
this.payload = safe_2.Bytes.alloc(payloadLength, 0);
|
|
1711
|
-
this.payload.writeUInt16BE(this.parameters[0], 0);
|
|
1712
|
-
this.payload[2] = this.parameters.length;
|
|
1713
|
-
this.payload[3] = (this._resetToDefault ? 0b1000_0000 : 0)
|
|
1714
|
-
| (this.handshake ? 0b0100_0000 : 0)
|
|
1715
|
-
| (valueSize & 0b111);
|
|
1716
|
-
if (!this._resetToDefault) {
|
|
1717
|
-
for (let i = 0; i < this.parameters.length; i++) {
|
|
1718
|
-
const value = this._values[i];
|
|
1719
|
-
const param = this._parameters[i];
|
|
1720
|
-
// Make sure that the given value fits into the value size
|
|
1721
|
-
if (!isSafeValue(value, valueSize, this._valueFormat)) {
|
|
1722
|
-
// If there is a value size configured, check that the given value is compatible
|
|
1723
|
-
throwInvalidValueError(value, param, valueSize, this._valueFormat);
|
|
1724
|
-
}
|
|
1725
|
-
try {
|
|
1726
|
-
serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);
|
|
1727
|
-
}
|
|
1728
|
-
catch (e) {
|
|
1729
|
-
tryCatchOutOfBoundsError(e, value, param, valueSize, this._valueFormat);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
return super.serialize(ctx);
|
|
1734
|
-
}
|
|
1735
|
-
toLogEntry(ctx) {
|
|
1736
|
-
const message = {
|
|
1737
|
-
handshake: this.handshake,
|
|
1738
|
-
"reset to default": this.resetToDefault,
|
|
1739
|
-
"value size": this.valueSize,
|
|
1740
|
-
};
|
|
1741
|
-
if (this._values.length > 0) {
|
|
1742
|
-
message.values = this._values
|
|
1743
|
-
.map((value, i) => `\n· #${this._parameters[i]}: ${configValueToString(value)}`)
|
|
1744
|
-
.join("");
|
|
1745
|
-
}
|
|
1746
|
-
return {
|
|
1747
|
-
...super.toLogEntry(ctx),
|
|
1748
|
-
message,
|
|
1749
|
-
};
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
exports.ConfigurationCCBulkSet = ConfigurationCCBulkSet;
|
|
1753
|
-
exports.ConfigurationCCBulkSet = ConfigurationCCBulkSet = __decorate([
|
|
1754
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.BulkSet),
|
|
1755
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(getResponseForBulkSet),
|
|
1756
|
-
(0, CommandClassDecorators_1.useSupervision)()
|
|
1757
|
-
], ConfigurationCCBulkSet);
|
|
1758
|
-
let ConfigurationCCBulkReport = ConfigurationCCBulkReport_1 = class ConfigurationCCBulkReport extends ConfigurationCC {
|
|
1759
|
-
constructor(options) {
|
|
1760
|
-
super(options);
|
|
1761
|
-
// TODO: Check implementation:
|
|
1762
|
-
this.reportsToFollow = options.reportsToFollow;
|
|
1763
|
-
this.defaultValues = options.defaultValues;
|
|
1764
|
-
this.isHandshakeResponse = options.isHandshakeResponse;
|
|
1765
|
-
this.valueSize = options.valueSize;
|
|
1766
|
-
for (const [param, value] of Object.entries(options.values)) {
|
|
1767
|
-
this._values.set(parseInt(param), value);
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
static from(raw, ctx) {
|
|
1771
|
-
// Ensure we received enough bytes for the preamble
|
|
1772
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 5);
|
|
1773
|
-
const firstParameter = raw.payload.readUInt16BE(0);
|
|
1774
|
-
const numParams = raw.payload[2];
|
|
1775
|
-
const reportsToFollow = raw.payload[3];
|
|
1776
|
-
const defaultValues = !!(raw.payload[4] & 0b1000_0000);
|
|
1777
|
-
const isHandshakeResponse = !!(raw.payload[4] & 0b0100_0000);
|
|
1778
|
-
const valueSize = raw.payload[4] & 0b111;
|
|
1779
|
-
// Ensure the payload is long enough for all reported values
|
|
1780
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 5 + numParams * valueSize);
|
|
1781
|
-
const values = {};
|
|
1782
|
-
for (let i = 0; i < numParams; i++) {
|
|
1783
|
-
const param = firstParameter + i;
|
|
1784
|
-
// Default to parsing the value as SignedInteger, like the specs say.
|
|
1785
|
-
// We try to re-interpret the value in persistValues()
|
|
1786
|
-
values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, safe_1.ConfigValueFormat.SignedInteger);
|
|
1787
|
-
}
|
|
1788
|
-
return new ConfigurationCCBulkReport_1({
|
|
1789
|
-
nodeId: ctx.sourceNodeId,
|
|
1790
|
-
reportsToFollow,
|
|
1791
|
-
defaultValues,
|
|
1792
|
-
isHandshakeResponse,
|
|
1793
|
-
valueSize,
|
|
1794
|
-
values,
|
|
1795
|
-
});
|
|
1796
|
-
}
|
|
1797
|
-
persistValues(ctx) {
|
|
1798
|
-
if (!super.persistValues(ctx))
|
|
1799
|
-
return false;
|
|
1800
|
-
// Store every received parameter
|
|
1801
|
-
// eslint-disable-next-line prefer-const
|
|
1802
|
-
for (let [parameter, value] of this._values.entries()) {
|
|
1803
|
-
// Check if the initial assumption of SignedInteger holds true
|
|
1804
|
-
const oldParamInformation = this.getParamInformation(ctx, parameter);
|
|
1805
|
-
if (oldParamInformation.format != undefined
|
|
1806
|
-
&& oldParamInformation.format
|
|
1807
|
-
!== safe_1.ConfigValueFormat.SignedInteger) {
|
|
1808
|
-
// Re-interpret the value with the new format
|
|
1809
|
-
value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);
|
|
1810
|
-
this._values.set(parameter, value);
|
|
1811
|
-
}
|
|
1812
|
-
this.setValue(ctx, exports.ConfigurationCCValues.paramInformation(parameter), value);
|
|
1813
|
-
}
|
|
1814
|
-
return true;
|
|
1815
|
-
}
|
|
1816
|
-
reportsToFollow;
|
|
1817
|
-
defaultValues;
|
|
1818
|
-
isHandshakeResponse;
|
|
1819
|
-
valueSize;
|
|
1820
|
-
_values = new Map();
|
|
1821
|
-
get values() {
|
|
1822
|
-
return this._values;
|
|
1823
|
-
}
|
|
1824
|
-
getPartialCCSessionId() {
|
|
1825
|
-
// We don't expect the applHost to merge CCs but we want to wait until all reports have been received
|
|
1826
|
-
return {};
|
|
1827
|
-
}
|
|
1828
|
-
expectMoreMessages() {
|
|
1829
|
-
return this.reportsToFollow > 0;
|
|
1830
|
-
}
|
|
1831
|
-
toLogEntry(ctx) {
|
|
1832
|
-
const message = {
|
|
1833
|
-
"handshake response": this.isHandshakeResponse,
|
|
1834
|
-
"default values": this.defaultValues,
|
|
1835
|
-
"value size": this.valueSize,
|
|
1836
|
-
"reports to follow": this.reportsToFollow,
|
|
1837
|
-
};
|
|
1838
|
-
if (this._values.size > 0) {
|
|
1839
|
-
message.values = [...this._values]
|
|
1840
|
-
.map(([param, value]) => `
|
|
1841
|
-
· #${param}: ${configValueToString(value)}`)
|
|
1842
|
-
.join("");
|
|
1843
|
-
}
|
|
1844
|
-
return {
|
|
1845
|
-
...super.toLogEntry(ctx),
|
|
1846
|
-
message,
|
|
1847
|
-
};
|
|
1848
|
-
}
|
|
1849
|
-
};
|
|
1850
|
-
exports.ConfigurationCCBulkReport = ConfigurationCCBulkReport;
|
|
1851
|
-
exports.ConfigurationCCBulkReport = ConfigurationCCBulkReport = ConfigurationCCBulkReport_1 = __decorate([
|
|
1852
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.BulkReport)
|
|
1853
|
-
], ConfigurationCCBulkReport);
|
|
1854
|
-
let ConfigurationCCBulkGet = class ConfigurationCCBulkGet extends ConfigurationCC {
|
|
1855
|
-
constructor(options) {
|
|
1856
|
-
super(options);
|
|
1857
|
-
this._parameters = options.parameters.sort();
|
|
1858
|
-
if (!(0, safe_1.isConsecutiveArray)(this.parameters)) {
|
|
1859
|
-
throw new safe_1.ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, safe_1.ZWaveErrorCodes.CC_Invalid);
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
static from(_raw, _ctx) {
|
|
1863
|
-
// TODO: Deserialize payload
|
|
1864
|
-
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1865
|
-
// return new ConfigurationCCBulkGet({
|
|
1866
|
-
// nodeId: ctx.sourceNodeId,
|
|
1867
|
-
// });
|
|
1868
|
-
}
|
|
1869
|
-
_parameters;
|
|
1870
|
-
get parameters() {
|
|
1871
|
-
return this._parameters;
|
|
1872
|
-
}
|
|
1873
|
-
serialize(ctx) {
|
|
1874
|
-
this.payload = new safe_2.Bytes(3);
|
|
1875
|
-
this.payload.writeUInt16BE(this.parameters[0], 0);
|
|
1876
|
-
this.payload[2] = this.parameters.length;
|
|
1877
|
-
return super.serialize(ctx);
|
|
1878
|
-
}
|
|
1879
|
-
toLogEntry(ctx) {
|
|
1880
|
-
return {
|
|
1881
|
-
...super.toLogEntry(ctx),
|
|
1882
|
-
message: { parameters: this.parameters.join(", ") },
|
|
1883
|
-
};
|
|
1884
|
-
}
|
|
1885
|
-
};
|
|
1886
|
-
exports.ConfigurationCCBulkGet = ConfigurationCCBulkGet;
|
|
1887
|
-
exports.ConfigurationCCBulkGet = ConfigurationCCBulkGet = __decorate([
|
|
1888
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.BulkGet),
|
|
1889
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(ConfigurationCCBulkReport)
|
|
1890
|
-
], ConfigurationCCBulkGet);
|
|
1891
|
-
let ConfigurationCCNameReport = ConfigurationCCNameReport_1 = class ConfigurationCCNameReport extends ConfigurationCC {
|
|
1892
|
-
constructor(options) {
|
|
1893
|
-
super(options);
|
|
1894
|
-
this.parameter = options.parameter;
|
|
1895
|
-
this.name = options.name;
|
|
1896
|
-
this.reportsToFollow = options.reportsToFollow;
|
|
1897
|
-
}
|
|
1898
|
-
static from(raw, ctx) {
|
|
1899
|
-
// Parameter and # of reports must be present
|
|
1900
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 3);
|
|
1901
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
1902
|
-
const reportsToFollow = raw.payload[2];
|
|
1903
|
-
if (reportsToFollow > 0) {
|
|
1904
|
-
// If more reports follow, the info must at least be one byte
|
|
1905
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
1906
|
-
}
|
|
1907
|
-
const name = raw.payload.subarray(3).toString("utf8");
|
|
1908
|
-
return new ConfigurationCCNameReport_1({
|
|
1909
|
-
nodeId: ctx.sourceNodeId,
|
|
1910
|
-
parameter,
|
|
1911
|
-
reportsToFollow,
|
|
1912
|
-
name,
|
|
1913
|
-
});
|
|
1914
|
-
}
|
|
1915
|
-
parameter;
|
|
1916
|
-
name;
|
|
1917
|
-
reportsToFollow;
|
|
1918
|
-
persistValues(ctx) {
|
|
1919
|
-
if (!super.persistValues(ctx))
|
|
1920
|
-
return false;
|
|
1921
|
-
// Bitfield parameters that are not documented in a config file
|
|
1922
|
-
// are split into multiple partial parameters. We need to set the name for
|
|
1923
|
-
// all of them.
|
|
1924
|
-
const partialParams = this.getPartialParamInfos(ctx, this.parameter);
|
|
1925
|
-
if (partialParams.length === 0) {
|
|
1926
|
-
this.extendParamInformation(ctx, this.parameter, undefined, {
|
|
1927
|
-
label: this.name,
|
|
1928
|
-
});
|
|
1929
|
-
}
|
|
1930
|
-
else {
|
|
1931
|
-
for (const param of partialParams) {
|
|
1932
|
-
const paramNumber = param.property;
|
|
1933
|
-
const bitMask = param.propertyKey;
|
|
1934
|
-
const bitNumber = Math.log2(bitMask) % 1 === 0
|
|
1935
|
-
? Math.log2(bitMask)
|
|
1936
|
-
: undefined;
|
|
1937
|
-
let label = `${this.name} - ${bitMask}`;
|
|
1938
|
-
if (bitNumber != undefined) {
|
|
1939
|
-
label += ` (bit ${bitNumber})`;
|
|
1940
|
-
}
|
|
1941
|
-
this.extendParamInformation(ctx, paramNumber, bitMask, {
|
|
1942
|
-
label,
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
return true;
|
|
1947
|
-
}
|
|
1948
|
-
serialize(ctx) {
|
|
1949
|
-
const nameBuffer = safe_2.Bytes.from(this.name, "utf8");
|
|
1950
|
-
this.payload = new safe_2.Bytes(3 + nameBuffer.length);
|
|
1951
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
1952
|
-
this.payload[2] = this.reportsToFollow;
|
|
1953
|
-
this.payload.set(nameBuffer, 3);
|
|
1954
|
-
return super.serialize(ctx);
|
|
1955
|
-
}
|
|
1956
|
-
getPartialCCSessionId() {
|
|
1957
|
-
// Distinguish sessions by the parameter number
|
|
1958
|
-
return { parameter: this.parameter };
|
|
1959
|
-
}
|
|
1960
|
-
expectMoreMessages() {
|
|
1961
|
-
return this.reportsToFollow > 0;
|
|
1962
|
-
}
|
|
1963
|
-
mergePartialCCs(partials, _ctx) {
|
|
1964
|
-
// Concat the name
|
|
1965
|
-
this.name = [...partials, this]
|
|
1966
|
-
.map((report) => report.name)
|
|
1967
|
-
.reduce((prev, cur) => prev + cur, "");
|
|
1968
|
-
}
|
|
1969
|
-
toLogEntry(ctx) {
|
|
1970
|
-
return {
|
|
1971
|
-
...super.toLogEntry(ctx),
|
|
1972
|
-
message: {
|
|
1973
|
-
"parameter #": this.parameter,
|
|
1974
|
-
name: this.name,
|
|
1975
|
-
"reports to follow": this.reportsToFollow,
|
|
1976
|
-
},
|
|
1977
|
-
};
|
|
1978
|
-
}
|
|
1979
|
-
};
|
|
1980
|
-
exports.ConfigurationCCNameReport = ConfigurationCCNameReport;
|
|
1981
|
-
exports.ConfigurationCCNameReport = ConfigurationCCNameReport = ConfigurationCCNameReport_1 = __decorate([
|
|
1982
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.NameReport)
|
|
1983
|
-
], ConfigurationCCNameReport);
|
|
1984
|
-
let ConfigurationCCNameGet = ConfigurationCCNameGet_1 = class ConfigurationCCNameGet extends ConfigurationCC {
|
|
1985
|
-
constructor(options) {
|
|
1986
|
-
super(options);
|
|
1987
|
-
this.parameter = options.parameter;
|
|
1988
|
-
}
|
|
1989
|
-
static from(raw, ctx) {
|
|
1990
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
1991
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
1992
|
-
return new ConfigurationCCNameGet_1({
|
|
1993
|
-
nodeId: ctx.sourceNodeId,
|
|
1994
|
-
parameter,
|
|
1995
|
-
});
|
|
1996
|
-
}
|
|
1997
|
-
parameter;
|
|
1998
|
-
serialize(ctx) {
|
|
1999
|
-
this.payload = new safe_2.Bytes(2);
|
|
2000
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2001
|
-
return super.serialize(ctx);
|
|
2002
|
-
}
|
|
2003
|
-
toLogEntry(ctx) {
|
|
2004
|
-
return {
|
|
2005
|
-
...super.toLogEntry(ctx),
|
|
2006
|
-
message: { "parameter #": this.parameter },
|
|
2007
|
-
};
|
|
2008
|
-
}
|
|
2009
|
-
};
|
|
2010
|
-
exports.ConfigurationCCNameGet = ConfigurationCCNameGet;
|
|
2011
|
-
exports.ConfigurationCCNameGet = ConfigurationCCNameGet = ConfigurationCCNameGet_1 = __decorate([
|
|
2012
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.NameGet),
|
|
2013
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(ConfigurationCCNameReport)
|
|
2014
|
-
], ConfigurationCCNameGet);
|
|
2015
|
-
let ConfigurationCCInfoReport = ConfigurationCCInfoReport_1 = class ConfigurationCCInfoReport extends ConfigurationCC {
|
|
2016
|
-
constructor(options) {
|
|
2017
|
-
super(options);
|
|
2018
|
-
this.parameter = options.parameter;
|
|
2019
|
-
this.info = options.info;
|
|
2020
|
-
this.reportsToFollow = options.reportsToFollow;
|
|
2021
|
-
}
|
|
2022
|
-
static from(raw, ctx) {
|
|
2023
|
-
// Parameter and # of reports must be present
|
|
2024
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 3);
|
|
2025
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
2026
|
-
const reportsToFollow = raw.payload[2];
|
|
2027
|
-
if (reportsToFollow > 0) {
|
|
2028
|
-
// If more reports follow, the info must at least be one byte
|
|
2029
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
2030
|
-
}
|
|
2031
|
-
const info = raw.payload.subarray(3).toString("utf8");
|
|
2032
|
-
return new ConfigurationCCInfoReport_1({
|
|
2033
|
-
nodeId: ctx.sourceNodeId,
|
|
2034
|
-
parameter,
|
|
2035
|
-
reportsToFollow,
|
|
2036
|
-
info,
|
|
2037
|
-
});
|
|
2038
|
-
}
|
|
2039
|
-
parameter;
|
|
2040
|
-
info;
|
|
2041
|
-
reportsToFollow;
|
|
2042
|
-
persistValues(ctx) {
|
|
2043
|
-
if (!super.persistValues(ctx))
|
|
2044
|
-
return false;
|
|
2045
|
-
// Bitfield parameters that are not documented in a config file
|
|
2046
|
-
// are split into multiple partial parameters. We need to set the description for
|
|
2047
|
-
// all of them. However, these can get very long, so we put the reported
|
|
2048
|
-
// description on the first partial param, and refer to it from the others
|
|
2049
|
-
const partialParams = this.getPartialParamInfos(ctx, this.parameter).sort((a, b) => (a.propertyKey ?? 0)
|
|
2050
|
-
- (b.propertyKey ?? 0));
|
|
2051
|
-
if (partialParams.length === 0) {
|
|
2052
|
-
this.extendParamInformation(ctx, this.parameter, undefined, {
|
|
2053
|
-
description: this.info,
|
|
2054
|
-
});
|
|
2055
|
-
}
|
|
2056
|
-
else {
|
|
2057
|
-
let firstParamLabel;
|
|
2058
|
-
for (const param of partialParams) {
|
|
2059
|
-
const paramNumber = param.property;
|
|
2060
|
-
const bitMask = param.propertyKey;
|
|
2061
|
-
// We put the description on the first partial param
|
|
2062
|
-
const description = firstParamLabel
|
|
2063
|
-
? `Refer to ${firstParamLabel}`
|
|
2064
|
-
: this.info;
|
|
2065
|
-
this.extendParamInformation(ctx, paramNumber, bitMask, {
|
|
2066
|
-
description,
|
|
2067
|
-
});
|
|
2068
|
-
// Then we store the name of the first param to refer to it on the
|
|
2069
|
-
// following partial params
|
|
2070
|
-
if (firstParamLabel == undefined) {
|
|
2071
|
-
firstParamLabel =
|
|
2072
|
-
this.getParamInformation(ctx, paramNumber, bitMask)
|
|
2073
|
-
.label ?? `parameter ${paramNumber} - ${bitMask}`;
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
return true;
|
|
2078
|
-
}
|
|
2079
|
-
serialize(ctx) {
|
|
2080
|
-
const infoBuffer = safe_2.Bytes.from(this.info, "utf8");
|
|
2081
|
-
this.payload = new safe_2.Bytes(3 + infoBuffer.length);
|
|
2082
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2083
|
-
this.payload[2] = this.reportsToFollow;
|
|
2084
|
-
this.payload.set(infoBuffer, 3);
|
|
2085
|
-
return super.serialize(ctx);
|
|
2086
|
-
}
|
|
2087
|
-
getPartialCCSessionId() {
|
|
2088
|
-
// Distinguish sessions by the parameter number
|
|
2089
|
-
return { parameter: this.parameter };
|
|
2090
|
-
}
|
|
2091
|
-
expectMoreMessages() {
|
|
2092
|
-
return this.reportsToFollow > 0;
|
|
2093
|
-
}
|
|
2094
|
-
mergePartialCCs(partials, _ctx) {
|
|
2095
|
-
// Concat the info
|
|
2096
|
-
this.info = [...partials, this]
|
|
2097
|
-
.map((report) => report.info)
|
|
2098
|
-
.reduce((prev, cur) => prev + cur, "");
|
|
2099
|
-
}
|
|
2100
|
-
toLogEntry(ctx) {
|
|
2101
|
-
return {
|
|
2102
|
-
...super.toLogEntry(ctx),
|
|
2103
|
-
message: {
|
|
2104
|
-
"parameter #": this.parameter,
|
|
2105
|
-
info: this.info,
|
|
2106
|
-
"reports to follow": this.reportsToFollow,
|
|
2107
|
-
},
|
|
2108
|
-
};
|
|
2109
|
-
}
|
|
2110
|
-
};
|
|
2111
|
-
exports.ConfigurationCCInfoReport = ConfigurationCCInfoReport;
|
|
2112
|
-
exports.ConfigurationCCInfoReport = ConfigurationCCInfoReport = ConfigurationCCInfoReport_1 = __decorate([
|
|
2113
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.InfoReport)
|
|
2114
|
-
], ConfigurationCCInfoReport);
|
|
2115
|
-
let ConfigurationCCInfoGet = ConfigurationCCInfoGet_1 = class ConfigurationCCInfoGet extends ConfigurationCC {
|
|
2116
|
-
constructor(options) {
|
|
2117
|
-
super(options);
|
|
2118
|
-
this.parameter = options.parameter;
|
|
2119
|
-
}
|
|
2120
|
-
static from(raw, ctx) {
|
|
2121
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
2122
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
2123
|
-
return new ConfigurationCCInfoGet_1({
|
|
2124
|
-
nodeId: ctx.sourceNodeId,
|
|
2125
|
-
parameter,
|
|
2126
|
-
});
|
|
2127
|
-
}
|
|
2128
|
-
parameter;
|
|
2129
|
-
serialize(ctx) {
|
|
2130
|
-
this.payload = new safe_2.Bytes(2);
|
|
2131
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2132
|
-
return super.serialize(ctx);
|
|
2133
|
-
}
|
|
2134
|
-
toLogEntry(ctx) {
|
|
2135
|
-
return {
|
|
2136
|
-
...super.toLogEntry(ctx),
|
|
2137
|
-
message: { "parameter #": this.parameter },
|
|
2138
|
-
};
|
|
2139
|
-
}
|
|
2140
|
-
};
|
|
2141
|
-
exports.ConfigurationCCInfoGet = ConfigurationCCInfoGet;
|
|
2142
|
-
exports.ConfigurationCCInfoGet = ConfigurationCCInfoGet = ConfigurationCCInfoGet_1 = __decorate([
|
|
2143
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.InfoGet),
|
|
2144
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(ConfigurationCCInfoReport)
|
|
2145
|
-
], ConfigurationCCInfoGet);
|
|
2146
|
-
let ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport_1 = class ConfigurationCCPropertiesReport extends ConfigurationCC {
|
|
2147
|
-
constructor(options) {
|
|
2148
|
-
super(options);
|
|
2149
|
-
this.parameter = options.parameter;
|
|
2150
|
-
this.valueSize = options.valueSize;
|
|
2151
|
-
this.valueFormat = options.valueFormat;
|
|
2152
|
-
if (this.valueSize > 0) {
|
|
2153
|
-
if (options.minValue == undefined) {
|
|
2154
|
-
throw new safe_1.ZWaveError("The minimum value must be set when the value size is non-zero", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
2155
|
-
}
|
|
2156
|
-
else if (options.maxValue == undefined) {
|
|
2157
|
-
throw new safe_1.ZWaveError("The maximum value must be set when the value size is non-zero", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
2158
|
-
}
|
|
2159
|
-
else if (options.defaultValue == undefined) {
|
|
2160
|
-
throw new safe_1.ZWaveError("The default value must be set when the value size is non-zero", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
2161
|
-
}
|
|
2162
|
-
this.minValue = options.minValue;
|
|
2163
|
-
this.maxValue = options.maxValue;
|
|
2164
|
-
this.defaultValue = options.defaultValue;
|
|
2165
|
-
}
|
|
2166
|
-
this.nextParameter = options.nextParameter;
|
|
2167
|
-
this.altersCapabilities = options.altersCapabilities;
|
|
2168
|
-
this.isReadonly = options.isReadonly;
|
|
2169
|
-
this.isAdvanced = options.isAdvanced;
|
|
2170
|
-
this.noBulkSupport = options.noBulkSupport;
|
|
2171
|
-
}
|
|
2172
|
-
static from(raw, ctx) {
|
|
2173
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 3);
|
|
2174
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
2175
|
-
const valueFormat = (raw.payload[2] & 0b111000)
|
|
2176
|
-
>>> 3;
|
|
2177
|
-
const valueSize = raw.payload[2] & 0b111;
|
|
2178
|
-
// GH#1309 Some devices don't tell us the first parameter if we query #0
|
|
2179
|
-
// Instead, they contain 0x000000
|
|
2180
|
-
let nextParameter;
|
|
2181
|
-
if (valueSize === 0 && raw.payload.length < 5) {
|
|
2182
|
-
nextParameter = 0;
|
|
2183
|
-
return new ConfigurationCCPropertiesReport_1({
|
|
2184
|
-
nodeId: ctx.sourceNodeId,
|
|
2185
|
-
parameter,
|
|
2186
|
-
valueFormat,
|
|
2187
|
-
valueSize,
|
|
2188
|
-
nextParameter,
|
|
2189
|
-
});
|
|
2190
|
-
}
|
|
2191
|
-
// Ensure the payload contains the two bytes for next parameter
|
|
2192
|
-
const nextParameterOffset = 3 + 3 * valueSize;
|
|
2193
|
-
(0, safe_1.validatePayload)(raw.payload.length >= nextParameterOffset + 2);
|
|
2194
|
-
let minValue;
|
|
2195
|
-
let maxValue;
|
|
2196
|
-
let defaultValue;
|
|
2197
|
-
if (valueSize > 0) {
|
|
2198
|
-
if (valueFormat === safe_1.ConfigValueFormat.BitField) {
|
|
2199
|
-
minValue = 0;
|
|
2200
|
-
}
|
|
2201
|
-
else {
|
|
2202
|
-
minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);
|
|
2203
|
-
}
|
|
2204
|
-
maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);
|
|
2205
|
-
defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);
|
|
2206
|
-
}
|
|
2207
|
-
nextParameter = raw.payload.readUInt16BE(nextParameterOffset);
|
|
2208
|
-
let altersCapabilities;
|
|
2209
|
-
let isReadonly;
|
|
2210
|
-
let isAdvanced;
|
|
2211
|
-
let noBulkSupport;
|
|
2212
|
-
if (raw.payload.length >= nextParameterOffset + 3) {
|
|
2213
|
-
// V4 adds an options byte after the next parameter and two bits in byte 2
|
|
2214
|
-
const options1 = raw.payload[2];
|
|
2215
|
-
const options2 = raw.payload[3 + 3 * valueSize + 2];
|
|
2216
|
-
altersCapabilities = !!(options1 & 0b1000_0000);
|
|
2217
|
-
isReadonly = !!(options1 & 0b0100_0000);
|
|
2218
|
-
isAdvanced = !!(options2 & 0b1);
|
|
2219
|
-
noBulkSupport = !!(options2 & 0b10);
|
|
2220
|
-
}
|
|
2221
|
-
return new ConfigurationCCPropertiesReport_1({
|
|
2222
|
-
nodeId: ctx.sourceNodeId,
|
|
2223
|
-
parameter,
|
|
2224
|
-
valueFormat,
|
|
2225
|
-
valueSize,
|
|
2226
|
-
nextParameter,
|
|
2227
|
-
minValue,
|
|
2228
|
-
maxValue,
|
|
2229
|
-
defaultValue,
|
|
2230
|
-
altersCapabilities,
|
|
2231
|
-
isReadonly,
|
|
2232
|
-
isAdvanced,
|
|
2233
|
-
noBulkSupport,
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
persistValues(ctx) {
|
|
2237
|
-
if (!super.persistValues(ctx))
|
|
2238
|
-
return false;
|
|
2239
|
-
// If we actually received parameter info, store it
|
|
2240
|
-
if (this.valueSize > 0) {
|
|
2241
|
-
const baseInfo = {
|
|
2242
|
-
type: "number",
|
|
2243
|
-
format: this.valueFormat,
|
|
2244
|
-
valueSize: this.valueSize,
|
|
2245
|
-
requiresReInclusion: this.altersCapabilities,
|
|
2246
|
-
readable: true,
|
|
2247
|
-
writeable: !this.isReadonly,
|
|
2248
|
-
allowManualEntry: true,
|
|
2249
|
-
isAdvanced: this.isAdvanced,
|
|
2250
|
-
noBulkSupport: this.noBulkSupport,
|
|
2251
|
-
isFromConfig: false,
|
|
2252
|
-
};
|
|
2253
|
-
if (this.valueFormat !== safe_1.ConfigValueFormat.BitField) {
|
|
2254
|
-
// Do not override param information from a config file
|
|
2255
|
-
if (!this.paramExistsInConfigFile(ctx, this.parameter)) {
|
|
2256
|
-
const paramInfo = (0, safe_1.stripUndefined)({
|
|
2257
|
-
...baseInfo,
|
|
2258
|
-
min: this.minValue,
|
|
2259
|
-
max: this.maxValue,
|
|
2260
|
-
default: this.defaultValue,
|
|
2261
|
-
});
|
|
2262
|
-
this.extendParamInformation(ctx, this.parameter, undefined, paramInfo);
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
else {
|
|
2266
|
-
// Bit fields are split into multiple single-bit partial parameters
|
|
2267
|
-
const bits = this.maxValue;
|
|
2268
|
-
let mask = 1;
|
|
2269
|
-
while (mask <= bits) {
|
|
2270
|
-
if (
|
|
2271
|
-
// Only create partials that exist
|
|
2272
|
-
!!(mask & bits)
|
|
2273
|
-
// Do not override param information from a config file
|
|
2274
|
-
&& !this.paramExistsInConfigFile(ctx, this.parameter, mask)) {
|
|
2275
|
-
const paramInfo = (0, safe_1.stripUndefined)({
|
|
2276
|
-
...baseInfo,
|
|
2277
|
-
min: 0,
|
|
2278
|
-
max: 1,
|
|
2279
|
-
default: this.defaultValue & mask ? 1 : 0,
|
|
2280
|
-
});
|
|
2281
|
-
this.extendParamInformation(ctx, this.parameter, mask, paramInfo);
|
|
2282
|
-
}
|
|
2283
|
-
// We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS
|
|
2284
|
-
// which would create an infinite loop if maxValue === 0xffff_ffff
|
|
2285
|
-
mask *= 2;
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
}
|
|
2289
|
-
return true;
|
|
2290
|
-
}
|
|
2291
|
-
parameter;
|
|
2292
|
-
valueSize;
|
|
2293
|
-
valueFormat;
|
|
2294
|
-
minValue;
|
|
2295
|
-
maxValue;
|
|
2296
|
-
defaultValue;
|
|
2297
|
-
nextParameter;
|
|
2298
|
-
altersCapabilities;
|
|
2299
|
-
isReadonly;
|
|
2300
|
-
isAdvanced;
|
|
2301
|
-
noBulkSupport;
|
|
2302
|
-
serialize(ctx) {
|
|
2303
|
-
this.payload = new safe_2.Bytes(3 // preamble
|
|
2304
|
-
+ 3 * this.valueSize // min, max, default value
|
|
2305
|
-
+ 2 // next parameter
|
|
2306
|
-
+ 1);
|
|
2307
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2308
|
-
const options1 = (this.altersCapabilities ? 0b1000_0000 : 0)
|
|
2309
|
-
| (this.isReadonly ? 0b0100_0000 : 0)
|
|
2310
|
-
| ((this.valueFormat & 0b111) << 3)
|
|
2311
|
-
| (this.valueSize & 0b111);
|
|
2312
|
-
this.payload[2] = options1;
|
|
2313
|
-
let offset = 3;
|
|
2314
|
-
if (this.valueSize > 0) {
|
|
2315
|
-
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue);
|
|
2316
|
-
offset += this.valueSize;
|
|
2317
|
-
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue);
|
|
2318
|
-
offset += this.valueSize;
|
|
2319
|
-
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue);
|
|
2320
|
-
offset += this.valueSize;
|
|
2321
|
-
}
|
|
2322
|
-
this.payload.writeUInt16BE(this.nextParameter, offset);
|
|
2323
|
-
offset += 2;
|
|
2324
|
-
const options2 = (this.isAdvanced ? 0b1 : 0)
|
|
2325
|
-
| (this.noBulkSupport ? 0b10 : 0);
|
|
2326
|
-
this.payload[offset] = options2;
|
|
2327
|
-
return super.serialize(ctx);
|
|
2328
|
-
}
|
|
2329
|
-
toLogEntry(ctx) {
|
|
2330
|
-
const message = {
|
|
2331
|
-
"parameter #": this.parameter,
|
|
2332
|
-
"next param #": this.nextParameter,
|
|
2333
|
-
"value size": this.valueSize,
|
|
2334
|
-
"value format": (0, safe_3.getEnumMemberName)(safe_1.ConfigValueFormat, this.valueFormat),
|
|
2335
|
-
};
|
|
2336
|
-
if (this.minValue != undefined) {
|
|
2337
|
-
message["min value"] = configValueToString(this.minValue);
|
|
2338
|
-
}
|
|
2339
|
-
if (this.maxValue != undefined) {
|
|
2340
|
-
message["max value"] = configValueToString(this.maxValue);
|
|
2341
|
-
}
|
|
2342
|
-
if (this.defaultValue != undefined) {
|
|
2343
|
-
message["default value"] = configValueToString(this.defaultValue);
|
|
2344
|
-
}
|
|
2345
|
-
if (this.altersCapabilities != undefined) {
|
|
2346
|
-
message["alters capabilities"] = this.altersCapabilities;
|
|
2347
|
-
}
|
|
2348
|
-
if (this.isReadonly != undefined) {
|
|
2349
|
-
message.readonly = this.isReadonly;
|
|
2350
|
-
}
|
|
2351
|
-
if (this.isAdvanced != undefined) {
|
|
2352
|
-
message.advanced = this.isAdvanced;
|
|
2353
|
-
}
|
|
2354
|
-
if (this.noBulkSupport != undefined) {
|
|
2355
|
-
message["bulk support"] = !this.noBulkSupport;
|
|
2356
|
-
}
|
|
2357
|
-
return {
|
|
2358
|
-
...super.toLogEntry(ctx),
|
|
2359
|
-
message,
|
|
2360
|
-
};
|
|
2361
|
-
}
|
|
2362
|
-
};
|
|
2363
|
-
exports.ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport;
|
|
2364
|
-
exports.ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport_1 = __decorate([
|
|
2365
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.PropertiesReport)
|
|
2366
|
-
], ConfigurationCCPropertiesReport);
|
|
2367
|
-
let ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet_1 = class ConfigurationCCPropertiesGet extends ConfigurationCC {
|
|
2368
|
-
constructor(options) {
|
|
2369
|
-
super(options);
|
|
2370
|
-
this.parameter = options.parameter;
|
|
2371
|
-
}
|
|
2372
|
-
static from(raw, ctx) {
|
|
2373
|
-
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
2374
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
2375
|
-
return new ConfigurationCCPropertiesGet_1({
|
|
2376
|
-
nodeId: ctx.sourceNodeId,
|
|
2377
|
-
parameter,
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
parameter;
|
|
2381
|
-
serialize(ctx) {
|
|
2382
|
-
this.payload = new safe_2.Bytes(2);
|
|
2383
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2384
|
-
return super.serialize(ctx);
|
|
2385
|
-
}
|
|
2386
|
-
toLogEntry(ctx) {
|
|
2387
|
-
return {
|
|
2388
|
-
...super.toLogEntry(ctx),
|
|
2389
|
-
message: { "parameter #": this.parameter },
|
|
2390
|
-
};
|
|
2391
|
-
}
|
|
2392
|
-
};
|
|
2393
|
-
exports.ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet;
|
|
2394
|
-
exports.ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet_1 = __decorate([
|
|
2395
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.PropertiesGet),
|
|
2396
|
-
(0, CommandClassDecorators_1.expectedCCResponse)(ConfigurationCCPropertiesReport)
|
|
2397
|
-
], ConfigurationCCPropertiesGet);
|
|
2398
|
-
let ConfigurationCCDefaultReset = class ConfigurationCCDefaultReset extends ConfigurationCC {
|
|
2399
|
-
};
|
|
2400
|
-
exports.ConfigurationCCDefaultReset = ConfigurationCCDefaultReset;
|
|
2401
|
-
exports.ConfigurationCCDefaultReset = ConfigurationCCDefaultReset = __decorate([
|
|
2402
|
-
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ConfigurationCommand.DefaultReset)
|
|
2403
|
-
], ConfigurationCCDefaultReset);
|
|
2404
|
-
function isSafeValue(value, size, format) {
|
|
2405
|
-
let minValue;
|
|
2406
|
-
let maxValue;
|
|
2407
|
-
switch (format) {
|
|
2408
|
-
case safe_1.ConfigValueFormat.SignedInteger:
|
|
2409
|
-
minValue = -Math.pow(2, 8 * size - 1);
|
|
2410
|
-
maxValue = Math.pow(2, 8 * size - 1) - 1;
|
|
2411
|
-
break;
|
|
2412
|
-
case safe_1.ConfigValueFormat.UnsignedInteger:
|
|
2413
|
-
case safe_1.ConfigValueFormat.Enumerated:
|
|
2414
|
-
case safe_1.ConfigValueFormat.BitField:
|
|
2415
|
-
minValue = 0;
|
|
2416
|
-
maxValue = Math.pow(2, 8 * size);
|
|
2417
|
-
break;
|
|
2418
|
-
default:
|
|
2419
|
-
throw new Error("not implemented");
|
|
2420
|
-
}
|
|
2421
|
-
return minValue <= value && value <= maxValue;
|
|
2422
|
-
}
|
|
2423
|
-
/** Interprets values from the payload depending on the value format */
|
|
2424
|
-
function parseValue(raw, size, format) {
|
|
2425
|
-
switch (format) {
|
|
2426
|
-
case safe_1.ConfigValueFormat.SignedInteger:
|
|
2427
|
-
return raw.readIntBE(0, size);
|
|
2428
|
-
case safe_1.ConfigValueFormat.UnsignedInteger:
|
|
2429
|
-
case safe_1.ConfigValueFormat.Enumerated:
|
|
2430
|
-
case safe_1.ConfigValueFormat.BitField:
|
|
2431
|
-
return raw.readUIntBE(0, size);
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
function throwInvalidValueError(value, parameter, valueSize, valueFormat) {
|
|
2435
|
-
throw new safe_1.ZWaveError(`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${(0, safe_3.getEnumMemberName)(safe_1.ConfigValueFormat, valueFormat)})!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
2436
|
-
}
|
|
2437
|
-
function tryCatchOutOfBoundsError(e, value, parameter, valueSize, valueFormat) {
|
|
2438
|
-
if (e.message.includes("out of bounds")) {
|
|
2439
|
-
throwInvalidValueError(value, parameter, valueSize, valueFormat);
|
|
2440
|
-
}
|
|
2441
|
-
else {
|
|
2442
|
-
throw e;
|
|
2443
|
-
}
|
|
2444
|
-
}
|
|
2445
|
-
/** Serializes values into the payload according to the value format */
|
|
2446
|
-
function serializeValue(payload, offset, size, format, value) {
|
|
2447
|
-
switch (format) {
|
|
2448
|
-
case safe_1.ConfigValueFormat.SignedInteger:
|
|
2449
|
-
payload.writeIntBE(value, offset, size);
|
|
2450
|
-
return;
|
|
2451
|
-
case safe_1.ConfigValueFormat.UnsignedInteger:
|
|
2452
|
-
case safe_1.ConfigValueFormat.Enumerated:
|
|
2453
|
-
case safe_1.ConfigValueFormat.BitField:
|
|
2454
|
-
payload.writeUIntBE(value, offset, size);
|
|
2455
|
-
return;
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
//# sourceMappingURL=ConfigurationCC.js.map
|