@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
|
@@ -0,0 +1,1695 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var UserCodeCC_1, UserCodeCCSet_1, UserCodeCCReport_1, UserCodeCCGet_1, UserCodeCCUsersNumberReport_1, UserCodeCCCapabilitiesReport_1, UserCodeCCKeypadModeSet_1, UserCodeCCKeypadModeReport_1, UserCodeCCAdminCodeSet_1, UserCodeCCAdminCodeReport_1, UserCodeCCUserCodeChecksumReport_1, UserCodeCCExtendedUserCodeReport_1;
|
|
8
|
+
function __assertType(argName, typeName, boundHasError) {
|
|
9
|
+
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
|
+
if (boundHasError()) {
|
|
11
|
+
throw new ZWaveError(typeName ? `${argName} is not a ${typeName}` : `${argName} has the wrong type`, ZWaveErrorCodes.Argument_Invalid);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const __assertType__number = $o => {
|
|
15
|
+
function _number($o) {
|
|
16
|
+
return typeof $o !== "number" ? {} : null;
|
|
17
|
+
}
|
|
18
|
+
return _number($o);
|
|
19
|
+
};
|
|
20
|
+
const __assertType__optional_boolean = $o => {
|
|
21
|
+
function _boolean($o) {
|
|
22
|
+
return typeof $o !== "boolean" ? {} : null;
|
|
23
|
+
}
|
|
24
|
+
function optional__boolean($o) {
|
|
25
|
+
if ($o !== undefined) {
|
|
26
|
+
const error = _boolean($o);
|
|
27
|
+
if (error)
|
|
28
|
+
return error;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return optional__boolean($o);
|
|
33
|
+
};
|
|
34
|
+
const __assertType__su__1__2__3__4_eu = $o => {
|
|
35
|
+
function _1($o) {
|
|
36
|
+
return $o !== 1 ? {} : null;
|
|
37
|
+
}
|
|
38
|
+
function _2($o) {
|
|
39
|
+
return $o !== 2 ? {} : null;
|
|
40
|
+
}
|
|
41
|
+
function _3($o) {
|
|
42
|
+
return $o !== 3 ? {} : null;
|
|
43
|
+
}
|
|
44
|
+
function _4($o) {
|
|
45
|
+
return $o !== 4 ? {} : null;
|
|
46
|
+
}
|
|
47
|
+
function su__1__2__3__4_eu($o) {
|
|
48
|
+
const conditions = [_1, _2, _3, _4];
|
|
49
|
+
for (const condition of conditions) {
|
|
50
|
+
const error = condition($o);
|
|
51
|
+
if (!error)
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
return su__1__2__3__4_eu($o);
|
|
57
|
+
};
|
|
58
|
+
const __assertType__su__string__uint8array_eu = $o => {
|
|
59
|
+
function _string($o) {
|
|
60
|
+
return typeof $o !== "string" ? {} : null;
|
|
61
|
+
}
|
|
62
|
+
function _uint8array($o) {
|
|
63
|
+
return !require("@zwave-js/shared/safe").isUint8Array($o) ? {} : null;
|
|
64
|
+
}
|
|
65
|
+
function su__string__uint8array_eu($o) {
|
|
66
|
+
const conditions = [_string, _uint8array];
|
|
67
|
+
for (const condition of conditions) {
|
|
68
|
+
const error = condition($o);
|
|
69
|
+
if (!error)
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
return su__string__uint8array_eu($o);
|
|
75
|
+
};
|
|
76
|
+
const __assertType__sa_su__3__4__5_eu_ea_2 = $o => {
|
|
77
|
+
function _6($o) {
|
|
78
|
+
return $o !== 0 ? {} : null;
|
|
79
|
+
}
|
|
80
|
+
function _7($o) {
|
|
81
|
+
return $o !== 0 ? {} : null;
|
|
82
|
+
}
|
|
83
|
+
function _undefined($o) {
|
|
84
|
+
return $o !== undefined ? {} : null;
|
|
85
|
+
}
|
|
86
|
+
function _3($o) {
|
|
87
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
88
|
+
return {};
|
|
89
|
+
if ("userId" in $o && $o["userId"] !== undefined) {
|
|
90
|
+
const error = _6($o["userId"]);
|
|
91
|
+
if (error)
|
|
92
|
+
return error;
|
|
93
|
+
}
|
|
94
|
+
else
|
|
95
|
+
return {};
|
|
96
|
+
if ("userIdStatus" in $o && $o["userIdStatus"] !== undefined) {
|
|
97
|
+
const error = _7($o["userIdStatus"]);
|
|
98
|
+
if (error)
|
|
99
|
+
return error;
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
return {};
|
|
103
|
+
if ("userCode" in $o && $o["userCode"] !== undefined) {
|
|
104
|
+
const error = _undefined($o["userCode"]);
|
|
105
|
+
if (error)
|
|
106
|
+
return error;
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
function _number($o) {
|
|
111
|
+
return typeof $o !== "number" ? {} : null;
|
|
112
|
+
}
|
|
113
|
+
function _4($o) {
|
|
114
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
115
|
+
return {};
|
|
116
|
+
if ("userId" in $o && $o["userId"] !== undefined) {
|
|
117
|
+
const error = _number($o["userId"]);
|
|
118
|
+
if (error)
|
|
119
|
+
return error;
|
|
120
|
+
}
|
|
121
|
+
else
|
|
122
|
+
return {};
|
|
123
|
+
if ("userIdStatus" in $o && $o["userIdStatus"] !== undefined) {
|
|
124
|
+
const error = _7($o["userIdStatus"]);
|
|
125
|
+
if (error)
|
|
126
|
+
return error;
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
return {};
|
|
130
|
+
if ("userCode" in $o && $o["userCode"] !== undefined) {
|
|
131
|
+
const error = _undefined($o["userCode"]);
|
|
132
|
+
if (error)
|
|
133
|
+
return error;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
function _9($o) {
|
|
138
|
+
return $o !== 1 ? {} : null;
|
|
139
|
+
}
|
|
140
|
+
function _10($o) {
|
|
141
|
+
return $o !== 2 ? {} : null;
|
|
142
|
+
}
|
|
143
|
+
function _11($o) {
|
|
144
|
+
return $o !== 3 ? {} : null;
|
|
145
|
+
}
|
|
146
|
+
function _12($o) {
|
|
147
|
+
return $o !== 4 ? {} : null;
|
|
148
|
+
}
|
|
149
|
+
function su__9__10__11__12_eu($o) {
|
|
150
|
+
const conditions = [_9, _10, _11, _12];
|
|
151
|
+
for (const condition of conditions) {
|
|
152
|
+
const error = condition($o);
|
|
153
|
+
if (!error)
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return {};
|
|
157
|
+
}
|
|
158
|
+
function _string($o) {
|
|
159
|
+
return typeof $o !== "string" ? {} : null;
|
|
160
|
+
}
|
|
161
|
+
function _uint8array($o) {
|
|
162
|
+
return !require("@zwave-js/shared/safe").isUint8Array($o) ? {} : null;
|
|
163
|
+
}
|
|
164
|
+
function su__string__uint8array_eu($o) {
|
|
165
|
+
const conditions = [_string, _uint8array];
|
|
166
|
+
for (const condition of conditions) {
|
|
167
|
+
const error = condition($o);
|
|
168
|
+
if (!error)
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
return {};
|
|
172
|
+
}
|
|
173
|
+
function _5($o) {
|
|
174
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
175
|
+
return {};
|
|
176
|
+
if ("userId" in $o && $o["userId"] !== undefined) {
|
|
177
|
+
const error = _number($o["userId"]);
|
|
178
|
+
if (error)
|
|
179
|
+
return error;
|
|
180
|
+
}
|
|
181
|
+
else
|
|
182
|
+
return {};
|
|
183
|
+
if ("userIdStatus" in $o && $o["userIdStatus"] !== undefined) {
|
|
184
|
+
const error = su__9__10__11__12_eu($o["userIdStatus"]);
|
|
185
|
+
if (error)
|
|
186
|
+
return error;
|
|
187
|
+
}
|
|
188
|
+
else
|
|
189
|
+
return {};
|
|
190
|
+
if ("userCode" in $o && $o["userCode"] !== undefined) {
|
|
191
|
+
const error = su__string__uint8array_eu($o["userCode"]);
|
|
192
|
+
if (error)
|
|
193
|
+
return error;
|
|
194
|
+
}
|
|
195
|
+
else
|
|
196
|
+
return {};
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
function su__3__4__5_eu($o) {
|
|
200
|
+
const conditions = [_3, _4, _5];
|
|
201
|
+
for (const condition of conditions) {
|
|
202
|
+
const error = condition($o);
|
|
203
|
+
if (!error)
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return {};
|
|
207
|
+
}
|
|
208
|
+
function sa_su__3__4__5_eu_ea_2($o) {
|
|
209
|
+
if (!Array.isArray($o))
|
|
210
|
+
return {};
|
|
211
|
+
for (let i = 0; i < $o.length; i++) {
|
|
212
|
+
const error = su__3__4__5_eu($o[i]);
|
|
213
|
+
if (error)
|
|
214
|
+
return error;
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
return sa_su__3__4__5_eu_ea_2($o);
|
|
219
|
+
};
|
|
220
|
+
const __assertType__optional_number = $o => {
|
|
221
|
+
function _number($o) {
|
|
222
|
+
return typeof $o !== "number" ? {} : null;
|
|
223
|
+
}
|
|
224
|
+
function optional__number($o) {
|
|
225
|
+
if ($o !== undefined) {
|
|
226
|
+
const error = _number($o);
|
|
227
|
+
if (error)
|
|
228
|
+
return error;
|
|
229
|
+
}
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
return optional__number($o);
|
|
233
|
+
};
|
|
234
|
+
const __assertType__KeypadMode = $o => {
|
|
235
|
+
function su__1__2__3__4_eu($o) {
|
|
236
|
+
return ![0, 1, 2, 3].includes($o) ? {} : null;
|
|
237
|
+
}
|
|
238
|
+
return su__1__2__3__4_eu($o);
|
|
239
|
+
};
|
|
240
|
+
const __assertType__string = $o => {
|
|
241
|
+
function _string($o) {
|
|
242
|
+
return typeof $o !== "string" ? {} : null;
|
|
243
|
+
}
|
|
244
|
+
return _string($o);
|
|
245
|
+
};
|
|
246
|
+
import { CommandClasses, MessagePriority, ValueMetadata, ZWaveError, ZWaveErrorCodes, encodeBitMask, enumValuesToMetadataStates, parseBitMask, supervisedCommandSucceeded, validatePayload, } from "@zwave-js/core/safe";
|
|
247
|
+
import { Bytes, isUint8Array, uint8ArrayToString } from "@zwave-js/shared/safe";
|
|
248
|
+
import { getEnumMemberName, isPrintableASCII, isPrintableASCIIWithWhitespace, num2hex, pick, } from "@zwave-js/shared/safe";
|
|
249
|
+
import { CCAPI, POLL_VALUE, PhysicalCCAPI, SET_VALUE, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from "../lib/API.js";
|
|
250
|
+
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
251
|
+
import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
252
|
+
import { V } from "../lib/Values.js";
|
|
253
|
+
import { KeypadMode, UserCodeCommand, UserIDStatus } from "../lib/_Types.js";
|
|
254
|
+
export const UserCodeCCValues = Object.freeze({
|
|
255
|
+
...V.defineStaticCCValues(CommandClasses["User Code"], {
|
|
256
|
+
...V.staticProperty("supportedUsers", undefined, { internal: true }),
|
|
257
|
+
...V.staticProperty("supportsAdminCode", undefined, {
|
|
258
|
+
internal: true,
|
|
259
|
+
}),
|
|
260
|
+
...V.staticProperty("supportsAdminCodeDeactivation", undefined, {
|
|
261
|
+
internal: true,
|
|
262
|
+
}),
|
|
263
|
+
// The following two properties are only kept for compatibility with devices
|
|
264
|
+
// that were interviewed before the rename to admin code
|
|
265
|
+
...V.staticPropertyWithName("_deprecated_supportsMasterCode", "supportsMasterCode", undefined, {
|
|
266
|
+
internal: true,
|
|
267
|
+
}),
|
|
268
|
+
...V.staticPropertyWithName("_deprecated_supportsMasterCodeDeactivation", "supportsMasterCodeDeactivation", undefined, {
|
|
269
|
+
internal: true,
|
|
270
|
+
}),
|
|
271
|
+
...V.staticProperty("supportsUserCodeChecksum", undefined, {
|
|
272
|
+
internal: true,
|
|
273
|
+
}),
|
|
274
|
+
...V.staticProperty("supportsMultipleUserCodeReport", undefined, {
|
|
275
|
+
internal: true,
|
|
276
|
+
}),
|
|
277
|
+
...V.staticProperty("supportsMultipleUserCodeSet", undefined, {
|
|
278
|
+
internal: true,
|
|
279
|
+
}),
|
|
280
|
+
...V.staticProperty("supportedUserIDStatuses", undefined, {
|
|
281
|
+
internal: true,
|
|
282
|
+
}),
|
|
283
|
+
...V.staticProperty("supportedKeypadModes", undefined, {
|
|
284
|
+
internal: true,
|
|
285
|
+
}),
|
|
286
|
+
...V.staticProperty("supportedASCIIChars", undefined, {
|
|
287
|
+
internal: true,
|
|
288
|
+
}),
|
|
289
|
+
...V.staticProperty("userCodeChecksum", undefined, { internal: true }),
|
|
290
|
+
...V.staticProperty("keypadMode", {
|
|
291
|
+
...ValueMetadata.ReadOnlyNumber,
|
|
292
|
+
label: "Keypad Mode",
|
|
293
|
+
}, { minVersion: 2 }),
|
|
294
|
+
...V.staticProperty("adminCode", {
|
|
295
|
+
...ValueMetadata.String,
|
|
296
|
+
label: "Admin Code",
|
|
297
|
+
minLength: 4,
|
|
298
|
+
maxLength: 10,
|
|
299
|
+
}, {
|
|
300
|
+
minVersion: 2,
|
|
301
|
+
secret: true,
|
|
302
|
+
}),
|
|
303
|
+
}),
|
|
304
|
+
...V.defineDynamicCCValues(CommandClasses["User Code"], {
|
|
305
|
+
...V.dynamicPropertyAndKeyWithName("userIdStatus", "userIdStatus", (userId) => userId, ({ property, propertyKey }) => property === "userIdStatus" && typeof propertyKey === "number", (userId) => ({
|
|
306
|
+
...ValueMetadata.Number,
|
|
307
|
+
label: `User ID status (${userId})`,
|
|
308
|
+
})),
|
|
309
|
+
...V.dynamicPropertyAndKeyWithName("userCode", "userCode", (userId) => userId, ({ property, propertyKey }) => property === "userCode" && typeof propertyKey === "number",
|
|
310
|
+
// The user code metadata is dynamically created
|
|
311
|
+
undefined, { secret: true }),
|
|
312
|
+
}),
|
|
313
|
+
});
|
|
314
|
+
function parseExtendedUserCode(payload) {
|
|
315
|
+
validatePayload(payload.length >= 4);
|
|
316
|
+
const userId = payload.readUInt16BE(0);
|
|
317
|
+
const status = payload[2];
|
|
318
|
+
const codeLength = payload[3] & 0b1111;
|
|
319
|
+
validatePayload(payload.length >= 4 + codeLength);
|
|
320
|
+
const code = payload.subarray(4, 4 + codeLength).toString("ascii");
|
|
321
|
+
return {
|
|
322
|
+
code: {
|
|
323
|
+
userId,
|
|
324
|
+
userIdStatus: status,
|
|
325
|
+
userCode: code,
|
|
326
|
+
},
|
|
327
|
+
bytesRead: 4 + codeLength,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function validateCode(code, supportedChars) {
|
|
331
|
+
if (code.length < 4 || code.length > 10)
|
|
332
|
+
return false;
|
|
333
|
+
return [...code].every((char) => supportedChars.includes(char));
|
|
334
|
+
}
|
|
335
|
+
function setUserCodeMetadata(ctx, userId, userCode) {
|
|
336
|
+
const statusValue = UserCodeCCValues.userIdStatus(userId);
|
|
337
|
+
const codeValue = UserCodeCCValues.userCode(userId);
|
|
338
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
339
|
+
const supportedUserIDStatuses = this.getValue(ctx, UserCodeCCValues.supportedUserIDStatuses)
|
|
340
|
+
?? (ccVersion === 1
|
|
341
|
+
? [
|
|
342
|
+
UserIDStatus.Available,
|
|
343
|
+
UserIDStatus.Enabled,
|
|
344
|
+
UserIDStatus.Disabled,
|
|
345
|
+
]
|
|
346
|
+
: [
|
|
347
|
+
UserIDStatus.Available,
|
|
348
|
+
UserIDStatus.Enabled,
|
|
349
|
+
UserIDStatus.Disabled,
|
|
350
|
+
UserIDStatus.Messaging,
|
|
351
|
+
UserIDStatus.PassageMode,
|
|
352
|
+
]);
|
|
353
|
+
this.ensureMetadata(ctx, statusValue, {
|
|
354
|
+
...statusValue.meta,
|
|
355
|
+
states: enumValuesToMetadataStates(UserIDStatus, supportedUserIDStatuses),
|
|
356
|
+
});
|
|
357
|
+
const codeMetadata = {
|
|
358
|
+
...(isUint8Array(userCode)
|
|
359
|
+
? ValueMetadata.Buffer
|
|
360
|
+
: ValueMetadata.String),
|
|
361
|
+
minLength: 4,
|
|
362
|
+
maxLength: 10,
|
|
363
|
+
label: `User Code (${userId})`,
|
|
364
|
+
};
|
|
365
|
+
if (this.getMetadata(ctx, codeValue)?.type !== codeMetadata.type) {
|
|
366
|
+
this.setMetadata(ctx, codeValue, codeMetadata);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function persistUserCode(ctx, userId, userIdStatus, userCode) {
|
|
370
|
+
const statusValue = UserCodeCCValues.userIdStatus(userId);
|
|
371
|
+
const codeValue = UserCodeCCValues.userCode(userId);
|
|
372
|
+
// Check if this code is supported
|
|
373
|
+
if (userIdStatus === UserIDStatus.StatusNotAvailable) {
|
|
374
|
+
// It is not, remove all values if any exist
|
|
375
|
+
this.removeValue(ctx, statusValue);
|
|
376
|
+
this.removeValue(ctx, codeValue);
|
|
377
|
+
this.removeMetadata(ctx, statusValue);
|
|
378
|
+
this.removeMetadata(ctx, codeValue);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
// Always create metadata in case it does not exist
|
|
382
|
+
setUserCodeMetadata.call(this, ctx, userId, userCode);
|
|
383
|
+
this.setValue(ctx, statusValue, userIdStatus);
|
|
384
|
+
this.setValue(ctx, codeValue, userCode);
|
|
385
|
+
}
|
|
386
|
+
return true;
|
|
387
|
+
}
|
|
388
|
+
/** Formats a user code in a way that's safe to print in public logs */
|
|
389
|
+
export function userCodeToLogString(userCode) {
|
|
390
|
+
if (userCode.length === 0)
|
|
391
|
+
return "(empty)";
|
|
392
|
+
return "*".repeat(userCode.length);
|
|
393
|
+
}
|
|
394
|
+
let UserCodeCCAPI = class UserCodeCCAPI extends PhysicalCCAPI {
|
|
395
|
+
supportsCommand(cmd) {
|
|
396
|
+
switch (cmd) {
|
|
397
|
+
case UserCodeCommand.Get:
|
|
398
|
+
case UserCodeCommand.Set:
|
|
399
|
+
case UserCodeCommand.UsersNumberGet:
|
|
400
|
+
return true; // This is mandatory
|
|
401
|
+
case UserCodeCommand.CapabilitiesGet:
|
|
402
|
+
case UserCodeCommand.KeypadModeSet:
|
|
403
|
+
case UserCodeCommand.KeypadModeGet:
|
|
404
|
+
case UserCodeCommand.ExtendedUserCodeSet:
|
|
405
|
+
case UserCodeCommand.ExtendedUserCodeGet:
|
|
406
|
+
return this.version >= 2;
|
|
407
|
+
case UserCodeCommand.AdminCodeSet:
|
|
408
|
+
case UserCodeCommand.AdminCodeGet: {
|
|
409
|
+
if (this.version < 2)
|
|
410
|
+
return false;
|
|
411
|
+
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsAdminCode.endpoint(this.endpoint.index));
|
|
412
|
+
}
|
|
413
|
+
case UserCodeCommand.UserCodeChecksumGet: {
|
|
414
|
+
if (this.version < 2)
|
|
415
|
+
return false;
|
|
416
|
+
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsUserCodeChecksum.endpoint(this.endpoint.index));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return super.supportsCommand(cmd);
|
|
420
|
+
}
|
|
421
|
+
get [SET_VALUE]() {
|
|
422
|
+
return async function ({ property, propertyKey }, value) {
|
|
423
|
+
let result;
|
|
424
|
+
if (property === "keypadMode") {
|
|
425
|
+
if (typeof value !== "number") {
|
|
426
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
427
|
+
}
|
|
428
|
+
result = await this.setKeypadMode(value);
|
|
429
|
+
}
|
|
430
|
+
else if (property === "adminCode"
|
|
431
|
+
// Support devices that were interviewed before the rename to adminCode
|
|
432
|
+
|| property === "masterCode") {
|
|
433
|
+
if (typeof value !== "string") {
|
|
434
|
+
throwWrongValueType(this.ccId, property, "string", typeof value);
|
|
435
|
+
}
|
|
436
|
+
result = await this.setAdminCode(value);
|
|
437
|
+
}
|
|
438
|
+
else if (property === "userIdStatus") {
|
|
439
|
+
if (propertyKey == undefined) {
|
|
440
|
+
throwMissingPropertyKey(this.ccId, property);
|
|
441
|
+
}
|
|
442
|
+
else if (typeof propertyKey !== "number") {
|
|
443
|
+
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
444
|
+
}
|
|
445
|
+
if (typeof value !== "number") {
|
|
446
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
447
|
+
}
|
|
448
|
+
if (value === UserIDStatus.Available) {
|
|
449
|
+
// Clear Code
|
|
450
|
+
result = await this.clear(propertyKey);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
// We need to set the user code along with the status
|
|
454
|
+
const userCode = this.getValueDB().getValue(UserCodeCCValues.userCode(propertyKey).endpoint(this.endpoint.index));
|
|
455
|
+
result = await this.set(propertyKey, value, userCode);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
else if (property === "userCode") {
|
|
459
|
+
if (propertyKey == undefined) {
|
|
460
|
+
throwMissingPropertyKey(this.ccId, property);
|
|
461
|
+
}
|
|
462
|
+
else if (typeof propertyKey !== "number") {
|
|
463
|
+
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
464
|
+
}
|
|
465
|
+
if (typeof value !== "string" && !isUint8Array(value)) {
|
|
466
|
+
throwWrongValueType(this.ccId, property, "string or Buffer", typeof value);
|
|
467
|
+
}
|
|
468
|
+
// We need to set the user id status along with the code
|
|
469
|
+
let userIdStatus = this.getValueDB().getValue(UserCodeCCValues.userIdStatus(propertyKey).endpoint(this.endpoint.index));
|
|
470
|
+
if (userIdStatus === UserIDStatus.Available
|
|
471
|
+
|| userIdStatus == undefined) {
|
|
472
|
+
userIdStatus = UserIDStatus.Enabled;
|
|
473
|
+
}
|
|
474
|
+
result = await this.set(propertyKey, userIdStatus, value);
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
478
|
+
}
|
|
479
|
+
// Verify the change after a short delay, unless the command was supervised and successful
|
|
480
|
+
if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
|
|
481
|
+
this.schedulePoll({ property, propertyKey }, value, {
|
|
482
|
+
transition: "fast",
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
return result;
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
get [POLL_VALUE]() {
|
|
489
|
+
return async function ({ property, propertyKey }) {
|
|
490
|
+
switch (property) {
|
|
491
|
+
case "keypadMode":
|
|
492
|
+
return this.getKeypadMode();
|
|
493
|
+
case "adminCode":
|
|
494
|
+
return this.getAdminCode();
|
|
495
|
+
case "userIdStatus":
|
|
496
|
+
case "userCode": {
|
|
497
|
+
if (propertyKey == undefined) {
|
|
498
|
+
throwMissingPropertyKey(this.ccId, property);
|
|
499
|
+
}
|
|
500
|
+
else if (typeof propertyKey !== "number") {
|
|
501
|
+
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
502
|
+
}
|
|
503
|
+
return (await this.get(propertyKey))?.[property];
|
|
504
|
+
}
|
|
505
|
+
default:
|
|
506
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
async getUsersCount() {
|
|
511
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UsersNumberGet);
|
|
512
|
+
const cc = new UserCodeCCUsersNumberGet({
|
|
513
|
+
nodeId: this.endpoint.nodeId,
|
|
514
|
+
endpointIndex: this.endpoint.index,
|
|
515
|
+
});
|
|
516
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
517
|
+
return response?.supportedUsers;
|
|
518
|
+
}
|
|
519
|
+
async get(userId, multiple = false) {
|
|
520
|
+
__assertType("userId", "number", __assertType__number.bind(void 0, userId));
|
|
521
|
+
__assertType("multiple", "(optional) boolean", __assertType__optional_boolean.bind(void 0, multiple));
|
|
522
|
+
if (userId > 255 || multiple) {
|
|
523
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeGet);
|
|
524
|
+
const cc = new UserCodeCCExtendedUserCodeGet({
|
|
525
|
+
nodeId: this.endpoint.nodeId,
|
|
526
|
+
endpointIndex: this.endpoint.index,
|
|
527
|
+
userId,
|
|
528
|
+
reportMore: multiple,
|
|
529
|
+
});
|
|
530
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
531
|
+
if (!response) {
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
else if (multiple) {
|
|
535
|
+
return pick(response, ["userCodes", "nextUserId"]);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
return pick(response.userCodes[0], [
|
|
539
|
+
"userIdStatus",
|
|
540
|
+
"userCode",
|
|
541
|
+
]);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Get);
|
|
546
|
+
const cc = new UserCodeCCGet({
|
|
547
|
+
nodeId: this.endpoint.nodeId,
|
|
548
|
+
endpointIndex: this.endpoint.index,
|
|
549
|
+
userId,
|
|
550
|
+
});
|
|
551
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
552
|
+
if (response)
|
|
553
|
+
return pick(response, ["userIdStatus", "userCode"]);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/** Configures a single user code */
|
|
557
|
+
async set(userId, userIdStatus, userCode) {
|
|
558
|
+
__assertType("userId", "number", __assertType__number.bind(void 0, userId));
|
|
559
|
+
__assertType("userIdStatus", undefined, __assertType__su__1__2__3__4_eu.bind(void 0, userIdStatus));
|
|
560
|
+
__assertType("userCode", undefined, __assertType__su__string__uint8array_eu.bind(void 0, userCode));
|
|
561
|
+
if (userId > 255) {
|
|
562
|
+
return this.setMany([{ userId, userIdStatus, userCode }]);
|
|
563
|
+
}
|
|
564
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);
|
|
565
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
566
|
+
if (numUsers != undefined && userId > numUsers) {
|
|
567
|
+
throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);
|
|
568
|
+
}
|
|
569
|
+
const cc = new UserCodeCCSet({
|
|
570
|
+
nodeId: this.endpoint.nodeId,
|
|
571
|
+
endpointIndex: this.endpoint.index,
|
|
572
|
+
userId,
|
|
573
|
+
userIdStatus,
|
|
574
|
+
userCode,
|
|
575
|
+
});
|
|
576
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
577
|
+
}
|
|
578
|
+
/** Configures multiple user codes */
|
|
579
|
+
async setMany(codes) {
|
|
580
|
+
__assertType("codes", undefined, __assertType__sa_su__3__4__5_eu_ea_2.bind(void 0, codes));
|
|
581
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.ExtendedUserCodeSet);
|
|
582
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
583
|
+
const supportedStatuses = UserCodeCC.getSupportedUserIDStatusesCached(this.host, this.endpoint);
|
|
584
|
+
const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);
|
|
585
|
+
const supportsMultipleUserCodeSet = UserCodeCC.supportsMultipleUserCodeSetCached(this.host, this.endpoint) ?? false;
|
|
586
|
+
// Validate options
|
|
587
|
+
if (numUsers != undefined) {
|
|
588
|
+
if (codes.some((code) => code.userId < 0 || code.userId > numUsers)) {
|
|
589
|
+
throw new ZWaveError(`All User IDs must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
if (codes.some((code) => code.userId < 0)) {
|
|
594
|
+
throw new ZWaveError(`All User IDs must be greater than 0.`, ZWaveErrorCodes.Argument_Invalid);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (codes.some((code) => code.userId === 0) && codes.length > 1) {
|
|
598
|
+
throw new ZWaveError(`If user ID 0 is used, only one code may be set`, ZWaveErrorCodes.Argument_Invalid);
|
|
599
|
+
}
|
|
600
|
+
else if (codes.some((code) => code.userId === 0
|
|
601
|
+
&& code.userIdStatus !== UserIDStatus.Available)) {
|
|
602
|
+
throw new ZWaveError(`User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);
|
|
603
|
+
}
|
|
604
|
+
else if (codes.length > 1 && !supportsMultipleUserCodeSet) {
|
|
605
|
+
throw new ZWaveError(`The node does not support setting multiple user codes at once`, ZWaveErrorCodes.Argument_Invalid);
|
|
606
|
+
}
|
|
607
|
+
for (const code of codes) {
|
|
608
|
+
if (supportedStatuses != undefined
|
|
609
|
+
&& !supportedStatuses.includes(code.userIdStatus)) {
|
|
610
|
+
throw new ZWaveError(`The user ID status ${getEnumMemberName(UserIDStatus, code.userIdStatus)} is not supported by the node`, ZWaveErrorCodes.Argument_Invalid);
|
|
611
|
+
}
|
|
612
|
+
else if (code.userIdStatus === UserIDStatus.Available) {
|
|
613
|
+
code.userCode = undefined;
|
|
614
|
+
}
|
|
615
|
+
else if (supportedASCIIChars) {
|
|
616
|
+
const userCodeString = typeof code.userCode === "string"
|
|
617
|
+
? code.userCode
|
|
618
|
+
: uint8ArrayToString(code.userCode);
|
|
619
|
+
if (!validateCode(userCodeString, supportedASCIIChars)) {
|
|
620
|
+
throw new ZWaveError(`The user code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
const cc = new UserCodeCCExtendedUserCodeSet({
|
|
625
|
+
nodeId: this.endpoint.nodeId,
|
|
626
|
+
endpointIndex: this.endpoint.index,
|
|
627
|
+
userCodes: codes,
|
|
628
|
+
});
|
|
629
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Clears one or all user code
|
|
633
|
+
* @param userId The user code to clear. If none or 0 is given, all codes are cleared
|
|
634
|
+
*/
|
|
635
|
+
async clear(userId = 0) {
|
|
636
|
+
__assertType("userId", "(optional) number", __assertType__optional_number.bind(void 0, userId));
|
|
637
|
+
if (this.version > 1 || userId > 255) {
|
|
638
|
+
return this.setMany([
|
|
639
|
+
{ userId, userIdStatus: UserIDStatus.Available },
|
|
640
|
+
]);
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.Set);
|
|
644
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
645
|
+
if (numUsers != undefined && userId > numUsers) {
|
|
646
|
+
throw new ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, ZWaveErrorCodes.Argument_Invalid);
|
|
647
|
+
}
|
|
648
|
+
const cc = new UserCodeCCSet({
|
|
649
|
+
nodeId: this.endpoint.nodeId,
|
|
650
|
+
endpointIndex: this.endpoint.index,
|
|
651
|
+
userId,
|
|
652
|
+
userIdStatus: UserIDStatus.Available,
|
|
653
|
+
});
|
|
654
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
658
|
+
async getCapabilities() {
|
|
659
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.CapabilitiesGet);
|
|
660
|
+
const cc = new UserCodeCCCapabilitiesGet({
|
|
661
|
+
nodeId: this.endpoint.nodeId,
|
|
662
|
+
endpointIndex: this.endpoint.index,
|
|
663
|
+
});
|
|
664
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
665
|
+
if (response) {
|
|
666
|
+
return pick(response, [
|
|
667
|
+
"supportsAdminCode",
|
|
668
|
+
"supportsAdminCodeDeactivation",
|
|
669
|
+
"supportsUserCodeChecksum",
|
|
670
|
+
"supportsMultipleUserCodeReport",
|
|
671
|
+
"supportsMultipleUserCodeSet",
|
|
672
|
+
"supportedUserIDStatuses",
|
|
673
|
+
"supportedKeypadModes",
|
|
674
|
+
"supportedASCIIChars",
|
|
675
|
+
]);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
async getKeypadMode() {
|
|
679
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeGet);
|
|
680
|
+
const cc = new UserCodeCCKeypadModeGet({
|
|
681
|
+
nodeId: this.endpoint.nodeId,
|
|
682
|
+
endpointIndex: this.endpoint.index,
|
|
683
|
+
});
|
|
684
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
685
|
+
return response?.keypadMode;
|
|
686
|
+
}
|
|
687
|
+
async setKeypadMode(keypadMode) {
|
|
688
|
+
__assertType("keypadMode", "KeypadMode", __assertType__KeypadMode.bind(void 0, keypadMode));
|
|
689
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.KeypadModeSet);
|
|
690
|
+
const supportedModes = UserCodeCC.getSupportedKeypadModesCached(this.host, this.endpoint);
|
|
691
|
+
if (!supportedModes) {
|
|
692
|
+
throw new ZWaveError(`The keypad mode can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);
|
|
693
|
+
}
|
|
694
|
+
else if (!supportedModes.includes(keypadMode)) {
|
|
695
|
+
throw new ZWaveError(`The keypad mode ${getEnumMemberName(KeypadMode, keypadMode)} is not supported by the node!`, ZWaveErrorCodes.Argument_Invalid);
|
|
696
|
+
}
|
|
697
|
+
const cc = new UserCodeCCKeypadModeSet({
|
|
698
|
+
nodeId: this.endpoint.nodeId,
|
|
699
|
+
endpointIndex: this.endpoint.index,
|
|
700
|
+
keypadMode,
|
|
701
|
+
});
|
|
702
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
703
|
+
}
|
|
704
|
+
async getAdminCode() {
|
|
705
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeGet);
|
|
706
|
+
const cc = new UserCodeCCAdminCodeGet({
|
|
707
|
+
nodeId: this.endpoint.nodeId,
|
|
708
|
+
endpointIndex: this.endpoint.index,
|
|
709
|
+
});
|
|
710
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
711
|
+
return response?.adminCode;
|
|
712
|
+
}
|
|
713
|
+
async setAdminCode(adminCode) {
|
|
714
|
+
__assertType("adminCode", "string", __assertType__string.bind(void 0, adminCode));
|
|
715
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.AdminCodeSet);
|
|
716
|
+
const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);
|
|
717
|
+
if (!supportedASCIIChars) {
|
|
718
|
+
throw new ZWaveError(`The admin code can only be set after the interview is complete!`, ZWaveErrorCodes.Argument_Invalid);
|
|
719
|
+
}
|
|
720
|
+
// Validate the code
|
|
721
|
+
if (!adminCode) {
|
|
722
|
+
const supportsDeactivation = UserCodeCC
|
|
723
|
+
.supportsAdminCodeDeactivationCached(this.host, this.endpoint);
|
|
724
|
+
if (!supportsDeactivation) {
|
|
725
|
+
throw new ZWaveError(`The node does not support deactivating the admin code!`, ZWaveErrorCodes.Argument_Invalid);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
else if (!validateCode(adminCode, supportedASCIIChars)) {
|
|
729
|
+
throw new ZWaveError(`The admin code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, ZWaveErrorCodes.Argument_Invalid);
|
|
730
|
+
}
|
|
731
|
+
const cc = new UserCodeCCAdminCodeSet({
|
|
732
|
+
nodeId: this.endpoint.nodeId,
|
|
733
|
+
endpointIndex: this.endpoint.index,
|
|
734
|
+
adminCode,
|
|
735
|
+
});
|
|
736
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
737
|
+
}
|
|
738
|
+
async getUserCodeChecksum() {
|
|
739
|
+
this.assertSupportsCommand(UserCodeCommand, UserCodeCommand.UserCodeChecksumGet);
|
|
740
|
+
const cc = new UserCodeCCUserCodeChecksumGet({
|
|
741
|
+
nodeId: this.endpoint.nodeId,
|
|
742
|
+
endpointIndex: this.endpoint.index,
|
|
743
|
+
});
|
|
744
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
745
|
+
return response?.userCodeChecksum;
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
UserCodeCCAPI = __decorate([
|
|
749
|
+
API(CommandClasses["User Code"])
|
|
750
|
+
], UserCodeCCAPI);
|
|
751
|
+
export { UserCodeCCAPI };
|
|
752
|
+
let UserCodeCC = UserCodeCC_1 = class UserCodeCC extends CommandClass {
|
|
753
|
+
async interview(ctx) {
|
|
754
|
+
const node = this.getNode(ctx);
|
|
755
|
+
const endpoint = this.getEndpoint(ctx);
|
|
756
|
+
const api = CCAPI.create(CommandClasses["User Code"], ctx, endpoint).withOptions({
|
|
757
|
+
priority: MessagePriority.NodeQuery,
|
|
758
|
+
});
|
|
759
|
+
ctx.logNode(node.id, {
|
|
760
|
+
endpoint: this.endpointIndex,
|
|
761
|
+
message: `Interviewing ${this.ccName}...`,
|
|
762
|
+
direction: "none",
|
|
763
|
+
});
|
|
764
|
+
// Query capabilities first to determine what needs to be done when refreshing
|
|
765
|
+
if (api.version >= 2) {
|
|
766
|
+
ctx.logNode(node.id, {
|
|
767
|
+
message: "querying capabilities...",
|
|
768
|
+
direction: "outbound",
|
|
769
|
+
});
|
|
770
|
+
const caps = await api.getCapabilities();
|
|
771
|
+
if (!caps) {
|
|
772
|
+
ctx.logNode(node.id, {
|
|
773
|
+
endpoint: this.endpointIndex,
|
|
774
|
+
message: "User Code capabilities query timed out, skipping interview...",
|
|
775
|
+
level: "warn",
|
|
776
|
+
});
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
ctx.logNode(node.id, {
|
|
781
|
+
message: "querying number of user codes...",
|
|
782
|
+
direction: "outbound",
|
|
783
|
+
});
|
|
784
|
+
const supportedUsers = await api.getUsersCount();
|
|
785
|
+
if (supportedUsers == undefined) {
|
|
786
|
+
ctx.logNode(node.id, {
|
|
787
|
+
endpoint: this.endpointIndex,
|
|
788
|
+
message: "Querying number of user codes timed out, skipping interview...",
|
|
789
|
+
level: "warn",
|
|
790
|
+
});
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
794
|
+
setUserCodeMetadata.call(this, ctx, userId);
|
|
795
|
+
}
|
|
796
|
+
// Synchronize user codes and settings
|
|
797
|
+
if (ctx.getInterviewOptions()?.queryAllUserCodes) {
|
|
798
|
+
await this.refreshValues(ctx);
|
|
799
|
+
}
|
|
800
|
+
// Remember that the interview is complete
|
|
801
|
+
this.setInterviewComplete(ctx, true);
|
|
802
|
+
}
|
|
803
|
+
async refreshValues(ctx) {
|
|
804
|
+
const node = this.getNode(ctx);
|
|
805
|
+
const endpoint = this.getEndpoint(ctx);
|
|
806
|
+
const api = CCAPI.create(CommandClasses["User Code"], ctx, endpoint).withOptions({
|
|
807
|
+
priority: MessagePriority.NodeQuery,
|
|
808
|
+
});
|
|
809
|
+
const supportsAdminCode = UserCodeCC_1.supportsAdminCodeCached(ctx, endpoint);
|
|
810
|
+
const supportsUserCodeChecksum = this.getValue(ctx, UserCodeCCValues.supportsUserCodeChecksum) ?? false;
|
|
811
|
+
const supportedKeypadModes = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes)
|
|
812
|
+
?? [];
|
|
813
|
+
const supportedUsers = this.getValue(ctx, UserCodeCCValues.supportedUsers) ?? 0;
|
|
814
|
+
const supportsMultipleUserCodeReport = !!this.getValue(ctx, UserCodeCCValues.supportsMultipleUserCodeReport);
|
|
815
|
+
// Check for changed values and codes
|
|
816
|
+
if (api.version >= 2) {
|
|
817
|
+
if (supportsAdminCode) {
|
|
818
|
+
ctx.logNode(node.id, {
|
|
819
|
+
message: "querying admin code...",
|
|
820
|
+
direction: "outbound",
|
|
821
|
+
});
|
|
822
|
+
await api.getAdminCode();
|
|
823
|
+
}
|
|
824
|
+
if (supportedKeypadModes.length > 1) {
|
|
825
|
+
ctx.logNode(node.id, {
|
|
826
|
+
message: "querying active keypad mode...",
|
|
827
|
+
direction: "outbound",
|
|
828
|
+
});
|
|
829
|
+
await api.getKeypadMode();
|
|
830
|
+
}
|
|
831
|
+
const storedUserCodeChecksum = this.getValue(ctx, UserCodeCCValues.userCodeChecksum) ?? 0;
|
|
832
|
+
let currentUserCodeChecksum = 0;
|
|
833
|
+
if (supportsUserCodeChecksum) {
|
|
834
|
+
ctx.logNode(node.id, {
|
|
835
|
+
message: "retrieving current user code checksum...",
|
|
836
|
+
direction: "outbound",
|
|
837
|
+
});
|
|
838
|
+
currentUserCodeChecksum = await api.getUserCodeChecksum();
|
|
839
|
+
}
|
|
840
|
+
if (!supportsUserCodeChecksum
|
|
841
|
+
|| currentUserCodeChecksum !== storedUserCodeChecksum) {
|
|
842
|
+
ctx.logNode(node.id, {
|
|
843
|
+
message: "checksum changed or is not supported, querying all user codes...",
|
|
844
|
+
direction: "outbound",
|
|
845
|
+
});
|
|
846
|
+
if (supportsMultipleUserCodeReport) {
|
|
847
|
+
// Query the user codes in bulk
|
|
848
|
+
let nextUserId = 1;
|
|
849
|
+
while (nextUserId > 0 && nextUserId <= supportedUsers) {
|
|
850
|
+
const response = await api.get(nextUserId, true);
|
|
851
|
+
if (response) {
|
|
852
|
+
nextUserId = response.nextUserId;
|
|
853
|
+
}
|
|
854
|
+
else {
|
|
855
|
+
ctx.logNode(node.id, {
|
|
856
|
+
endpoint: this.endpointIndex,
|
|
857
|
+
message: `Querying user code #${nextUserId} timed out, skipping the remaining interview...`,
|
|
858
|
+
level: "warn",
|
|
859
|
+
});
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
// Query one user code at a time
|
|
866
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
867
|
+
await api.get(userId);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
// V1
|
|
874
|
+
ctx.logNode(node.id, {
|
|
875
|
+
message: "querying all user codes...",
|
|
876
|
+
direction: "outbound",
|
|
877
|
+
});
|
|
878
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
879
|
+
await api.get(userId);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Returns the number of supported users.
|
|
885
|
+
* This only works AFTER the interview process
|
|
886
|
+
*/
|
|
887
|
+
static getSupportedUsersCached(ctx, endpoint) {
|
|
888
|
+
return ctx
|
|
889
|
+
.getValueDB(endpoint.nodeId)
|
|
890
|
+
.getValue(UserCodeCCValues.supportedUsers.endpoint(endpoint.index));
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Returns the supported keypad modes.
|
|
894
|
+
* This only works AFTER the interview process
|
|
895
|
+
*/
|
|
896
|
+
static getSupportedKeypadModesCached(ctx, endpoint) {
|
|
897
|
+
return ctx
|
|
898
|
+
.getValueDB(endpoint.nodeId)
|
|
899
|
+
.getValue(UserCodeCCValues.supportedKeypadModes.endpoint(endpoint.index));
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Returns the supported user ID statuses.
|
|
903
|
+
* This only works AFTER the interview process
|
|
904
|
+
*/
|
|
905
|
+
static getSupportedUserIDStatusesCached(ctx, endpoint) {
|
|
906
|
+
return ctx
|
|
907
|
+
.getValueDB(endpoint.nodeId)
|
|
908
|
+
.getValue(UserCodeCCValues.supportedUserIDStatuses.endpoint(endpoint.index));
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Returns the supported ASCII characters.
|
|
912
|
+
* This only works AFTER the interview process
|
|
913
|
+
*/
|
|
914
|
+
static getSupportedASCIICharsCached(ctx, endpoint) {
|
|
915
|
+
return ctx
|
|
916
|
+
.getValueDB(endpoint.nodeId)
|
|
917
|
+
.getValue(UserCodeCCValues.supportedASCIIChars.endpoint(endpoint.index));
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Returns whether the admin code functionality is supported.
|
|
921
|
+
* This only works AFTER the interview process
|
|
922
|
+
*/
|
|
923
|
+
static supportsAdminCodeCached(ctx, endpoint) {
|
|
924
|
+
const valueDB = ctx
|
|
925
|
+
.getValueDB(endpoint.nodeId);
|
|
926
|
+
return valueDB.getValue(UserCodeCCValues.supportsAdminCode.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCode.endpoint(endpoint.index)) ?? false;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Returns whether deactivating the admin code is supported.
|
|
930
|
+
* This only works AFTER the interview process
|
|
931
|
+
*/
|
|
932
|
+
static supportsAdminCodeDeactivationCached(ctx, endpoint) {
|
|
933
|
+
const valueDB = ctx
|
|
934
|
+
.getValueDB(endpoint.nodeId);
|
|
935
|
+
return valueDB.getValue(UserCodeCCValues.supportsAdminCodeDeactivation.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCodeDeactivation
|
|
936
|
+
.endpoint(endpoint.index)) ?? false;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Returns whether setting multiple user codes at once is supported.
|
|
940
|
+
* This only works AFTER the interview process
|
|
941
|
+
*/
|
|
942
|
+
static supportsMultipleUserCodeSetCached(ctx, endpoint) {
|
|
943
|
+
return !!ctx
|
|
944
|
+
.getValueDB(endpoint.nodeId)
|
|
945
|
+
.getValue(UserCodeCCValues.supportsMultipleUserCodeSet.endpoint(endpoint.index));
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Returns the current status of a user ID.
|
|
949
|
+
* This only works AFTER the user IDs have been queried.
|
|
950
|
+
*/
|
|
951
|
+
static getUserIdStatusCached(ctx, endpoint, userId) {
|
|
952
|
+
return ctx
|
|
953
|
+
.getValueDB(endpoint.nodeId)
|
|
954
|
+
.getValue(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index));
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Returns the current code belonging to a user ID.
|
|
958
|
+
* This only works AFTER the user IDs have been queried.
|
|
959
|
+
*/
|
|
960
|
+
static getUserCodeCached(ctx, endpoint, userId) {
|
|
961
|
+
return ctx
|
|
962
|
+
.getValueDB(endpoint.nodeId)
|
|
963
|
+
.getValue(UserCodeCCValues.userCode(userId).endpoint(endpoint.index));
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
UserCodeCC = UserCodeCC_1 = __decorate([
|
|
967
|
+
commandClass(CommandClasses["User Code"]),
|
|
968
|
+
implementedVersion(2),
|
|
969
|
+
ccValues(UserCodeCCValues)
|
|
970
|
+
], UserCodeCC);
|
|
971
|
+
export { UserCodeCC };
|
|
972
|
+
let UserCodeCCSet = UserCodeCCSet_1 = class UserCodeCCSet extends UserCodeCC {
|
|
973
|
+
constructor(options) {
|
|
974
|
+
super(options);
|
|
975
|
+
this.userId = options.userId;
|
|
976
|
+
this.userIdStatus = options.userIdStatus;
|
|
977
|
+
// Validate options
|
|
978
|
+
if (this.userId < 0) {
|
|
979
|
+
throw new ZWaveError(`${this.constructor.name}: The user ID must be between greater than 0.`, ZWaveErrorCodes.Argument_Invalid);
|
|
980
|
+
}
|
|
981
|
+
else if (this.userId === 0
|
|
982
|
+
&& this.userIdStatus !== UserIDStatus.Available) {
|
|
983
|
+
throw new ZWaveError(`${this.constructor.name}: User ID 0 may only be used to clear all user codes`, ZWaveErrorCodes.Argument_Invalid);
|
|
984
|
+
}
|
|
985
|
+
else if (this.userIdStatus === UserIDStatus.Available) {
|
|
986
|
+
this.userCode = "\0".repeat(4);
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
this.userCode = options.userCode;
|
|
990
|
+
// Specs say ASCII 0-9, manufacturers don't care :)
|
|
991
|
+
if (this.userCode.length < 4 || this.userCode.length > 10) {
|
|
992
|
+
throw new ZWaveError(`${this.constructor.name}: The user code must have a length of 4 to 10 ${typeof this.userCode === "string"
|
|
993
|
+
? "characters"
|
|
994
|
+
: "bytes"}`, ZWaveErrorCodes.Argument_Invalid);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
static from(raw, ctx) {
|
|
999
|
+
validatePayload(raw.payload.length >= 2);
|
|
1000
|
+
const userId = raw.payload[0];
|
|
1001
|
+
const userIdStatus = raw.payload[1];
|
|
1002
|
+
if (userIdStatus === UserIDStatus.StatusNotAvailable) {
|
|
1003
|
+
validatePayload.fail("Invalid user ID status");
|
|
1004
|
+
}
|
|
1005
|
+
if (userIdStatus === UserIDStatus.Available) {
|
|
1006
|
+
return new UserCodeCCSet_1({
|
|
1007
|
+
nodeId: ctx.sourceNodeId,
|
|
1008
|
+
userId,
|
|
1009
|
+
userIdStatus,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
const userCode = raw.payload.subarray(2);
|
|
1013
|
+
return new UserCodeCCSet_1({
|
|
1014
|
+
nodeId: ctx.sourceNodeId,
|
|
1015
|
+
userId,
|
|
1016
|
+
userIdStatus,
|
|
1017
|
+
userCode,
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
userId;
|
|
1021
|
+
userIdStatus;
|
|
1022
|
+
userCode;
|
|
1023
|
+
serialize(ctx) {
|
|
1024
|
+
this.payload = Bytes.concat([
|
|
1025
|
+
Bytes.from([this.userId, this.userIdStatus]),
|
|
1026
|
+
typeof this.userCode === "string"
|
|
1027
|
+
? Bytes.from(this.userCode, "ascii")
|
|
1028
|
+
: this.userCode,
|
|
1029
|
+
]);
|
|
1030
|
+
return super.serialize(ctx);
|
|
1031
|
+
}
|
|
1032
|
+
toLogEntry(ctx) {
|
|
1033
|
+
return {
|
|
1034
|
+
...super.toLogEntry(ctx),
|
|
1035
|
+
message: {
|
|
1036
|
+
"user id": this.userId,
|
|
1037
|
+
"id status": getEnumMemberName(UserIDStatus, this.userIdStatus),
|
|
1038
|
+
"user code": userCodeToLogString(this.userCode),
|
|
1039
|
+
},
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
UserCodeCCSet = UserCodeCCSet_1 = __decorate([
|
|
1044
|
+
CCCommand(UserCodeCommand.Set),
|
|
1045
|
+
useSupervision()
|
|
1046
|
+
], UserCodeCCSet);
|
|
1047
|
+
export { UserCodeCCSet };
|
|
1048
|
+
let UserCodeCCReport = UserCodeCCReport_1 = class UserCodeCCReport extends UserCodeCC {
|
|
1049
|
+
constructor(options) {
|
|
1050
|
+
super(options);
|
|
1051
|
+
this.userId = options.userId;
|
|
1052
|
+
this.userIdStatus = options.userIdStatus;
|
|
1053
|
+
this.userCode = options.userCode ?? "";
|
|
1054
|
+
}
|
|
1055
|
+
static from(raw, ctx) {
|
|
1056
|
+
validatePayload(raw.payload.length >= 2);
|
|
1057
|
+
const userId = raw.payload[0];
|
|
1058
|
+
const userIdStatus = raw.payload[1];
|
|
1059
|
+
let userCode;
|
|
1060
|
+
if (raw.payload.length === 2
|
|
1061
|
+
&& (userIdStatus === UserIDStatus.Available
|
|
1062
|
+
|| userIdStatus === UserIDStatus.StatusNotAvailable)) {
|
|
1063
|
+
// The user code is not set or not available and this report contains no user code
|
|
1064
|
+
userCode = "";
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
// The specs require the user code to be at least 4 digits
|
|
1068
|
+
validatePayload(raw.payload.length >= 6);
|
|
1069
|
+
let userCodeBuffer = raw.payload.subarray(2);
|
|
1070
|
+
// Specs say infer user code from payload length, manufacturers send zero-padded strings
|
|
1071
|
+
while (userCodeBuffer.at(-1) === 0) {
|
|
1072
|
+
userCodeBuffer = userCodeBuffer.subarray(0, -1);
|
|
1073
|
+
}
|
|
1074
|
+
// Specs say ASCII 0-9, manufacturers don't care :)
|
|
1075
|
+
// Thus we check if the code is printable using ASCII, if not keep it as a Buffer
|
|
1076
|
+
const userCodeString = userCodeBuffer.toString("utf8");
|
|
1077
|
+
if (isPrintableASCII(userCodeString)) {
|
|
1078
|
+
userCode = userCodeString;
|
|
1079
|
+
}
|
|
1080
|
+
else if (isPrintableASCIIWithWhitespace(userCodeString)) {
|
|
1081
|
+
// Ignore leading and trailing whitespace in V1 reports if the rest is ASCII
|
|
1082
|
+
userCode = userCodeString.trim();
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
userCode = userCodeBuffer;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
return new UserCodeCCReport_1({
|
|
1089
|
+
nodeId: ctx.sourceNodeId,
|
|
1090
|
+
userId,
|
|
1091
|
+
userIdStatus,
|
|
1092
|
+
userCode,
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
userId;
|
|
1096
|
+
userIdStatus;
|
|
1097
|
+
userCode;
|
|
1098
|
+
persistValues(ctx) {
|
|
1099
|
+
if (!super.persistValues(ctx))
|
|
1100
|
+
return false;
|
|
1101
|
+
persistUserCode.call(this, ctx, this.userId, this.userIdStatus, this.userCode);
|
|
1102
|
+
return true;
|
|
1103
|
+
}
|
|
1104
|
+
serialize(ctx) {
|
|
1105
|
+
let userCodeBuffer;
|
|
1106
|
+
if (typeof this.userCode === "string") {
|
|
1107
|
+
userCodeBuffer = Bytes.from(this.userCode, "ascii");
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
userCodeBuffer = this.userCode;
|
|
1111
|
+
}
|
|
1112
|
+
this.payload = Bytes.concat([
|
|
1113
|
+
Bytes.from([this.userId, this.userIdStatus]),
|
|
1114
|
+
userCodeBuffer,
|
|
1115
|
+
]);
|
|
1116
|
+
return super.serialize(ctx);
|
|
1117
|
+
}
|
|
1118
|
+
toLogEntry(ctx) {
|
|
1119
|
+
return {
|
|
1120
|
+
...super.toLogEntry(ctx),
|
|
1121
|
+
message: {
|
|
1122
|
+
"user id": this.userId,
|
|
1123
|
+
"id status": getEnumMemberName(UserIDStatus, this.userIdStatus),
|
|
1124
|
+
"user code": userCodeToLogString(this.userCode),
|
|
1125
|
+
},
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1129
|
+
toNotificationEventParameters() {
|
|
1130
|
+
return { userId: this.userId };
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
UserCodeCCReport = UserCodeCCReport_1 = __decorate([
|
|
1134
|
+
CCCommand(UserCodeCommand.Report)
|
|
1135
|
+
], UserCodeCCReport);
|
|
1136
|
+
export { UserCodeCCReport };
|
|
1137
|
+
let UserCodeCCGet = UserCodeCCGet_1 = class UserCodeCCGet extends UserCodeCC {
|
|
1138
|
+
constructor(options) {
|
|
1139
|
+
super(options);
|
|
1140
|
+
this.userId = options.userId;
|
|
1141
|
+
}
|
|
1142
|
+
static from(raw, ctx) {
|
|
1143
|
+
validatePayload(raw.payload.length >= 1);
|
|
1144
|
+
const userId = raw.payload[0];
|
|
1145
|
+
return new UserCodeCCGet_1({
|
|
1146
|
+
nodeId: ctx.sourceNodeId,
|
|
1147
|
+
userId,
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
userId;
|
|
1151
|
+
serialize(ctx) {
|
|
1152
|
+
this.payload = Bytes.from([this.userId]);
|
|
1153
|
+
return super.serialize(ctx);
|
|
1154
|
+
}
|
|
1155
|
+
toLogEntry(ctx) {
|
|
1156
|
+
return {
|
|
1157
|
+
...super.toLogEntry(ctx),
|
|
1158
|
+
message: { "user id": this.userId },
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1162
|
+
UserCodeCCGet = UserCodeCCGet_1 = __decorate([
|
|
1163
|
+
CCCommand(UserCodeCommand.Get),
|
|
1164
|
+
expectedCCResponse(UserCodeCCReport)
|
|
1165
|
+
], UserCodeCCGet);
|
|
1166
|
+
export { UserCodeCCGet };
|
|
1167
|
+
let UserCodeCCUsersNumberReport = UserCodeCCUsersNumberReport_1 = class UserCodeCCUsersNumberReport extends UserCodeCC {
|
|
1168
|
+
constructor(options) {
|
|
1169
|
+
super(options);
|
|
1170
|
+
this.supportedUsers = options.supportedUsers;
|
|
1171
|
+
}
|
|
1172
|
+
static from(raw, ctx) {
|
|
1173
|
+
validatePayload(raw.payload.length >= 1);
|
|
1174
|
+
let supportedUsers;
|
|
1175
|
+
if (raw.payload.length >= 3) {
|
|
1176
|
+
// V2+
|
|
1177
|
+
supportedUsers = raw.payload.readUInt16BE(1);
|
|
1178
|
+
}
|
|
1179
|
+
else {
|
|
1180
|
+
// V1
|
|
1181
|
+
supportedUsers = raw.payload[0];
|
|
1182
|
+
}
|
|
1183
|
+
return new UserCodeCCUsersNumberReport_1({
|
|
1184
|
+
nodeId: ctx.sourceNodeId,
|
|
1185
|
+
supportedUsers,
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
supportedUsers;
|
|
1189
|
+
serialize(ctx) {
|
|
1190
|
+
this.payload = new Bytes(3);
|
|
1191
|
+
// If the node implements more than 255 users, this field MUST be set to 255
|
|
1192
|
+
this.payload[0] = Math.min(255, this.supportedUsers);
|
|
1193
|
+
this.payload.writeUInt16BE(this.supportedUsers, 1);
|
|
1194
|
+
return super.serialize(ctx);
|
|
1195
|
+
}
|
|
1196
|
+
toLogEntry(ctx) {
|
|
1197
|
+
return {
|
|
1198
|
+
...super.toLogEntry(ctx),
|
|
1199
|
+
message: { "supported users": this.supportedUsers },
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
__decorate([
|
|
1204
|
+
ccValue(UserCodeCCValues.supportedUsers)
|
|
1205
|
+
], UserCodeCCUsersNumberReport.prototype, "supportedUsers", void 0);
|
|
1206
|
+
UserCodeCCUsersNumberReport = UserCodeCCUsersNumberReport_1 = __decorate([
|
|
1207
|
+
CCCommand(UserCodeCommand.UsersNumberReport)
|
|
1208
|
+
], UserCodeCCUsersNumberReport);
|
|
1209
|
+
export { UserCodeCCUsersNumberReport };
|
|
1210
|
+
let UserCodeCCUsersNumberGet = class UserCodeCCUsersNumberGet extends UserCodeCC {
|
|
1211
|
+
};
|
|
1212
|
+
UserCodeCCUsersNumberGet = __decorate([
|
|
1213
|
+
CCCommand(UserCodeCommand.UsersNumberGet),
|
|
1214
|
+
expectedCCResponse(UserCodeCCUsersNumberReport)
|
|
1215
|
+
], UserCodeCCUsersNumberGet);
|
|
1216
|
+
export { UserCodeCCUsersNumberGet };
|
|
1217
|
+
let UserCodeCCCapabilitiesReport = UserCodeCCCapabilitiesReport_1 = class UserCodeCCCapabilitiesReport extends UserCodeCC {
|
|
1218
|
+
constructor(options) {
|
|
1219
|
+
super(options);
|
|
1220
|
+
this.supportsAdminCode = options.supportsAdminCode;
|
|
1221
|
+
this.supportsAdminCodeDeactivation =
|
|
1222
|
+
options.supportsAdminCodeDeactivation;
|
|
1223
|
+
this.supportsUserCodeChecksum = options.supportsUserCodeChecksum;
|
|
1224
|
+
this.supportsMultipleUserCodeReport =
|
|
1225
|
+
options.supportsMultipleUserCodeReport;
|
|
1226
|
+
this.supportsMultipleUserCodeSet = options.supportsMultipleUserCodeSet;
|
|
1227
|
+
this.supportedUserIDStatuses = options.supportedUserIDStatuses;
|
|
1228
|
+
this.supportedKeypadModes = options.supportedKeypadModes;
|
|
1229
|
+
this.supportedASCIIChars = options.supportedASCIIChars;
|
|
1230
|
+
}
|
|
1231
|
+
static from(raw, ctx) {
|
|
1232
|
+
let offset = 0;
|
|
1233
|
+
validatePayload(raw.payload.length >= offset + 1);
|
|
1234
|
+
const supportsAdminCode = !!(raw.payload[offset] & 0b100_00000);
|
|
1235
|
+
const supportsAdminCodeDeactivation = !!(raw.payload[offset] & 0b010_00000);
|
|
1236
|
+
const statusBitMaskLength = raw.payload[offset] & 0b000_11111;
|
|
1237
|
+
offset += 1;
|
|
1238
|
+
validatePayload(raw.payload.length >= offset + statusBitMaskLength + 1);
|
|
1239
|
+
const supportedUserIDStatuses = parseBitMask(raw.payload.subarray(offset, offset + statusBitMaskLength), UserIDStatus.Available);
|
|
1240
|
+
offset += statusBitMaskLength;
|
|
1241
|
+
const supportsUserCodeChecksum = !!(raw.payload[offset] & 0b100_00000);
|
|
1242
|
+
const supportsMultipleUserCodeReport = !!(raw.payload[offset] & 0b010_00000);
|
|
1243
|
+
const supportsMultipleUserCodeSet = !!(raw.payload[offset] & 0b001_00000);
|
|
1244
|
+
const keypadModesBitMaskLength = raw.payload[offset] & 0b000_11111;
|
|
1245
|
+
offset += 1;
|
|
1246
|
+
validatePayload(raw.payload.length >= offset + keypadModesBitMaskLength + 1);
|
|
1247
|
+
const supportedKeypadModes = parseBitMask(raw.payload.subarray(offset, offset + keypadModesBitMaskLength), KeypadMode.Normal);
|
|
1248
|
+
offset += keypadModesBitMaskLength;
|
|
1249
|
+
const keysBitMaskLength = raw.payload[offset] & 0b000_11111;
|
|
1250
|
+
offset += 1;
|
|
1251
|
+
validatePayload(raw.payload.length >= offset + keysBitMaskLength);
|
|
1252
|
+
const supportedASCIIChars = Bytes.from(parseBitMask(raw.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString("ascii");
|
|
1253
|
+
return new UserCodeCCCapabilitiesReport_1({
|
|
1254
|
+
nodeId: ctx.sourceNodeId,
|
|
1255
|
+
supportsAdminCode,
|
|
1256
|
+
supportsAdminCodeDeactivation,
|
|
1257
|
+
supportedUserIDStatuses,
|
|
1258
|
+
supportsUserCodeChecksum,
|
|
1259
|
+
supportsMultipleUserCodeReport,
|
|
1260
|
+
supportsMultipleUserCodeSet,
|
|
1261
|
+
supportedKeypadModes,
|
|
1262
|
+
supportedASCIIChars,
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
supportsAdminCode;
|
|
1266
|
+
supportsAdminCodeDeactivation;
|
|
1267
|
+
supportsUserCodeChecksum;
|
|
1268
|
+
supportsMultipleUserCodeReport;
|
|
1269
|
+
supportsMultipleUserCodeSet;
|
|
1270
|
+
supportedUserIDStatuses;
|
|
1271
|
+
supportedKeypadModes;
|
|
1272
|
+
supportedASCIIChars;
|
|
1273
|
+
serialize(ctx) {
|
|
1274
|
+
const supportedStatusesBitmask = encodeBitMask(this.supportedUserIDStatuses, undefined, UserIDStatus.Available);
|
|
1275
|
+
const controlByte1 = (this.supportsAdminCode ? 0b100_00000 : 0)
|
|
1276
|
+
| (this.supportsAdminCodeDeactivation ? 0b010_00000 : 0)
|
|
1277
|
+
| (supportedStatusesBitmask.length & 0b000_11111);
|
|
1278
|
+
const supportedKeypadModesBitmask = encodeBitMask(this.supportedKeypadModes, undefined, KeypadMode.Normal);
|
|
1279
|
+
const controlByte2 = (this.supportsUserCodeChecksum ? 0b100_00000 : 0)
|
|
1280
|
+
| (this.supportsMultipleUserCodeReport ? 0b010_00000 : 0)
|
|
1281
|
+
| (this.supportsMultipleUserCodeSet ? 0b001_00000 : 0)
|
|
1282
|
+
| (supportedKeypadModesBitmask.length & 0b000_11111);
|
|
1283
|
+
const keysAsNumbers = [...this.supportedASCIIChars].map((char) => char.charCodeAt(0));
|
|
1284
|
+
const supportedKeysBitmask = encodeBitMask(keysAsNumbers, undefined, 0);
|
|
1285
|
+
const controlByte3 = supportedKeysBitmask.length & 0b000_11111;
|
|
1286
|
+
this.payload = Bytes.concat([
|
|
1287
|
+
Bytes.from([controlByte1]),
|
|
1288
|
+
supportedStatusesBitmask,
|
|
1289
|
+
Bytes.from([controlByte2]),
|
|
1290
|
+
supportedKeypadModesBitmask,
|
|
1291
|
+
Bytes.from([controlByte3]),
|
|
1292
|
+
supportedKeysBitmask,
|
|
1293
|
+
]);
|
|
1294
|
+
return super.serialize(ctx);
|
|
1295
|
+
}
|
|
1296
|
+
toLogEntry(ctx) {
|
|
1297
|
+
return {
|
|
1298
|
+
...super.toLogEntry(ctx),
|
|
1299
|
+
message: {
|
|
1300
|
+
"supports admin code": this.supportsAdminCode,
|
|
1301
|
+
"supports admin code deactivation": this.supportsAdminCodeDeactivation,
|
|
1302
|
+
"supports user code checksum": this.supportsUserCodeChecksum,
|
|
1303
|
+
"supports multiple codes in report": this.supportsMultipleUserCodeReport,
|
|
1304
|
+
"supports multiple codes in set": this.supportsMultipleUserCodeSet,
|
|
1305
|
+
"supported user id statuses": this.supportedUserIDStatuses
|
|
1306
|
+
.map((status) => `\n· ${getEnumMemberName(UserIDStatus, status)}`)
|
|
1307
|
+
.join(""),
|
|
1308
|
+
"supported keypad modes": this.supportedKeypadModes
|
|
1309
|
+
.map((mode) => `\n· ${getEnumMemberName(KeypadMode, mode)}`)
|
|
1310
|
+
.join(""),
|
|
1311
|
+
"supported ASCII chars": this.supportedASCIIChars,
|
|
1312
|
+
},
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
__decorate([
|
|
1317
|
+
ccValue(UserCodeCCValues.supportsAdminCode)
|
|
1318
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportsAdminCode", void 0);
|
|
1319
|
+
__decorate([
|
|
1320
|
+
ccValue(UserCodeCCValues.supportsAdminCodeDeactivation)
|
|
1321
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportsAdminCodeDeactivation", void 0);
|
|
1322
|
+
__decorate([
|
|
1323
|
+
ccValue(UserCodeCCValues.supportsUserCodeChecksum)
|
|
1324
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportsUserCodeChecksum", void 0);
|
|
1325
|
+
__decorate([
|
|
1326
|
+
ccValue(UserCodeCCValues.supportsMultipleUserCodeReport)
|
|
1327
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportsMultipleUserCodeReport", void 0);
|
|
1328
|
+
__decorate([
|
|
1329
|
+
ccValue(UserCodeCCValues.supportsMultipleUserCodeSet)
|
|
1330
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportsMultipleUserCodeSet", void 0);
|
|
1331
|
+
__decorate([
|
|
1332
|
+
ccValue(UserCodeCCValues.supportedUserIDStatuses)
|
|
1333
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportedUserIDStatuses", void 0);
|
|
1334
|
+
__decorate([
|
|
1335
|
+
ccValue(UserCodeCCValues.supportedKeypadModes)
|
|
1336
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportedKeypadModes", void 0);
|
|
1337
|
+
__decorate([
|
|
1338
|
+
ccValue(UserCodeCCValues.supportedASCIIChars)
|
|
1339
|
+
], UserCodeCCCapabilitiesReport.prototype, "supportedASCIIChars", void 0);
|
|
1340
|
+
UserCodeCCCapabilitiesReport = UserCodeCCCapabilitiesReport_1 = __decorate([
|
|
1341
|
+
CCCommand(UserCodeCommand.CapabilitiesReport)
|
|
1342
|
+
], UserCodeCCCapabilitiesReport);
|
|
1343
|
+
export { UserCodeCCCapabilitiesReport };
|
|
1344
|
+
let UserCodeCCCapabilitiesGet = class UserCodeCCCapabilitiesGet extends UserCodeCC {
|
|
1345
|
+
};
|
|
1346
|
+
UserCodeCCCapabilitiesGet = __decorate([
|
|
1347
|
+
CCCommand(UserCodeCommand.CapabilitiesGet),
|
|
1348
|
+
expectedCCResponse(UserCodeCCCapabilitiesReport)
|
|
1349
|
+
], UserCodeCCCapabilitiesGet);
|
|
1350
|
+
export { UserCodeCCCapabilitiesGet };
|
|
1351
|
+
let UserCodeCCKeypadModeSet = UserCodeCCKeypadModeSet_1 = class UserCodeCCKeypadModeSet extends UserCodeCC {
|
|
1352
|
+
constructor(options) {
|
|
1353
|
+
super(options);
|
|
1354
|
+
this.keypadMode = options.keypadMode;
|
|
1355
|
+
}
|
|
1356
|
+
static from(raw, ctx) {
|
|
1357
|
+
validatePayload(raw.payload.length >= 1);
|
|
1358
|
+
const keypadMode = raw.payload[0];
|
|
1359
|
+
return new UserCodeCCKeypadModeSet_1({
|
|
1360
|
+
nodeId: ctx.sourceNodeId,
|
|
1361
|
+
keypadMode,
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
keypadMode;
|
|
1365
|
+
serialize(ctx) {
|
|
1366
|
+
this.payload = Bytes.from([this.keypadMode]);
|
|
1367
|
+
return super.serialize(ctx);
|
|
1368
|
+
}
|
|
1369
|
+
toLogEntry(ctx) {
|
|
1370
|
+
return {
|
|
1371
|
+
...super.toLogEntry(ctx),
|
|
1372
|
+
message: { mode: getEnumMemberName(KeypadMode, this.keypadMode) },
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
UserCodeCCKeypadModeSet = UserCodeCCKeypadModeSet_1 = __decorate([
|
|
1377
|
+
CCCommand(UserCodeCommand.KeypadModeSet),
|
|
1378
|
+
useSupervision()
|
|
1379
|
+
], UserCodeCCKeypadModeSet);
|
|
1380
|
+
export { UserCodeCCKeypadModeSet };
|
|
1381
|
+
let UserCodeCCKeypadModeReport = UserCodeCCKeypadModeReport_1 = class UserCodeCCKeypadModeReport extends UserCodeCC {
|
|
1382
|
+
constructor(options) {
|
|
1383
|
+
super(options);
|
|
1384
|
+
this.keypadMode = options.keypadMode;
|
|
1385
|
+
}
|
|
1386
|
+
static from(raw, ctx) {
|
|
1387
|
+
validatePayload(raw.payload.length >= 1);
|
|
1388
|
+
const keypadMode = raw.payload[0];
|
|
1389
|
+
return new UserCodeCCKeypadModeReport_1({
|
|
1390
|
+
nodeId: ctx.sourceNodeId,
|
|
1391
|
+
keypadMode,
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
persistValues(ctx) {
|
|
1395
|
+
if (!super.persistValues(ctx))
|
|
1396
|
+
return false;
|
|
1397
|
+
// Update the keypad modes metadata
|
|
1398
|
+
const supportedKeypadModes = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [this.keypadMode];
|
|
1399
|
+
const keypadModeValue = UserCodeCCValues.keypadMode;
|
|
1400
|
+
this.setMetadata(ctx, keypadModeValue, {
|
|
1401
|
+
...keypadModeValue.meta,
|
|
1402
|
+
states: enumValuesToMetadataStates(KeypadMode, supportedKeypadModes),
|
|
1403
|
+
});
|
|
1404
|
+
return true;
|
|
1405
|
+
}
|
|
1406
|
+
keypadMode;
|
|
1407
|
+
serialize(ctx) {
|
|
1408
|
+
this.payload = Bytes.from([this.keypadMode]);
|
|
1409
|
+
return super.serialize(ctx);
|
|
1410
|
+
}
|
|
1411
|
+
toLogEntry(ctx) {
|
|
1412
|
+
return {
|
|
1413
|
+
...super.toLogEntry(ctx),
|
|
1414
|
+
message: {
|
|
1415
|
+
keypadMode: getEnumMemberName(KeypadMode, this.keypadMode),
|
|
1416
|
+
},
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
__decorate([
|
|
1421
|
+
ccValue(UserCodeCCValues.keypadMode)
|
|
1422
|
+
], UserCodeCCKeypadModeReport.prototype, "keypadMode", void 0);
|
|
1423
|
+
UserCodeCCKeypadModeReport = UserCodeCCKeypadModeReport_1 = __decorate([
|
|
1424
|
+
CCCommand(UserCodeCommand.KeypadModeReport)
|
|
1425
|
+
], UserCodeCCKeypadModeReport);
|
|
1426
|
+
export { UserCodeCCKeypadModeReport };
|
|
1427
|
+
let UserCodeCCKeypadModeGet = class UserCodeCCKeypadModeGet extends UserCodeCC {
|
|
1428
|
+
};
|
|
1429
|
+
UserCodeCCKeypadModeGet = __decorate([
|
|
1430
|
+
CCCommand(UserCodeCommand.KeypadModeGet),
|
|
1431
|
+
expectedCCResponse(UserCodeCCKeypadModeReport)
|
|
1432
|
+
], UserCodeCCKeypadModeGet);
|
|
1433
|
+
export { UserCodeCCKeypadModeGet };
|
|
1434
|
+
let UserCodeCCAdminCodeSet = UserCodeCCAdminCodeSet_1 = class UserCodeCCAdminCodeSet extends UserCodeCC {
|
|
1435
|
+
constructor(options) {
|
|
1436
|
+
super(options);
|
|
1437
|
+
this.adminCode = options.adminCode;
|
|
1438
|
+
}
|
|
1439
|
+
static from(raw, ctx) {
|
|
1440
|
+
validatePayload(raw.payload.length >= 1);
|
|
1441
|
+
const codeLength = raw.payload[0] & 0b1111;
|
|
1442
|
+
validatePayload(raw.payload.length >= 1 + codeLength);
|
|
1443
|
+
const adminCode = raw.payload
|
|
1444
|
+
.subarray(1, 1 + codeLength)
|
|
1445
|
+
.toString("ascii");
|
|
1446
|
+
return new UserCodeCCAdminCodeSet_1({
|
|
1447
|
+
nodeId: ctx.sourceNodeId,
|
|
1448
|
+
adminCode,
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
adminCode;
|
|
1452
|
+
serialize(ctx) {
|
|
1453
|
+
this.payload = Bytes.concat([
|
|
1454
|
+
Bytes.from([this.adminCode.length & 0b1111]),
|
|
1455
|
+
Bytes.from(this.adminCode, "ascii"),
|
|
1456
|
+
]);
|
|
1457
|
+
return super.serialize(ctx);
|
|
1458
|
+
}
|
|
1459
|
+
toLogEntry(ctx) {
|
|
1460
|
+
return {
|
|
1461
|
+
...super.toLogEntry(ctx),
|
|
1462
|
+
message: { "admin code": userCodeToLogString(this.adminCode) },
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
UserCodeCCAdminCodeSet = UserCodeCCAdminCodeSet_1 = __decorate([
|
|
1467
|
+
CCCommand(UserCodeCommand.AdminCodeSet),
|
|
1468
|
+
useSupervision()
|
|
1469
|
+
], UserCodeCCAdminCodeSet);
|
|
1470
|
+
export { UserCodeCCAdminCodeSet };
|
|
1471
|
+
let UserCodeCCAdminCodeReport = UserCodeCCAdminCodeReport_1 = class UserCodeCCAdminCodeReport extends UserCodeCC {
|
|
1472
|
+
constructor(options) {
|
|
1473
|
+
super(options);
|
|
1474
|
+
this.adminCode = options.adminCode;
|
|
1475
|
+
}
|
|
1476
|
+
static from(raw, ctx) {
|
|
1477
|
+
validatePayload(raw.payload.length >= 1);
|
|
1478
|
+
const codeLength = raw.payload[0] & 0b1111;
|
|
1479
|
+
validatePayload(raw.payload.length >= 1 + codeLength);
|
|
1480
|
+
const adminCode = raw.payload
|
|
1481
|
+
.subarray(1, 1 + codeLength)
|
|
1482
|
+
.toString("ascii");
|
|
1483
|
+
return new UserCodeCCAdminCodeReport_1({
|
|
1484
|
+
nodeId: ctx.sourceNodeId,
|
|
1485
|
+
adminCode,
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
adminCode;
|
|
1489
|
+
serialize(ctx) {
|
|
1490
|
+
this.payload = Bytes.concat([
|
|
1491
|
+
Bytes.from([this.adminCode.length & 0b1111]),
|
|
1492
|
+
Bytes.from(this.adminCode, "ascii"),
|
|
1493
|
+
]);
|
|
1494
|
+
return super.serialize(ctx);
|
|
1495
|
+
}
|
|
1496
|
+
toLogEntry(ctx) {
|
|
1497
|
+
return {
|
|
1498
|
+
...super.toLogEntry(ctx),
|
|
1499
|
+
message: { "admin code": userCodeToLogString(this.adminCode) },
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
__decorate([
|
|
1504
|
+
ccValue(UserCodeCCValues.adminCode)
|
|
1505
|
+
], UserCodeCCAdminCodeReport.prototype, "adminCode", void 0);
|
|
1506
|
+
UserCodeCCAdminCodeReport = UserCodeCCAdminCodeReport_1 = __decorate([
|
|
1507
|
+
CCCommand(UserCodeCommand.AdminCodeReport)
|
|
1508
|
+
], UserCodeCCAdminCodeReport);
|
|
1509
|
+
export { UserCodeCCAdminCodeReport };
|
|
1510
|
+
let UserCodeCCAdminCodeGet = class UserCodeCCAdminCodeGet extends UserCodeCC {
|
|
1511
|
+
};
|
|
1512
|
+
UserCodeCCAdminCodeGet = __decorate([
|
|
1513
|
+
CCCommand(UserCodeCommand.AdminCodeGet),
|
|
1514
|
+
expectedCCResponse(UserCodeCCAdminCodeReport)
|
|
1515
|
+
], UserCodeCCAdminCodeGet);
|
|
1516
|
+
export { UserCodeCCAdminCodeGet };
|
|
1517
|
+
let UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport_1 = class UserCodeCCUserCodeChecksumReport extends UserCodeCC {
|
|
1518
|
+
constructor(options) {
|
|
1519
|
+
super(options);
|
|
1520
|
+
this.userCodeChecksum = options.userCodeChecksum;
|
|
1521
|
+
}
|
|
1522
|
+
static from(raw, ctx) {
|
|
1523
|
+
validatePayload(raw.payload.length >= 2);
|
|
1524
|
+
const userCodeChecksum = raw.payload.readUInt16BE(0);
|
|
1525
|
+
return new UserCodeCCUserCodeChecksumReport_1({
|
|
1526
|
+
nodeId: ctx.sourceNodeId,
|
|
1527
|
+
userCodeChecksum,
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
userCodeChecksum;
|
|
1531
|
+
serialize(ctx) {
|
|
1532
|
+
this.payload = new Bytes(2);
|
|
1533
|
+
this.payload.writeUInt16BE(this.userCodeChecksum, 0);
|
|
1534
|
+
return super.serialize(ctx);
|
|
1535
|
+
}
|
|
1536
|
+
toLogEntry(ctx) {
|
|
1537
|
+
return {
|
|
1538
|
+
...super.toLogEntry(ctx),
|
|
1539
|
+
message: { "user code checksum": num2hex(this.userCodeChecksum) },
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
};
|
|
1543
|
+
__decorate([
|
|
1544
|
+
ccValue(UserCodeCCValues.userCodeChecksum)
|
|
1545
|
+
], UserCodeCCUserCodeChecksumReport.prototype, "userCodeChecksum", void 0);
|
|
1546
|
+
UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport_1 = __decorate([
|
|
1547
|
+
CCCommand(UserCodeCommand.UserCodeChecksumReport)
|
|
1548
|
+
], UserCodeCCUserCodeChecksumReport);
|
|
1549
|
+
export { UserCodeCCUserCodeChecksumReport };
|
|
1550
|
+
let UserCodeCCUserCodeChecksumGet = class UserCodeCCUserCodeChecksumGet extends UserCodeCC {
|
|
1551
|
+
};
|
|
1552
|
+
UserCodeCCUserCodeChecksumGet = __decorate([
|
|
1553
|
+
CCCommand(UserCodeCommand.UserCodeChecksumGet),
|
|
1554
|
+
expectedCCResponse(UserCodeCCUserCodeChecksumReport)
|
|
1555
|
+
], UserCodeCCUserCodeChecksumGet);
|
|
1556
|
+
export { UserCodeCCUserCodeChecksumGet };
|
|
1557
|
+
let UserCodeCCExtendedUserCodeSet = class UserCodeCCExtendedUserCodeSet extends UserCodeCC {
|
|
1558
|
+
constructor(options) {
|
|
1559
|
+
super(options);
|
|
1560
|
+
this.userCodes = options.userCodes;
|
|
1561
|
+
}
|
|
1562
|
+
static from(_raw, _ctx) {
|
|
1563
|
+
// TODO: Deserialize payload
|
|
1564
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1565
|
+
// return new UserCodeCCExtendedUserCodeSet({
|
|
1566
|
+
// nodeId: ctx.sourceNodeId,
|
|
1567
|
+
// });
|
|
1568
|
+
}
|
|
1569
|
+
userCodes;
|
|
1570
|
+
serialize(ctx) {
|
|
1571
|
+
const userCodeBuffers = this.userCodes.map((code) => {
|
|
1572
|
+
const ret = Bytes.concat([
|
|
1573
|
+
Bytes.from([
|
|
1574
|
+
0,
|
|
1575
|
+
0,
|
|
1576
|
+
code.userIdStatus,
|
|
1577
|
+
code.userCode?.length ?? 0,
|
|
1578
|
+
]),
|
|
1579
|
+
isUint8Array(code.userCode)
|
|
1580
|
+
? code.userCode
|
|
1581
|
+
: Bytes.from(code.userCode ?? "", "ascii"),
|
|
1582
|
+
]);
|
|
1583
|
+
ret.writeUInt16BE(code.userId, 0);
|
|
1584
|
+
return ret;
|
|
1585
|
+
});
|
|
1586
|
+
this.payload = Bytes.concat([
|
|
1587
|
+
Bytes.from([this.userCodes.length]),
|
|
1588
|
+
...userCodeBuffers,
|
|
1589
|
+
]);
|
|
1590
|
+
return super.serialize(ctx);
|
|
1591
|
+
}
|
|
1592
|
+
toLogEntry(ctx) {
|
|
1593
|
+
const message = {};
|
|
1594
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1595
|
+
message[`code #${userId}`] = `${userCodeToLogString(userCode ?? "")} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;
|
|
1596
|
+
}
|
|
1597
|
+
return {
|
|
1598
|
+
...super.toLogEntry(ctx),
|
|
1599
|
+
message,
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
UserCodeCCExtendedUserCodeSet = __decorate([
|
|
1604
|
+
CCCommand(UserCodeCommand.ExtendedUserCodeSet),
|
|
1605
|
+
useSupervision()
|
|
1606
|
+
], UserCodeCCExtendedUserCodeSet);
|
|
1607
|
+
export { UserCodeCCExtendedUserCodeSet };
|
|
1608
|
+
let UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport_1 = class UserCodeCCExtendedUserCodeReport extends UserCodeCC {
|
|
1609
|
+
constructor(options) {
|
|
1610
|
+
super(options);
|
|
1611
|
+
// TODO: Check implementation:
|
|
1612
|
+
this.userCodes = options.userCodes;
|
|
1613
|
+
this.nextUserId = options.nextUserId;
|
|
1614
|
+
}
|
|
1615
|
+
static from(raw, ctx) {
|
|
1616
|
+
validatePayload(raw.payload.length >= 1);
|
|
1617
|
+
const numCodes = raw.payload[0];
|
|
1618
|
+
let offset = 1;
|
|
1619
|
+
const userCodes = [];
|
|
1620
|
+
// parse each user code
|
|
1621
|
+
for (let i = 0; i < numCodes; i++) {
|
|
1622
|
+
const { code, bytesRead } = parseExtendedUserCode(raw.payload.subarray(offset));
|
|
1623
|
+
userCodes.push(code);
|
|
1624
|
+
offset += bytesRead;
|
|
1625
|
+
}
|
|
1626
|
+
validatePayload(raw.payload.length >= offset + 2);
|
|
1627
|
+
const nextUserId = raw.payload.readUInt16BE(offset);
|
|
1628
|
+
return new UserCodeCCExtendedUserCodeReport_1({
|
|
1629
|
+
nodeId: ctx.sourceNodeId,
|
|
1630
|
+
userCodes,
|
|
1631
|
+
nextUserId,
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
persistValues(ctx) {
|
|
1635
|
+
if (!super.persistValues(ctx))
|
|
1636
|
+
return false;
|
|
1637
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1638
|
+
persistUserCode.call(this, ctx, userId, userIdStatus, userCode);
|
|
1639
|
+
}
|
|
1640
|
+
return true;
|
|
1641
|
+
}
|
|
1642
|
+
userCodes;
|
|
1643
|
+
nextUserId;
|
|
1644
|
+
toLogEntry(ctx) {
|
|
1645
|
+
const message = {};
|
|
1646
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1647
|
+
message[`code #${userId}`] = `${userCodeToLogString(userCode)} (status: ${getEnumMemberName(UserIDStatus, userIdStatus)})`;
|
|
1648
|
+
}
|
|
1649
|
+
message["next user id"] = this.nextUserId;
|
|
1650
|
+
return {
|
|
1651
|
+
...super.toLogEntry(ctx),
|
|
1652
|
+
message,
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport_1 = __decorate([
|
|
1657
|
+
CCCommand(UserCodeCommand.ExtendedUserCodeReport)
|
|
1658
|
+
], UserCodeCCExtendedUserCodeReport);
|
|
1659
|
+
export { UserCodeCCExtendedUserCodeReport };
|
|
1660
|
+
let UserCodeCCExtendedUserCodeGet = class UserCodeCCExtendedUserCodeGet extends UserCodeCC {
|
|
1661
|
+
constructor(options) {
|
|
1662
|
+
super(options);
|
|
1663
|
+
this.userId = options.userId;
|
|
1664
|
+
this.reportMore = !!options.reportMore;
|
|
1665
|
+
}
|
|
1666
|
+
static from(_raw, _ctx) {
|
|
1667
|
+
// TODO: Deserialize payload
|
|
1668
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1669
|
+
// return new UserCodeCCExtendedUserCodeGet({
|
|
1670
|
+
// nodeId: ctx.sourceNodeId,
|
|
1671
|
+
// });
|
|
1672
|
+
}
|
|
1673
|
+
userId;
|
|
1674
|
+
reportMore;
|
|
1675
|
+
serialize(ctx) {
|
|
1676
|
+
this.payload = Bytes.from([0, 0, this.reportMore ? 1 : 0]);
|
|
1677
|
+
this.payload.writeUInt16BE(this.userId, 0);
|
|
1678
|
+
return super.serialize(ctx);
|
|
1679
|
+
}
|
|
1680
|
+
toLogEntry(ctx) {
|
|
1681
|
+
return {
|
|
1682
|
+
...super.toLogEntry(ctx),
|
|
1683
|
+
message: {
|
|
1684
|
+
"user id": this.userId,
|
|
1685
|
+
"report more": this.reportMore,
|
|
1686
|
+
},
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
UserCodeCCExtendedUserCodeGet = __decorate([
|
|
1691
|
+
CCCommand(UserCodeCommand.ExtendedUserCodeGet),
|
|
1692
|
+
expectedCCResponse(UserCodeCCExtendedUserCodeReport)
|
|
1693
|
+
], UserCodeCCExtendedUserCodeGet);
|
|
1694
|
+
export { UserCodeCCExtendedUserCodeGet };
|
|
1695
|
+
//# sourceMappingURL=UserCodeCC.js.map
|