@zwave-js/cc 14.0.0-beta.1 → 14.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.d.ts +194 -0
- package/build/cjs/cc/AlarmSensorCC.js +510 -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 +877 -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 +887 -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 +748 -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 +478 -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 +590 -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 +546 -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 +472 -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 +208 -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 +584 -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 +646 -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 +330 -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 +1265 -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 +2477 -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 +168 -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 +1366 -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 +458 -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 +329 -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 +754 -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 +1322 -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 +91 -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 +449 -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 +250 -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 +821 -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 +251 -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 +1395 -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 +2224 -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 +364 -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 +322 -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 +269 -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 +440 -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 +1355 -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 +1090 -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 +1268 -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 +234 -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 +856 -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 +928 -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 +126 -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 +504 -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 +1399 -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 +657 -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 +859 -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 +261 -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 +473 -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 +526 -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 +2043 -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 +1853 -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 +977 -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 +853 -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 +398 -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 +495 -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 +252 -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 +559 -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 +248 -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 +366 -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 +792 -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 +635 -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 +413 -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 +522 -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 +1903 -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 +962 -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 +609 -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 +924 -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 +90 -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 +362 -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 +1638 -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 +533 -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 +108 -0
- package/build/cjs/lib/CommandClassDecorators.js +181 -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.d.ts +106 -0
- package/build/cjs/lib/Security2/Extension.js +424 -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 +490 -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 +847 -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 +889 -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 +751 -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 +468 -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 +578 -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 +515 -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 +441 -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 +187 -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 +541 -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 +607 -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 +294 -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 +1274 -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 +2666 -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 +138 -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 +1372 -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 +414 -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 +289 -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 +717 -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 +1311 -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 +60 -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 +412 -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 +210 -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 +805 -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 +211 -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 +1455 -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 +2239 -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 +325 -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 +282 -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 +252 -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 +404 -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 +1409 -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 +1094 -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 +1312 -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 +206 -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 +872 -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 +935 -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 +92 -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 +464 -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 +1481 -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 +611 -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 +830 -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 +223 -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 +462 -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 +534 -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 +2065 -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 +2041 -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 +989 -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 +796 -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 +396 -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 +463 -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 +212 -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 +530 -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 +208 -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 +333 -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 +786 -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 +590 -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 +385 -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 +523 -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 +1933 -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 +971 -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 +568 -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 +905 -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 +57 -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 +328 -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 +1520 -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 +489 -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 +108 -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 +380 -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 +0 -106
- 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/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,1481 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
function __assertType(argName, typeName, boundHasError) {
|
|
36
|
+
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
37
|
+
if (boundHasError()) {
|
|
38
|
+
throw new ZWaveError(typeName ? `${argName} is not a ${typeName}` : `${argName} has the wrong type`, ZWaveErrorCodes.Argument_Invalid);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const __assertType__NotificationCCReportOptions = $o => {
|
|
42
|
+
function _number($o) {
|
|
43
|
+
return typeof $o !== "number" ? {} : null;
|
|
44
|
+
}
|
|
45
|
+
function _uint8array($o) {
|
|
46
|
+
return !require("@zwave-js/shared/safe").isUint8Array($o) ? {} : null;
|
|
47
|
+
}
|
|
48
|
+
function _0($o) {
|
|
49
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
50
|
+
return {};
|
|
51
|
+
if ("alarmType" in $o && $o["alarmType"] !== undefined) {
|
|
52
|
+
const error = _number($o["alarmType"]);
|
|
53
|
+
if (error)
|
|
54
|
+
return error;
|
|
55
|
+
}
|
|
56
|
+
if ("alarmLevel" in $o && $o["alarmLevel"] !== undefined) {
|
|
57
|
+
const error = _number($o["alarmLevel"]);
|
|
58
|
+
if (error)
|
|
59
|
+
return error;
|
|
60
|
+
}
|
|
61
|
+
if ("notificationType" in $o && $o["notificationType"] !== undefined) {
|
|
62
|
+
const error = _number($o["notificationType"]);
|
|
63
|
+
if (error)
|
|
64
|
+
return error;
|
|
65
|
+
}
|
|
66
|
+
if ("notificationEvent" in $o && $o["notificationEvent"] !== undefined) {
|
|
67
|
+
const error = _number($o["notificationEvent"]);
|
|
68
|
+
if (error)
|
|
69
|
+
return error;
|
|
70
|
+
}
|
|
71
|
+
if ("notificationStatus" in $o && $o["notificationStatus"] !== undefined) {
|
|
72
|
+
const error = _number($o["notificationStatus"]);
|
|
73
|
+
if (error)
|
|
74
|
+
return error;
|
|
75
|
+
}
|
|
76
|
+
if ("eventParameters" in $o && $o["eventParameters"] !== undefined) {
|
|
77
|
+
const error = _uint8array($o["eventParameters"]);
|
|
78
|
+
if (error)
|
|
79
|
+
return error;
|
|
80
|
+
}
|
|
81
|
+
if ("sequenceNumber" in $o && $o["sequenceNumber"] !== undefined) {
|
|
82
|
+
const error = _number($o["sequenceNumber"]);
|
|
83
|
+
if (error)
|
|
84
|
+
return error;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return _0($o);
|
|
89
|
+
};
|
|
90
|
+
const __assertType__NotificationCCGetOptions = $o => {
|
|
91
|
+
function _number($o) {
|
|
92
|
+
return typeof $o !== "number" ? {} : null;
|
|
93
|
+
}
|
|
94
|
+
function _1($o) {
|
|
95
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
96
|
+
return {};
|
|
97
|
+
if ("alarmType" in $o && $o["alarmType"] !== undefined) {
|
|
98
|
+
const error = _number($o["alarmType"]);
|
|
99
|
+
if (error)
|
|
100
|
+
return error;
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
return {};
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
function _2($o) {
|
|
107
|
+
if (typeof $o !== "object" || $o === null || Array.isArray($o))
|
|
108
|
+
return {};
|
|
109
|
+
if ("notificationType" in $o && $o["notificationType"] !== undefined) {
|
|
110
|
+
const error = _number($o["notificationType"]);
|
|
111
|
+
if (error)
|
|
112
|
+
return error;
|
|
113
|
+
}
|
|
114
|
+
else
|
|
115
|
+
return {};
|
|
116
|
+
if ("notificationEvent" in $o && $o["notificationEvent"] !== undefined) {
|
|
117
|
+
const error = _number($o["notificationEvent"]);
|
|
118
|
+
if (error)
|
|
119
|
+
return error;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
function su__1__2_eu($o) {
|
|
124
|
+
const conditions = [_1, _2];
|
|
125
|
+
for (const condition of conditions) {
|
|
126
|
+
const error = condition($o);
|
|
127
|
+
if (!error)
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
return su__1__2_eu($o);
|
|
133
|
+
};
|
|
134
|
+
const __assertType__number = $o => {
|
|
135
|
+
function _number($o) {
|
|
136
|
+
return typeof $o !== "number" ? {} : null;
|
|
137
|
+
}
|
|
138
|
+
return _number($o);
|
|
139
|
+
};
|
|
140
|
+
const __assertType__boolean = $o => {
|
|
141
|
+
function _boolean($o) {
|
|
142
|
+
return typeof $o !== "boolean" ? {} : null;
|
|
143
|
+
}
|
|
144
|
+
return _boolean($o);
|
|
145
|
+
};
|
|
146
|
+
import { getNotification, getNotificationEventName, getNotificationName, getNotificationValue, getNotificationValueName, timespan, } from "@zwave-js/core";
|
|
147
|
+
import { CommandClasses, Duration, MessagePriority, SecurityClass, ValueMetadata, ZWaveError, ZWaveErrorCodes, encodeBitMask, getCCName, isZWaveError, parseBitMask, validatePayload, } from "@zwave-js/core/safe";
|
|
148
|
+
import { Bytes, isUint8Array } from "@zwave-js/shared/safe";
|
|
149
|
+
import { buffer2hex, num2hex, pick } from "@zwave-js/shared/safe";
|
|
150
|
+
import { isArray } from "alcalzone-shared/typeguards/index.js";
|
|
151
|
+
import { CCAPI, POLL_VALUE, PhysicalCCAPI, throwUnsupportedProperty, } from "../lib/API.js";
|
|
152
|
+
import { CCRaw, CommandClass, InvalidCC, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
153
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
154
|
+
import { isNotificationEventPayload } from "../lib/NotificationEventPayload.js";
|
|
155
|
+
import { V } from "../lib/Values.js";
|
|
156
|
+
import { NotificationCommand, UserCodeCommand } from "../lib/_Types.js";
|
|
157
|
+
import * as ccUtils from "../lib/utils.js";
|
|
158
|
+
import { AssociationGroupInfoCC } from "./AssociationGroupInfoCC.js";
|
|
159
|
+
export const NotificationCCValues = Object.freeze({
|
|
160
|
+
...V.defineStaticCCValues(CommandClasses.Notification, {
|
|
161
|
+
...V.staticProperty("supportsV1Alarm", undefined, {
|
|
162
|
+
internal: true,
|
|
163
|
+
supportsEndpoints: false,
|
|
164
|
+
}),
|
|
165
|
+
...V.staticProperty("supportedNotificationTypes", undefined, {
|
|
166
|
+
internal: true,
|
|
167
|
+
supportsEndpoints: false,
|
|
168
|
+
}),
|
|
169
|
+
...V.staticProperty("notificationMode", undefined, {
|
|
170
|
+
internal: true,
|
|
171
|
+
supportsEndpoints: false,
|
|
172
|
+
}),
|
|
173
|
+
...V.staticProperty("lastRefresh", undefined, {
|
|
174
|
+
internal: true,
|
|
175
|
+
}),
|
|
176
|
+
// V1 Alarm values
|
|
177
|
+
...V.staticProperty("alarmType", {
|
|
178
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
179
|
+
label: "Alarm Type",
|
|
180
|
+
}),
|
|
181
|
+
...V.staticProperty("alarmLevel", {
|
|
182
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
183
|
+
label: "Alarm Level",
|
|
184
|
+
}),
|
|
185
|
+
// Simplification for the Door state variable, where we cannot know
|
|
186
|
+
// if any of the enum values are supported
|
|
187
|
+
...V.staticPropertyAndKeyWithName("doorStateSimple", "Access Control", "Door state (simple)", {
|
|
188
|
+
// Must be a number for compatibility reasons
|
|
189
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
190
|
+
label: "Door state (simple)",
|
|
191
|
+
states: {
|
|
192
|
+
[0x16]: "Window/door is open",
|
|
193
|
+
[0x17]: "Window/door is closed",
|
|
194
|
+
},
|
|
195
|
+
ccSpecific: {
|
|
196
|
+
notificationType: 0x06,
|
|
197
|
+
},
|
|
198
|
+
}, {
|
|
199
|
+
autoCreate: shouldAutoCreateSimpleDoorSensorValue,
|
|
200
|
+
}),
|
|
201
|
+
// Binary tilt value extracted from the Door state variable.
|
|
202
|
+
...V.staticPropertyAndKeyWithName("doorTiltState", "Access Control", "Door tilt state", {
|
|
203
|
+
// Must be a number for compatibility reasons
|
|
204
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
205
|
+
label: "Door tilt state",
|
|
206
|
+
states: {
|
|
207
|
+
[0x00]: "Window/door is not tilted",
|
|
208
|
+
[0x01]: "Window/door is tilted",
|
|
209
|
+
},
|
|
210
|
+
ccSpecific: {
|
|
211
|
+
notificationType: 0x06,
|
|
212
|
+
},
|
|
213
|
+
}, {
|
|
214
|
+
// This is created when the tilt state is first received.
|
|
215
|
+
autoCreate: false,
|
|
216
|
+
}),
|
|
217
|
+
}),
|
|
218
|
+
...V.defineDynamicCCValues(CommandClasses.Notification, {
|
|
219
|
+
...V.dynamicPropertyAndKeyWithName("supportedNotificationEvents", "supportedNotificationEvents", (notificationType) => notificationType, ({ property, propertyKey }) => property === "supportedNotificationEvents"
|
|
220
|
+
&& typeof propertyKey === "number", undefined, { internal: true, supportsEndpoints: false }),
|
|
221
|
+
// Different variants of the V2 notification values:
|
|
222
|
+
// Unknown type
|
|
223
|
+
...V.dynamicPropertyWithName("unknownNotificationType", (notificationType) => `UNKNOWN_${num2hex(notificationType)}`, ({ property }) => typeof property === "string"
|
|
224
|
+
&& property.startsWith("UNKNOWN_0x"), (notificationType) => ({
|
|
225
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
226
|
+
label: `Unknown notification (${num2hex(notificationType)})`,
|
|
227
|
+
ccSpecific: { notificationType },
|
|
228
|
+
})),
|
|
229
|
+
// Known type, unknown variable
|
|
230
|
+
...V.dynamicPropertyAndKeyWithName("unknownNotificationVariable", (notificationType, notificationName) => notificationName, "unknown", ({ property, propertyKey }) => typeof property === "string" && propertyKey === "unknown", (notificationType, notificationName) => ({
|
|
231
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
232
|
+
label: `${notificationName}: Unknown value`,
|
|
233
|
+
ccSpecific: { notificationType },
|
|
234
|
+
})),
|
|
235
|
+
// (Stateful) notification variable
|
|
236
|
+
...V.dynamicPropertyAndKeyWithName("notificationVariable",
|
|
237
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
238
|
+
(notificationName, variableName) => notificationName, (notificationName, variableName) => variableName, ({ property, propertyKey }) => typeof property === "string" && typeof propertyKey === "string",
|
|
239
|
+
// Notification metadata is so dynamic, it does not make sense to define it here
|
|
240
|
+
undefined),
|
|
241
|
+
}),
|
|
242
|
+
});
|
|
243
|
+
function shouldAutoCreateSimpleDoorSensorValue(ctx, endpoint) {
|
|
244
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
245
|
+
if (!valueDB)
|
|
246
|
+
return false;
|
|
247
|
+
const supportedACEvents = valueDB.getValue(NotificationCCValues.supportedNotificationEvents(
|
|
248
|
+
// Access Control
|
|
249
|
+
0x06).endpoint(endpoint.index));
|
|
250
|
+
if (!supportedACEvents)
|
|
251
|
+
return false;
|
|
252
|
+
return (supportedACEvents.includes(
|
|
253
|
+
// Window/door is open
|
|
254
|
+
0x16)
|
|
255
|
+
&& supportedACEvents.includes(
|
|
256
|
+
// Window/door is closed
|
|
257
|
+
0x17));
|
|
258
|
+
}
|
|
259
|
+
let NotificationCCAPI = (() => {
|
|
260
|
+
let _classDecorators = [API(CommandClasses.Notification)];
|
|
261
|
+
let _classDescriptor;
|
|
262
|
+
let _classExtraInitializers = [];
|
|
263
|
+
let _classThis;
|
|
264
|
+
let _classSuper = PhysicalCCAPI;
|
|
265
|
+
var NotificationCCAPI = class extends _classSuper {
|
|
266
|
+
static { _classThis = this; }
|
|
267
|
+
static {
|
|
268
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
269
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
270
|
+
NotificationCCAPI = _classThis = _classDescriptor.value;
|
|
271
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
272
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
273
|
+
}
|
|
274
|
+
supportsCommand(cmd) {
|
|
275
|
+
switch (cmd) {
|
|
276
|
+
case NotificationCommand.Report:
|
|
277
|
+
case NotificationCommand.Get:
|
|
278
|
+
return true; // These exist starting with V1
|
|
279
|
+
case NotificationCommand.Set:
|
|
280
|
+
case NotificationCommand.SupportedGet:
|
|
281
|
+
return this.version >= 2;
|
|
282
|
+
case NotificationCommand.EventSupportedGet:
|
|
283
|
+
return this.version >= 3;
|
|
284
|
+
}
|
|
285
|
+
return super.supportsCommand(cmd);
|
|
286
|
+
}
|
|
287
|
+
get [POLL_VALUE]() {
|
|
288
|
+
return async function ({ property, propertyKey }) {
|
|
289
|
+
const valueId = {
|
|
290
|
+
commandClass: this.ccId,
|
|
291
|
+
endpoint: this.endpoint.index,
|
|
292
|
+
property,
|
|
293
|
+
propertyKey,
|
|
294
|
+
};
|
|
295
|
+
if (NotificationCCValues.notificationVariable.is(valueId)) {
|
|
296
|
+
const notificationType = this
|
|
297
|
+
.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific
|
|
298
|
+
?.notificationType;
|
|
299
|
+
if (notificationType != undefined) {
|
|
300
|
+
return this.getInternal({ notificationType });
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @internal
|
|
308
|
+
*/
|
|
309
|
+
async getInternal(options) {
|
|
310
|
+
this.assertSupportsCommand(NotificationCommand, NotificationCommand.Get);
|
|
311
|
+
const cc = new NotificationCCGet({
|
|
312
|
+
nodeId: this.endpoint.nodeId,
|
|
313
|
+
endpointIndex: this.endpoint.index,
|
|
314
|
+
...options,
|
|
315
|
+
});
|
|
316
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
317
|
+
}
|
|
318
|
+
async sendReport(options) {
|
|
319
|
+
__assertType("options", "NotificationCCReportOptions", __assertType__NotificationCCReportOptions.bind(void 0, options));
|
|
320
|
+
this.assertSupportsCommand(NotificationCommand, NotificationCommand.Report);
|
|
321
|
+
const cc = new NotificationCCReport({
|
|
322
|
+
nodeId: this.endpoint.nodeId,
|
|
323
|
+
endpointIndex: this.endpoint.index,
|
|
324
|
+
...options,
|
|
325
|
+
});
|
|
326
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
327
|
+
}
|
|
328
|
+
async get(options) {
|
|
329
|
+
__assertType("options", "NotificationCCGetOptions", __assertType__NotificationCCGetOptions.bind(void 0, options));
|
|
330
|
+
const response = await this.getInternal(options);
|
|
331
|
+
if (response) {
|
|
332
|
+
return pick(response, [
|
|
333
|
+
"notificationStatus",
|
|
334
|
+
"notificationEvent",
|
|
335
|
+
"alarmLevel",
|
|
336
|
+
"eventParameters",
|
|
337
|
+
"sequenceNumber",
|
|
338
|
+
]);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
async set(notificationType, notificationStatus) {
|
|
342
|
+
__assertType("notificationType", "number", __assertType__number.bind(void 0, notificationType));
|
|
343
|
+
__assertType("notificationStatus", "boolean", __assertType__boolean.bind(void 0, notificationStatus));
|
|
344
|
+
this.assertSupportsCommand(NotificationCommand, NotificationCommand.Set);
|
|
345
|
+
const cc = new NotificationCCSet({
|
|
346
|
+
nodeId: this.endpoint.nodeId,
|
|
347
|
+
endpointIndex: this.endpoint.index,
|
|
348
|
+
notificationType,
|
|
349
|
+
notificationStatus,
|
|
350
|
+
});
|
|
351
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
352
|
+
}
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
354
|
+
async getSupported() {
|
|
355
|
+
this.assertSupportsCommand(NotificationCommand, NotificationCommand.SupportedGet);
|
|
356
|
+
const cc = new NotificationCCSupportedGet({
|
|
357
|
+
nodeId: this.endpoint.nodeId,
|
|
358
|
+
endpointIndex: this.endpoint.index,
|
|
359
|
+
});
|
|
360
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
361
|
+
if (response) {
|
|
362
|
+
return pick(response, [
|
|
363
|
+
"supportsV1Alarm",
|
|
364
|
+
"supportedNotificationTypes",
|
|
365
|
+
]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
async getSupportedEvents(notificationType) {
|
|
369
|
+
__assertType("notificationType", "number", __assertType__number.bind(void 0, notificationType));
|
|
370
|
+
this.assertSupportsCommand(NotificationCommand, NotificationCommand.EventSupportedGet);
|
|
371
|
+
const cc = new NotificationCCEventSupportedGet({
|
|
372
|
+
nodeId: this.endpoint.nodeId,
|
|
373
|
+
endpointIndex: this.endpoint.index,
|
|
374
|
+
notificationType,
|
|
375
|
+
});
|
|
376
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
377
|
+
return response?.supportedEvents;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
return NotificationCCAPI = _classThis;
|
|
381
|
+
})();
|
|
382
|
+
export { NotificationCCAPI };
|
|
383
|
+
export function getNotificationEnumBehavior(notification, valueConfig) {
|
|
384
|
+
const variable = notification.variables.find((v) => v.states.has(valueConfig.value));
|
|
385
|
+
if (!variable)
|
|
386
|
+
return "none";
|
|
387
|
+
const numStatesWithEnums = [...variable.states.values()].filter((val) => val.parameter?.type === "enum").length;
|
|
388
|
+
if (numStatesWithEnums === 0)
|
|
389
|
+
return "none";
|
|
390
|
+
// An enum value replaces the original value if there is only a single possible state
|
|
391
|
+
// which also has an enum parameter
|
|
392
|
+
if (numStatesWithEnums === 1 && variable.states.size === 1) {
|
|
393
|
+
return "replace";
|
|
394
|
+
}
|
|
395
|
+
return "extend";
|
|
396
|
+
}
|
|
397
|
+
export function getNotificationStateValueWithEnum(stateValue, enumValue) {
|
|
398
|
+
return (stateValue << 8) | enumValue;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Returns the metadata to use for a known notification value.
|
|
402
|
+
* Can be used to extend a previously defined metadata,
|
|
403
|
+
* e.g. for V2 notifications that don't allow discovering supported events.
|
|
404
|
+
*/
|
|
405
|
+
export function getNotificationValueMetadata(previous, notification, valueConfig) {
|
|
406
|
+
const metadata = previous ?? {
|
|
407
|
+
...ValueMetadata.ReadOnlyUInt8,
|
|
408
|
+
label: valueConfig.variableName,
|
|
409
|
+
states: {},
|
|
410
|
+
ccSpecific: {
|
|
411
|
+
notificationType: notification.type,
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
if (valueConfig.idle) {
|
|
415
|
+
metadata.states[0] = "idle";
|
|
416
|
+
}
|
|
417
|
+
const enumBehavior = getNotificationEnumBehavior(notification, valueConfig);
|
|
418
|
+
if (enumBehavior !== "replace") {
|
|
419
|
+
metadata.states[valueConfig.value] = valueConfig.label;
|
|
420
|
+
}
|
|
421
|
+
if (valueConfig.parameter?.type === "enum") {
|
|
422
|
+
for (const [key, label] of Object.entries(valueConfig.parameter.values)) {
|
|
423
|
+
const value = parseInt(key);
|
|
424
|
+
const stateKey = enumBehavior === "replace"
|
|
425
|
+
? value
|
|
426
|
+
: getNotificationStateValueWithEnum(valueConfig.value, value);
|
|
427
|
+
metadata.states[stateKey] = label;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return metadata;
|
|
431
|
+
}
|
|
432
|
+
let NotificationCC = (() => {
|
|
433
|
+
let _classDecorators = [commandClass(CommandClasses.Notification), implementedVersion(8), ccValues(NotificationCCValues)];
|
|
434
|
+
let _classDescriptor;
|
|
435
|
+
let _classExtraInitializers = [];
|
|
436
|
+
let _classThis;
|
|
437
|
+
let _classSuper = CommandClass;
|
|
438
|
+
var NotificationCC = class extends _classSuper {
|
|
439
|
+
static { _classThis = this; }
|
|
440
|
+
static {
|
|
441
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
442
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
443
|
+
NotificationCC = _classThis = _classDescriptor.value;
|
|
444
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
445
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
446
|
+
}
|
|
447
|
+
// former AlarmCC (v1..v2)
|
|
448
|
+
determineRequiredCCInterviews() {
|
|
449
|
+
return [
|
|
450
|
+
...super.determineRequiredCCInterviews(),
|
|
451
|
+
CommandClasses.Association,
|
|
452
|
+
CommandClasses["Multi Channel Association"],
|
|
453
|
+
CommandClasses["Association Group Information"],
|
|
454
|
+
];
|
|
455
|
+
}
|
|
456
|
+
async determineNotificationMode(ctx, api, supportedNotificationEvents) {
|
|
457
|
+
const node = this.getNode(ctx);
|
|
458
|
+
// SDS14223: If the supporting node does not support the Association Command Class,
|
|
459
|
+
// it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.
|
|
460
|
+
if (!node.supportsCC(CommandClasses.Association))
|
|
461
|
+
return "pull";
|
|
462
|
+
if (node.supportsCC(CommandClasses["Association Group Information"])) {
|
|
463
|
+
try {
|
|
464
|
+
const groupsIssueingNotifications = AssociationGroupInfoCC
|
|
465
|
+
.findGroupsForIssuedCommand(ctx, node, this.ccId, NotificationCommand.Report);
|
|
466
|
+
return groupsIssueingNotifications.length > 0 ? "push" : "pull";
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
// We might be dealing with an older cache file, fall back to testing
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
ctx.logNode(node.id, {
|
|
473
|
+
endpoint: this.endpointIndex,
|
|
474
|
+
message: `determining whether this node is pull or push...`,
|
|
475
|
+
direction: "outbound",
|
|
476
|
+
});
|
|
477
|
+
// Find a notification type with at least one supported event
|
|
478
|
+
for (const [type, events] of supportedNotificationEvents) {
|
|
479
|
+
if (events.length === 0)
|
|
480
|
+
continue;
|
|
481
|
+
// Enable the event and request the status
|
|
482
|
+
await api.set(type, true);
|
|
483
|
+
try {
|
|
484
|
+
const resp = await api.get({
|
|
485
|
+
notificationType: type,
|
|
486
|
+
notificationEvent: events[0],
|
|
487
|
+
});
|
|
488
|
+
switch (resp?.notificationStatus) {
|
|
489
|
+
case 0xff:
|
|
490
|
+
return "push";
|
|
491
|
+
case 0xfe:
|
|
492
|
+
case 0x00:
|
|
493
|
+
return "pull";
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
catch {
|
|
497
|
+
/* ignore */
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
// If everything failed, e.g. because the node is V1/V2, assume this is a "push" node.
|
|
501
|
+
// If we assumed "pull", we would have to query the node regularly, which can cause
|
|
502
|
+
// the node to return old (already handled) notifications.
|
|
503
|
+
// https://github.com/zwave-js/node-zwave-js/issues/5626
|
|
504
|
+
return "push";
|
|
505
|
+
}
|
|
506
|
+
/** Whether the node implements push or pull notifications */
|
|
507
|
+
static getNotificationMode(ctx, node) {
|
|
508
|
+
return ctx
|
|
509
|
+
.getValueDB(node.id)
|
|
510
|
+
.getValue(NotificationCCValues.notificationMode.id);
|
|
511
|
+
}
|
|
512
|
+
async interview(ctx) {
|
|
513
|
+
const node = this.getNode(ctx);
|
|
514
|
+
const endpoint = this.getEndpoint(ctx);
|
|
515
|
+
const api = CCAPI.create(CommandClasses.Notification, ctx, endpoint).withOptions({
|
|
516
|
+
priority: MessagePriority.NodeQuery,
|
|
517
|
+
});
|
|
518
|
+
ctx.logNode(node.id, {
|
|
519
|
+
endpoint: this.endpointIndex,
|
|
520
|
+
message: `Interviewing ${this.ccName}...`,
|
|
521
|
+
direction: "none",
|
|
522
|
+
});
|
|
523
|
+
// If one Association group issues Notification Reports,
|
|
524
|
+
// we must associate ourselves with that channel
|
|
525
|
+
try {
|
|
526
|
+
await ccUtils.assignLifelineIssueingCommand(ctx, endpoint, this.ccId, NotificationCommand.Report);
|
|
527
|
+
}
|
|
528
|
+
catch {
|
|
529
|
+
ctx.logNode(node.id, {
|
|
530
|
+
endpoint: endpoint.index,
|
|
531
|
+
message: `Configuring associations to receive ${getCCName(this.ccId)} reports failed!`,
|
|
532
|
+
level: "warn",
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
let supportsV1Alarm = false;
|
|
536
|
+
if (api.version >= 2) {
|
|
537
|
+
ctx.logNode(node.id, {
|
|
538
|
+
endpoint: this.endpointIndex,
|
|
539
|
+
message: "querying supported notification types...",
|
|
540
|
+
direction: "outbound",
|
|
541
|
+
});
|
|
542
|
+
const suppResponse = await api.getSupported();
|
|
543
|
+
if (!suppResponse) {
|
|
544
|
+
ctx.logNode(node.id, {
|
|
545
|
+
endpoint: this.endpointIndex,
|
|
546
|
+
message: "Querying supported notification types timed out, skipping interview...",
|
|
547
|
+
level: "warn",
|
|
548
|
+
});
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
supportsV1Alarm = suppResponse.supportsV1Alarm;
|
|
552
|
+
const supportedNotificationTypes = suppResponse.supportedNotificationTypes;
|
|
553
|
+
const supportedNotificationNames = supportedNotificationTypes.map(getNotificationName);
|
|
554
|
+
const supportedNotificationEvents = new Map();
|
|
555
|
+
const logMessage = `received supported notification types:${supportedNotificationNames
|
|
556
|
+
.map((name) => `\n· ${name}`)
|
|
557
|
+
.join("")}`;
|
|
558
|
+
ctx.logNode(node.id, {
|
|
559
|
+
endpoint: this.endpointIndex,
|
|
560
|
+
message: logMessage,
|
|
561
|
+
direction: "inbound",
|
|
562
|
+
});
|
|
563
|
+
if (api.version >= 3) {
|
|
564
|
+
// Query each notification for its supported events
|
|
565
|
+
for (let i = 0; i < supportedNotificationTypes.length; i++) {
|
|
566
|
+
const type = supportedNotificationTypes[i];
|
|
567
|
+
const name = supportedNotificationNames[i];
|
|
568
|
+
ctx.logNode(node.id, {
|
|
569
|
+
endpoint: this.endpointIndex,
|
|
570
|
+
message: `querying supported notification events for ${name}...`,
|
|
571
|
+
direction: "outbound",
|
|
572
|
+
});
|
|
573
|
+
const supportedEvents = await api.getSupportedEvents(type);
|
|
574
|
+
if (supportedEvents) {
|
|
575
|
+
supportedNotificationEvents.set(type, supportedEvents);
|
|
576
|
+
ctx.logNode(node.id, {
|
|
577
|
+
endpoint: this.endpointIndex,
|
|
578
|
+
message: `received supported notification events for ${name}: ${supportedEvents
|
|
579
|
+
.map(String)
|
|
580
|
+
.join(", ")}`,
|
|
581
|
+
direction: "inbound",
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
// Determine whether the node is a push or pull node
|
|
587
|
+
let notificationMode = this.getValue(ctx, NotificationCCValues.notificationMode);
|
|
588
|
+
if (notificationMode !== "push" && notificationMode !== "pull") {
|
|
589
|
+
notificationMode = await this.determineNotificationMode(ctx, api, supportedNotificationEvents);
|
|
590
|
+
this.setValue(ctx, NotificationCCValues.notificationMode, notificationMode);
|
|
591
|
+
}
|
|
592
|
+
if (notificationMode === "pull") {
|
|
593
|
+
await this.refreshValues(ctx);
|
|
594
|
+
} /* if (notificationMode === "push") */
|
|
595
|
+
else {
|
|
596
|
+
for (let i = 0; i < supportedNotificationTypes.length; i++) {
|
|
597
|
+
const type = supportedNotificationTypes[i];
|
|
598
|
+
const name = supportedNotificationNames[i];
|
|
599
|
+
const notification = getNotification(type);
|
|
600
|
+
// Enable reports for each notification type
|
|
601
|
+
ctx.logNode(node.id, {
|
|
602
|
+
endpoint: this.endpointIndex,
|
|
603
|
+
message: `enabling notifications for ${name}...`,
|
|
604
|
+
direction: "outbound",
|
|
605
|
+
});
|
|
606
|
+
await api.set(type, true);
|
|
607
|
+
// Set the value to idle if possible and there is no value yet
|
|
608
|
+
if (notification) {
|
|
609
|
+
const events = supportedNotificationEvents.get(type);
|
|
610
|
+
if (events) {
|
|
611
|
+
// Find all variables that are supported by this node and have an idle state
|
|
612
|
+
for (const variable of notification.variables
|
|
613
|
+
.filter((v) => !!v.idle)) {
|
|
614
|
+
if ([...variable.states.keys()].some((key) => events.includes(key))) {
|
|
615
|
+
const value = NotificationCCValues
|
|
616
|
+
.notificationVariable(notification.name, variable.name);
|
|
617
|
+
// Set the value to idle if it has no value yet
|
|
618
|
+
// TODO: GH#1028
|
|
619
|
+
// * do this only if the last update was more than 5 minutes ago
|
|
620
|
+
// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start
|
|
621
|
+
if (this.getValue(ctx, value)
|
|
622
|
+
== undefined) {
|
|
623
|
+
this.setValue(ctx, value, 0);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
// Only create metadata for V1 values if necessary
|
|
633
|
+
if (api.version === 1 || supportsV1Alarm) {
|
|
634
|
+
this.ensureMetadata(ctx, NotificationCCValues.alarmType);
|
|
635
|
+
this.ensureMetadata(ctx, NotificationCCValues.alarmLevel);
|
|
636
|
+
}
|
|
637
|
+
// Also create metadata for values mapped through compat config
|
|
638
|
+
const mappings = ctx.getDeviceConfig?.(this.nodeId)
|
|
639
|
+
?.compat?.alarmMapping;
|
|
640
|
+
if (mappings) {
|
|
641
|
+
// Find all mappings to a valid notification variable
|
|
642
|
+
const supportedNotifications = new Map();
|
|
643
|
+
for (const { to } of mappings) {
|
|
644
|
+
const notification = getNotification(to.notificationType);
|
|
645
|
+
if (!notification)
|
|
646
|
+
continue;
|
|
647
|
+
const valueConfig = getNotificationValue(notification, to.notificationEvent);
|
|
648
|
+
// Remember supported notification types and events to create the internal values later
|
|
649
|
+
if (!supportedNotifications.has(to.notificationType)) {
|
|
650
|
+
supportedNotifications.set(to.notificationType, new Set());
|
|
651
|
+
}
|
|
652
|
+
const supportedNotificationTypesSet = supportedNotifications
|
|
653
|
+
.get(to.notificationType);
|
|
654
|
+
supportedNotificationTypesSet.add(to.notificationEvent);
|
|
655
|
+
if (valueConfig?.type !== "state")
|
|
656
|
+
continue;
|
|
657
|
+
const notificationValue = NotificationCCValues
|
|
658
|
+
.notificationVariable(notification.name, valueConfig.variableName);
|
|
659
|
+
// Create or update the metadata
|
|
660
|
+
const metadata = getNotificationValueMetadata(this.getMetadata(ctx, notificationValue), notification, valueConfig);
|
|
661
|
+
this.setMetadata(ctx, notificationValue, metadata);
|
|
662
|
+
// Set the value to idle if it has no value yet
|
|
663
|
+
if (valueConfig.idle) {
|
|
664
|
+
// TODO: GH#1028
|
|
665
|
+
// * do this only if the last update was more than 5 minutes ago
|
|
666
|
+
// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start
|
|
667
|
+
if (this.getValue(ctx, notificationValue) == undefined) {
|
|
668
|
+
this.setValue(ctx, notificationValue, 0);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
// Remember supported notification types and events in the cache
|
|
673
|
+
this.setValue(ctx, NotificationCCValues.supportedNotificationTypes, [...supportedNotifications.keys()]);
|
|
674
|
+
for (const [type, events] of supportedNotifications) {
|
|
675
|
+
this.setValue(ctx, NotificationCCValues.supportedNotificationEvents(type), [...events]);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
// Remember that the interview is complete
|
|
679
|
+
this.setInterviewComplete(ctx, true);
|
|
680
|
+
}
|
|
681
|
+
async refreshValues(ctx) {
|
|
682
|
+
const node = this.getNode(ctx);
|
|
683
|
+
// Refreshing values only works on pull nodes
|
|
684
|
+
if (NotificationCC.getNotificationMode(ctx, node) === "pull") {
|
|
685
|
+
const endpoint = this.getEndpoint(ctx);
|
|
686
|
+
const api = CCAPI.create(CommandClasses.Notification, ctx, endpoint).withOptions({
|
|
687
|
+
priority: MessagePriority.NodeQuery,
|
|
688
|
+
});
|
|
689
|
+
// Load supported notification types and events from cache
|
|
690
|
+
const supportedNotificationTypes = this.getValue(ctx, NotificationCCValues.supportedNotificationTypes) ?? [];
|
|
691
|
+
const supportedNotificationNames = supportedNotificationTypes.map(getNotificationName);
|
|
692
|
+
for (let i = 0; i < supportedNotificationTypes.length; i++) {
|
|
693
|
+
const type = supportedNotificationTypes[i];
|
|
694
|
+
const name = supportedNotificationNames[i];
|
|
695
|
+
// Always query each notification for its current status
|
|
696
|
+
ctx.logNode(node.id, {
|
|
697
|
+
endpoint: this.endpointIndex,
|
|
698
|
+
message: `querying notification status for ${name}...`,
|
|
699
|
+
direction: "outbound",
|
|
700
|
+
});
|
|
701
|
+
const response = await api.getInternal({
|
|
702
|
+
notificationType: type,
|
|
703
|
+
});
|
|
704
|
+
// NotificationReports don't store their values themselves,
|
|
705
|
+
// because the behaviour is too complex and spans the lifetime
|
|
706
|
+
// of several reports. Thus we handle it in the Node instance
|
|
707
|
+
// @ts-expect-error
|
|
708
|
+
if (response)
|
|
709
|
+
await node.handleCommand(response);
|
|
710
|
+
}
|
|
711
|
+
// Remember when we did this
|
|
712
|
+
this.setValue(ctx, NotificationCCValues.lastRefresh, Date.now());
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
shouldRefreshValues(ctx) {
|
|
716
|
+
// Pull-mode nodes must be polled regularly
|
|
717
|
+
const isPullMode = NotificationCC.getNotificationMode(ctx, this.getNode(ctx)) === "pull";
|
|
718
|
+
if (!isPullMode)
|
|
719
|
+
return false;
|
|
720
|
+
const lastUpdated = this.getValue(ctx, NotificationCCValues.lastRefresh);
|
|
721
|
+
return (lastUpdated == undefined
|
|
722
|
+
|| Date.now() - lastUpdated > timespan.hours(6));
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
return NotificationCC = _classThis;
|
|
726
|
+
})();
|
|
727
|
+
export { NotificationCC };
|
|
728
|
+
let NotificationCCSet = (() => {
|
|
729
|
+
let _classDecorators = [CCCommand(NotificationCommand.Set), useSupervision()];
|
|
730
|
+
let _classDescriptor;
|
|
731
|
+
let _classExtraInitializers = [];
|
|
732
|
+
let _classThis;
|
|
733
|
+
let _classSuper = NotificationCC;
|
|
734
|
+
var NotificationCCSet = class extends _classSuper {
|
|
735
|
+
static { _classThis = this; }
|
|
736
|
+
static {
|
|
737
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
738
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
739
|
+
NotificationCCSet = _classThis = _classDescriptor.value;
|
|
740
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
741
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
742
|
+
}
|
|
743
|
+
constructor(options) {
|
|
744
|
+
super(options);
|
|
745
|
+
this.notificationType = options.notificationType;
|
|
746
|
+
this.notificationStatus = options.notificationStatus;
|
|
747
|
+
}
|
|
748
|
+
static from(raw, ctx) {
|
|
749
|
+
validatePayload(raw.payload.length >= 2);
|
|
750
|
+
const notificationType = raw.payload[0];
|
|
751
|
+
const notificationStatus = raw.payload[1] === 0xff;
|
|
752
|
+
return new this({
|
|
753
|
+
nodeId: ctx.sourceNodeId,
|
|
754
|
+
notificationType,
|
|
755
|
+
notificationStatus,
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
notificationType;
|
|
759
|
+
notificationStatus;
|
|
760
|
+
serialize(ctx) {
|
|
761
|
+
this.payload = Bytes.from([
|
|
762
|
+
this.notificationType,
|
|
763
|
+
this.notificationStatus ? 0xff : 0x00,
|
|
764
|
+
]);
|
|
765
|
+
return super.serialize(ctx);
|
|
766
|
+
}
|
|
767
|
+
toLogEntry(ctx) {
|
|
768
|
+
return {
|
|
769
|
+
...super.toLogEntry(ctx),
|
|
770
|
+
message: {
|
|
771
|
+
"notification type": getNotificationName(this.notificationType),
|
|
772
|
+
status: this.notificationStatus,
|
|
773
|
+
},
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
return NotificationCCSet = _classThis;
|
|
778
|
+
})();
|
|
779
|
+
export { NotificationCCSet };
|
|
780
|
+
let NotificationCCReport = (() => {
|
|
781
|
+
let _classDecorators = [CCCommand(NotificationCommand.Report), useSupervision()];
|
|
782
|
+
let _classDescriptor;
|
|
783
|
+
let _classExtraInitializers = [];
|
|
784
|
+
let _classThis;
|
|
785
|
+
let _classSuper = NotificationCC;
|
|
786
|
+
var NotificationCCReport = class extends _classSuper {
|
|
787
|
+
static { _classThis = this; }
|
|
788
|
+
static {
|
|
789
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
790
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
791
|
+
NotificationCCReport = _classThis = _classDescriptor.value;
|
|
792
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
793
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
794
|
+
}
|
|
795
|
+
constructor(options) {
|
|
796
|
+
super(options);
|
|
797
|
+
if (options.alarmType != undefined) {
|
|
798
|
+
this.alarmType = options.alarmType;
|
|
799
|
+
this.alarmLevel = options.alarmLevel;
|
|
800
|
+
}
|
|
801
|
+
if (options.notificationType != undefined) {
|
|
802
|
+
this.notificationType = options.notificationType;
|
|
803
|
+
this.notificationStatus = options.notificationStatus ?? true;
|
|
804
|
+
this.notificationEvent = options.notificationEvent;
|
|
805
|
+
this.eventParameters = options.eventParameters;
|
|
806
|
+
this.sequenceNumber = options.sequenceNumber;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
static from(raw, ctx) {
|
|
810
|
+
validatePayload(raw.payload.length >= 2);
|
|
811
|
+
const alarmType = raw.payload[0];
|
|
812
|
+
const alarmLevel = raw.payload[1];
|
|
813
|
+
// Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that
|
|
814
|
+
if (raw.payload.length < 7) {
|
|
815
|
+
return new this({
|
|
816
|
+
nodeId: ctx.sourceNodeId,
|
|
817
|
+
alarmType,
|
|
818
|
+
alarmLevel,
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
// V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.
|
|
822
|
+
// Don't use the version to decide because we might discard notifications
|
|
823
|
+
// before the interview is complete
|
|
824
|
+
const notificationStatus = raw.payload[3];
|
|
825
|
+
const notificationType = raw.payload[4];
|
|
826
|
+
const notificationEvent = raw.payload[5];
|
|
827
|
+
const containsSeqNum = !!(raw.payload[6] & 0b1000_0000);
|
|
828
|
+
const numEventParams = raw.payload[6] & 0b11111;
|
|
829
|
+
let eventParameters;
|
|
830
|
+
if (numEventParams > 0) {
|
|
831
|
+
validatePayload(raw.payload.length >= 7 + numEventParams);
|
|
832
|
+
eventParameters = raw.payload.subarray(7, 7 + numEventParams);
|
|
833
|
+
}
|
|
834
|
+
let sequenceNumber;
|
|
835
|
+
if (containsSeqNum) {
|
|
836
|
+
validatePayload(raw.payload.length >= 7 + numEventParams + 1);
|
|
837
|
+
sequenceNumber = raw.payload[7 + numEventParams];
|
|
838
|
+
}
|
|
839
|
+
return new this({
|
|
840
|
+
nodeId: ctx.sourceNodeId,
|
|
841
|
+
alarmType,
|
|
842
|
+
alarmLevel,
|
|
843
|
+
notificationStatus,
|
|
844
|
+
notificationType,
|
|
845
|
+
notificationEvent,
|
|
846
|
+
eventParameters,
|
|
847
|
+
sequenceNumber,
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
persistValues(ctx) {
|
|
851
|
+
if (!super.persistValues(ctx))
|
|
852
|
+
return false;
|
|
853
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
854
|
+
// Check if we need to re-interpret the alarm values somehow
|
|
855
|
+
if (this.alarmType != undefined
|
|
856
|
+
&& this.alarmLevel != undefined
|
|
857
|
+
&& this.alarmType !== 0) {
|
|
858
|
+
if (ccVersion >= 2) {
|
|
859
|
+
// Check if the device actually supports Notification CC, but chooses
|
|
860
|
+
// to send Alarm frames instead (GH#1034)
|
|
861
|
+
const supportedNotificationTypes = this.getValue(ctx, NotificationCCValues.supportedNotificationTypes);
|
|
862
|
+
if (isArray(supportedNotificationTypes)
|
|
863
|
+
&& supportedNotificationTypes.includes(this.alarmType)) {
|
|
864
|
+
const supportedNotificationEvents = this.getValue(ctx, NotificationCCValues.supportedNotificationEvents(this.alarmType));
|
|
865
|
+
if (isArray(supportedNotificationEvents)
|
|
866
|
+
&& supportedNotificationEvents.includes(this.alarmLevel)) {
|
|
867
|
+
// This alarm frame corresponds to a valid notification event
|
|
868
|
+
ctx.logNode(this.nodeId, `treating V1 Alarm frame as Notification Report`);
|
|
869
|
+
this.notificationType = this.alarmType;
|
|
870
|
+
this.notificationEvent = this.alarmLevel;
|
|
871
|
+
this.alarmType = undefined;
|
|
872
|
+
this.alarmLevel = undefined;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
// V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report
|
|
878
|
+
const mapping = ctx.getDeviceConfig?.(this.nodeId)?.compat?.alarmMapping;
|
|
879
|
+
const match = mapping?.find((m) => m.from.alarmType === this.alarmType
|
|
880
|
+
&& (m.from.alarmLevel == undefined
|
|
881
|
+
|| m.from.alarmLevel === this.alarmLevel));
|
|
882
|
+
if (match) {
|
|
883
|
+
ctx.logNode(this.nodeId, `compat mapping found, treating V1 Alarm frame as Notification Report`);
|
|
884
|
+
this.notificationType = match.to.notificationType;
|
|
885
|
+
this.notificationEvent = match.to.notificationEvent;
|
|
886
|
+
if (match.to.eventParameters) {
|
|
887
|
+
this.eventParameters = {};
|
|
888
|
+
for (const [key, val] of Object.entries(match.to.eventParameters)) {
|
|
889
|
+
if (typeof val === "number") {
|
|
890
|
+
this.eventParameters[key] = val;
|
|
891
|
+
}
|
|
892
|
+
else if (val === "alarmLevel") {
|
|
893
|
+
this.eventParameters[key] = this.alarmLevel;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
// After mapping we do not set the legacy V1 values to undefined
|
|
898
|
+
// Otherwise, adding a new mapping will be a breaking change
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
// Now we can interpret the event parameters and turn them into something useful
|
|
903
|
+
this.parseEventParameters(ctx);
|
|
904
|
+
if (this.alarmType != undefined) {
|
|
905
|
+
const alarmTypeValue = NotificationCCValues.alarmType;
|
|
906
|
+
this.ensureMetadata(ctx, alarmTypeValue);
|
|
907
|
+
this.setValue(ctx, alarmTypeValue, this.alarmType);
|
|
908
|
+
}
|
|
909
|
+
if (this.alarmLevel != undefined) {
|
|
910
|
+
const alarmLevelValue = NotificationCCValues.alarmLevel;
|
|
911
|
+
this.ensureMetadata(ctx, alarmLevelValue);
|
|
912
|
+
this.setValue(ctx, alarmLevelValue, this.alarmLevel);
|
|
913
|
+
}
|
|
914
|
+
return true;
|
|
915
|
+
}
|
|
916
|
+
alarmType;
|
|
917
|
+
alarmLevel;
|
|
918
|
+
notificationType;
|
|
919
|
+
notificationStatus;
|
|
920
|
+
notificationEvent;
|
|
921
|
+
eventParameters;
|
|
922
|
+
sequenceNumber;
|
|
923
|
+
toLogEntry(ctx) {
|
|
924
|
+
let message = {};
|
|
925
|
+
if (this.alarmType) {
|
|
926
|
+
message = {
|
|
927
|
+
"V1 alarm type": this.alarmType,
|
|
928
|
+
"V1 alarm level": this.alarmLevel,
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
let valueConfig;
|
|
932
|
+
if (this.notificationType) {
|
|
933
|
+
const notification = getNotification(this.notificationType);
|
|
934
|
+
if (notification) {
|
|
935
|
+
valueConfig = getNotificationValue(notification, this.notificationEvent);
|
|
936
|
+
}
|
|
937
|
+
if (valueConfig) {
|
|
938
|
+
message = {
|
|
939
|
+
...message,
|
|
940
|
+
"notification type": getNotificationName(this.notificationType),
|
|
941
|
+
"notification status": this.notificationStatus,
|
|
942
|
+
[`notification ${valueConfig.type}`]: valueConfig.label
|
|
943
|
+
?? `Unknown (${num2hex(this.notificationEvent)})`,
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
else if (this.notificationEvent === 0x00) {
|
|
947
|
+
message = {
|
|
948
|
+
...message,
|
|
949
|
+
"notification type": this.notificationType,
|
|
950
|
+
"notification status": this.notificationStatus,
|
|
951
|
+
"notification state": "idle",
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
message = {
|
|
956
|
+
...message,
|
|
957
|
+
"notification type": this.notificationType,
|
|
958
|
+
"notification status": this.notificationStatus,
|
|
959
|
+
"notification event": num2hex(this.notificationEvent),
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
if (this.sequenceNumber != undefined) {
|
|
964
|
+
message["sequence number"] = this.sequenceNumber;
|
|
965
|
+
}
|
|
966
|
+
if (this.eventParameters != undefined) {
|
|
967
|
+
if (typeof this.eventParameters === "number") {
|
|
968
|
+
// Try to look up the enum label
|
|
969
|
+
let found = false;
|
|
970
|
+
if (valueConfig?.parameter?.type === "enum") {
|
|
971
|
+
const label = valueConfig.parameter.values[this.eventParameters];
|
|
972
|
+
if (label) {
|
|
973
|
+
message["state parameters"] = label;
|
|
974
|
+
found = true;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (!found) {
|
|
978
|
+
message["state parameters"] = num2hex(this.eventParameters);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
else if (isUint8Array(this.eventParameters)) {
|
|
982
|
+
message["event parameters"] = buffer2hex(this.eventParameters);
|
|
983
|
+
}
|
|
984
|
+
else if (this.eventParameters instanceof Duration) {
|
|
985
|
+
message["event parameters"] = this.eventParameters.toString();
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
message["event parameters"] = Object.entries(this.eventParameters)
|
|
989
|
+
.map(([param, val]) => `\n ${param}: ${num2hex(val)}`)
|
|
990
|
+
.join("");
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
else if (valueConfig?.parameter?.type === "enum"
|
|
994
|
+
&& valueConfig.parameter.default != undefined) {
|
|
995
|
+
const label = valueConfig.parameter.values[valueConfig.parameter.default];
|
|
996
|
+
if (label) {
|
|
997
|
+
message["state parameters"] = `${label} (omitted)`;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return {
|
|
1001
|
+
...super.toLogEntry(ctx),
|
|
1002
|
+
message,
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
parseEventParameters(ctx) {
|
|
1006
|
+
// This only makes sense for V2+ notifications
|
|
1007
|
+
if (this.notificationType == undefined
|
|
1008
|
+
|| this.notificationEvent == undefined) {
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
// Look up the received notification and value in the config
|
|
1012
|
+
const notification = getNotification(this.notificationType);
|
|
1013
|
+
if (!notification)
|
|
1014
|
+
return;
|
|
1015
|
+
const valueConfig = getNotificationValue(notification, this.notificationEvent);
|
|
1016
|
+
if (!valueConfig)
|
|
1017
|
+
return;
|
|
1018
|
+
// Parse the event parameters if possible
|
|
1019
|
+
if (valueConfig.parameter?.type === "duration") {
|
|
1020
|
+
// This only makes sense if the event parameters are a buffer
|
|
1021
|
+
if (!isUint8Array(this.eventParameters)) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
// The parameters contain a Duration
|
|
1025
|
+
this.eventParameters = Duration.parseReport(this.eventParameters[0]);
|
|
1026
|
+
}
|
|
1027
|
+
else if (valueConfig.parameter?.type === "commandclass") {
|
|
1028
|
+
// This only makes sense if the event parameters are a buffer
|
|
1029
|
+
if (!isUint8Array(this.eventParameters)) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
// The parameters **should** contain a CC, however there might be some exceptions
|
|
1033
|
+
if (this.eventParameters.length === 1
|
|
1034
|
+
&& notification.type === 0x06
|
|
1035
|
+
&& (this.notificationEvent === 0x05
|
|
1036
|
+
|| this.notificationEvent === 0x06)) {
|
|
1037
|
+
// Access control -> Keypad Lock/Unlock operation
|
|
1038
|
+
// Some devices only send the User ID, not a complete CC payload
|
|
1039
|
+
this.eventParameters = {
|
|
1040
|
+
userId: this.eventParameters[0],
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
// Try to parse the event parameters - if this fails, we should still handle the notification report
|
|
1045
|
+
try {
|
|
1046
|
+
// Convert CommandClass instances to a standardized object representation
|
|
1047
|
+
const cc = CommandClass.parse(this.eventParameters, {
|
|
1048
|
+
...ctx,
|
|
1049
|
+
frameType: "singlecast",
|
|
1050
|
+
sourceNodeId: this.nodeId,
|
|
1051
|
+
// Security encapsulation is handled outside of this CC,
|
|
1052
|
+
// so it is not needed here:
|
|
1053
|
+
hasSecurityClass: () => false,
|
|
1054
|
+
getHighestSecurityClass: () => SecurityClass.None,
|
|
1055
|
+
setSecurityClass: () => { },
|
|
1056
|
+
securityManager: undefined,
|
|
1057
|
+
securityManager2: undefined,
|
|
1058
|
+
securityManagerLR: undefined,
|
|
1059
|
+
});
|
|
1060
|
+
validatePayload(!(cc instanceof InvalidCC));
|
|
1061
|
+
cc.encapsulatingCC = this;
|
|
1062
|
+
if (isNotificationEventPayload(cc)) {
|
|
1063
|
+
this.eventParameters = cc
|
|
1064
|
+
.toNotificationEventParameters();
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
// If a CC has no good toJSON() representation, we're only interested in the payload
|
|
1068
|
+
let json = cc.toJSON();
|
|
1069
|
+
if ("nodeId" in json
|
|
1070
|
+
&& "ccId" in json
|
|
1071
|
+
&& "payload" in json) {
|
|
1072
|
+
json = pick(json, ["payload"]);
|
|
1073
|
+
}
|
|
1074
|
+
this.eventParameters = json;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
catch (e) {
|
|
1078
|
+
if (isZWaveError(e)
|
|
1079
|
+
&& e.code
|
|
1080
|
+
=== ZWaveErrorCodes.PacketFormat_InvalidPayload
|
|
1081
|
+
&& isUint8Array(this.eventParameters)) {
|
|
1082
|
+
const { ccId, ccCommand } = CCRaw.parse(this.eventParameters);
|
|
1083
|
+
if (ccId === CommandClasses["User Code"]
|
|
1084
|
+
&& ccCommand === UserCodeCommand.Report
|
|
1085
|
+
&& this.eventParameters.length >= 3) {
|
|
1086
|
+
// Access control -> Keypad Lock/Unlock operation
|
|
1087
|
+
// Some devices report the user code with truncated UserCode reports
|
|
1088
|
+
this.eventParameters = {
|
|
1089
|
+
userId: this.eventParameters[2],
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
ctx.logNode(this.nodeId, `Failed to parse Notification CC event parameters, ignoring them...`, "error");
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
else {
|
|
1097
|
+
// unexpected error
|
|
1098
|
+
throw e;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
else if (valueConfig.parameter?.type === "value") {
|
|
1104
|
+
// This only makes sense if the event parameters are a buffer
|
|
1105
|
+
if (!isUint8Array(this.eventParameters)) {
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
// The parameters contain a named value
|
|
1109
|
+
this.eventParameters = {
|
|
1110
|
+
[valueConfig.parameter.propertyName]: Bytes.view(this.eventParameters)
|
|
1111
|
+
.readUIntBE(0, this.eventParameters.length),
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
else if (valueConfig.parameter?.type === "enum") {
|
|
1115
|
+
// The parameters may contain an enum value
|
|
1116
|
+
this.eventParameters = isUint8Array(this.eventParameters)
|
|
1117
|
+
&& this.eventParameters.length === 1
|
|
1118
|
+
? this.eventParameters[0]
|
|
1119
|
+
: undefined;
|
|
1120
|
+
// Some devices send notifications without an event parameter when they should.
|
|
1121
|
+
// In this case, fall back to the default value where possible.
|
|
1122
|
+
if (this.eventParameters == undefined
|
|
1123
|
+
&& valueConfig.parameter.default != undefined) {
|
|
1124
|
+
this.eventParameters = valueConfig.parameter.default;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
serialize(ctx) {
|
|
1129
|
+
if (this.notificationType != undefined) {
|
|
1130
|
+
if (this.notificationEvent == undefined) {
|
|
1131
|
+
throw new ZWaveError(`Notification CC reports requires the notification event to be set!`, ZWaveErrorCodes.Argument_Invalid);
|
|
1132
|
+
}
|
|
1133
|
+
else if (this.eventParameters != undefined
|
|
1134
|
+
&& !isUint8Array(this.eventParameters)) {
|
|
1135
|
+
throw new ZWaveError(`When sending Notification CC reports, the event parameters can only be buffers!`, ZWaveErrorCodes.Argument_Invalid);
|
|
1136
|
+
}
|
|
1137
|
+
const controlByte = (this.sequenceNumber != undefined ? 0b1000_0000 : 0)
|
|
1138
|
+
| ((this.eventParameters?.length ?? 0) & 0b11111);
|
|
1139
|
+
this.payload = Bytes.from([
|
|
1140
|
+
0,
|
|
1141
|
+
0,
|
|
1142
|
+
0,
|
|
1143
|
+
0xff,
|
|
1144
|
+
this.notificationType,
|
|
1145
|
+
this.notificationEvent,
|
|
1146
|
+
controlByte,
|
|
1147
|
+
]);
|
|
1148
|
+
if (this.eventParameters) {
|
|
1149
|
+
this.payload = Bytes.concat([
|
|
1150
|
+
this.payload,
|
|
1151
|
+
this.eventParameters,
|
|
1152
|
+
]);
|
|
1153
|
+
}
|
|
1154
|
+
if (this.sequenceNumber != undefined) {
|
|
1155
|
+
this.payload = Bytes.concat([
|
|
1156
|
+
this.payload,
|
|
1157
|
+
Bytes.from([this.sequenceNumber]),
|
|
1158
|
+
]);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
else {
|
|
1162
|
+
this.payload = Bytes.from([
|
|
1163
|
+
this.alarmType ?? 0x00,
|
|
1164
|
+
this.alarmLevel ?? 0x00,
|
|
1165
|
+
]);
|
|
1166
|
+
}
|
|
1167
|
+
return super.serialize(ctx);
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
return NotificationCCReport = _classThis;
|
|
1171
|
+
})();
|
|
1172
|
+
export { NotificationCCReport };
|
|
1173
|
+
let NotificationCCGet = (() => {
|
|
1174
|
+
let _classDecorators = [CCCommand(NotificationCommand.Get), expectedCCResponse(NotificationCCReport)];
|
|
1175
|
+
let _classDescriptor;
|
|
1176
|
+
let _classExtraInitializers = [];
|
|
1177
|
+
let _classThis;
|
|
1178
|
+
let _classSuper = NotificationCC;
|
|
1179
|
+
var NotificationCCGet = class extends _classSuper {
|
|
1180
|
+
static { _classThis = this; }
|
|
1181
|
+
static {
|
|
1182
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1183
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1184
|
+
NotificationCCGet = _classThis = _classDescriptor.value;
|
|
1185
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1186
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1187
|
+
}
|
|
1188
|
+
constructor(options) {
|
|
1189
|
+
super(options);
|
|
1190
|
+
if ("alarmType" in options) {
|
|
1191
|
+
this.alarmType = options.alarmType;
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
this.notificationType = options.notificationType;
|
|
1195
|
+
this.notificationEvent = options.notificationEvent;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
static from(raw, ctx) {
|
|
1199
|
+
validatePayload(raw.payload.length >= 1);
|
|
1200
|
+
if (raw.payload.length >= 2) {
|
|
1201
|
+
const notificationType = raw.payload[1];
|
|
1202
|
+
let notificationEvent;
|
|
1203
|
+
if (raw.payload.length >= 3 && notificationType != 0xff) {
|
|
1204
|
+
notificationEvent = raw.payload[2];
|
|
1205
|
+
}
|
|
1206
|
+
return new this({
|
|
1207
|
+
nodeId: ctx.sourceNodeId,
|
|
1208
|
+
notificationType,
|
|
1209
|
+
notificationEvent,
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
const alarmType = raw.payload[0];
|
|
1214
|
+
return new this({
|
|
1215
|
+
nodeId: ctx.sourceNodeId,
|
|
1216
|
+
alarmType,
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
/** Proprietary V1/V2 alarm type */
|
|
1221
|
+
alarmType;
|
|
1222
|
+
/** Regulated V3+ notification type */
|
|
1223
|
+
notificationType;
|
|
1224
|
+
notificationEvent;
|
|
1225
|
+
serialize(ctx) {
|
|
1226
|
+
const notificationEvent = this.notificationEvent === 0xff
|
|
1227
|
+
? 0x00
|
|
1228
|
+
: this.notificationEvent;
|
|
1229
|
+
this.payload = Bytes.from([
|
|
1230
|
+
this.alarmType ?? 0x00,
|
|
1231
|
+
this.notificationType ?? 0xff,
|
|
1232
|
+
notificationEvent ?? 0x00,
|
|
1233
|
+
]);
|
|
1234
|
+
return super.serialize(ctx);
|
|
1235
|
+
}
|
|
1236
|
+
toLogEntry(ctx) {
|
|
1237
|
+
const message = {};
|
|
1238
|
+
if (this.alarmType != undefined) {
|
|
1239
|
+
message["V1 alarm type"] = this.alarmType;
|
|
1240
|
+
}
|
|
1241
|
+
if (this.notificationType != undefined) {
|
|
1242
|
+
message["notification type"] = getNotificationName(this.notificationType);
|
|
1243
|
+
if (this.notificationEvent != undefined) {
|
|
1244
|
+
message["notification event"] = getNotificationEventName(this.notificationType, this.notificationEvent);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
return {
|
|
1248
|
+
...super.toLogEntry(ctx),
|
|
1249
|
+
message,
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
return NotificationCCGet = _classThis;
|
|
1254
|
+
})();
|
|
1255
|
+
export { NotificationCCGet };
|
|
1256
|
+
let NotificationCCSupportedReport = (() => {
|
|
1257
|
+
let _classDecorators = [CCCommand(NotificationCommand.SupportedReport), ccValueProperty("supportsV1Alarm", NotificationCCValues.supportsV1Alarm), ccValueProperty("supportedNotificationTypes", NotificationCCValues.supportedNotificationTypes)];
|
|
1258
|
+
let _classDescriptor;
|
|
1259
|
+
let _classExtraInitializers = [];
|
|
1260
|
+
let _classThis;
|
|
1261
|
+
let _classSuper = NotificationCC;
|
|
1262
|
+
var NotificationCCSupportedReport = class extends _classSuper {
|
|
1263
|
+
static { _classThis = this; }
|
|
1264
|
+
static {
|
|
1265
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1266
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1267
|
+
NotificationCCSupportedReport = _classThis = _classDescriptor.value;
|
|
1268
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1269
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1270
|
+
}
|
|
1271
|
+
constructor(options) {
|
|
1272
|
+
super(options);
|
|
1273
|
+
this.supportsV1Alarm = options.supportsV1Alarm;
|
|
1274
|
+
this.supportedNotificationTypes = options.supportedNotificationTypes;
|
|
1275
|
+
}
|
|
1276
|
+
static from(raw, ctx) {
|
|
1277
|
+
validatePayload(raw.payload.length >= 1);
|
|
1278
|
+
const supportsV1Alarm = !!(raw.payload[0] & 0b1000_0000);
|
|
1279
|
+
const numBitMaskBytes = raw.payload[0] & 0b0001_1111;
|
|
1280
|
+
validatePayload(numBitMaskBytes > 0, raw.payload.length >= 1 + numBitMaskBytes);
|
|
1281
|
+
const notificationBitMask = raw.payload.subarray(1, 1 + numBitMaskBytes);
|
|
1282
|
+
const supportedNotificationTypes = parseBitMask(notificationBitMask,
|
|
1283
|
+
// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0
|
|
1284
|
+
0);
|
|
1285
|
+
return new this({
|
|
1286
|
+
nodeId: ctx.sourceNodeId,
|
|
1287
|
+
supportsV1Alarm,
|
|
1288
|
+
supportedNotificationTypes,
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
supportsV1Alarm;
|
|
1292
|
+
supportedNotificationTypes;
|
|
1293
|
+
serialize(ctx) {
|
|
1294
|
+
const bitMask = encodeBitMask(this.supportedNotificationTypes, Math.max(...this.supportedNotificationTypes), 0);
|
|
1295
|
+
this.payload = Bytes.concat([
|
|
1296
|
+
Bytes.from([
|
|
1297
|
+
(this.supportsV1Alarm ? 0b1000_0000 : 0) | bitMask.length,
|
|
1298
|
+
]),
|
|
1299
|
+
bitMask,
|
|
1300
|
+
]);
|
|
1301
|
+
return super.serialize(ctx);
|
|
1302
|
+
}
|
|
1303
|
+
toLogEntry(ctx) {
|
|
1304
|
+
return {
|
|
1305
|
+
...super.toLogEntry(ctx),
|
|
1306
|
+
message: {
|
|
1307
|
+
"supports V1 alarm": this.supportsV1Alarm,
|
|
1308
|
+
"supported notification types": this.supportedNotificationTypes
|
|
1309
|
+
.map((t) => `\n· ${getNotificationName(t)}`)
|
|
1310
|
+
.join(""),
|
|
1311
|
+
},
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
return NotificationCCSupportedReport = _classThis;
|
|
1316
|
+
})();
|
|
1317
|
+
export { NotificationCCSupportedReport };
|
|
1318
|
+
let NotificationCCSupportedGet = (() => {
|
|
1319
|
+
let _classDecorators = [CCCommand(NotificationCommand.SupportedGet), expectedCCResponse(NotificationCCSupportedReport)];
|
|
1320
|
+
let _classDescriptor;
|
|
1321
|
+
let _classExtraInitializers = [];
|
|
1322
|
+
let _classThis;
|
|
1323
|
+
let _classSuper = NotificationCC;
|
|
1324
|
+
var NotificationCCSupportedGet = class extends _classSuper {
|
|
1325
|
+
static { _classThis = this; }
|
|
1326
|
+
static {
|
|
1327
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1328
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1329
|
+
NotificationCCSupportedGet = _classThis = _classDescriptor.value;
|
|
1330
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1331
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
return NotificationCCSupportedGet = _classThis;
|
|
1335
|
+
})();
|
|
1336
|
+
export { NotificationCCSupportedGet };
|
|
1337
|
+
let NotificationCCEventSupportedReport = (() => {
|
|
1338
|
+
let _classDecorators = [CCCommand(NotificationCommand.EventSupportedReport)];
|
|
1339
|
+
let _classDescriptor;
|
|
1340
|
+
let _classExtraInitializers = [];
|
|
1341
|
+
let _classThis;
|
|
1342
|
+
let _classSuper = NotificationCC;
|
|
1343
|
+
var NotificationCCEventSupportedReport = class extends _classSuper {
|
|
1344
|
+
static { _classThis = this; }
|
|
1345
|
+
static {
|
|
1346
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1347
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1348
|
+
NotificationCCEventSupportedReport = _classThis = _classDescriptor.value;
|
|
1349
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1350
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1351
|
+
}
|
|
1352
|
+
constructor(options) {
|
|
1353
|
+
super(options);
|
|
1354
|
+
this.notificationType = options.notificationType;
|
|
1355
|
+
this.supportedEvents = options.supportedEvents;
|
|
1356
|
+
}
|
|
1357
|
+
static from(raw, ctx) {
|
|
1358
|
+
validatePayload(raw.payload.length >= 1);
|
|
1359
|
+
const notificationType = raw.payload[0];
|
|
1360
|
+
const numBitMaskBytes = raw.payload[1] & 0b000_11111;
|
|
1361
|
+
if (numBitMaskBytes === 0) {
|
|
1362
|
+
// Notification type is not supported
|
|
1363
|
+
return new this({
|
|
1364
|
+
nodeId: ctx.sourceNodeId,
|
|
1365
|
+
notificationType,
|
|
1366
|
+
supportedEvents: [],
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
validatePayload(raw.payload.length >= 2 + numBitMaskBytes);
|
|
1370
|
+
const eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);
|
|
1371
|
+
const supportedEvents = parseBitMask(eventBitMask,
|
|
1372
|
+
// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0
|
|
1373
|
+
0);
|
|
1374
|
+
return new this({
|
|
1375
|
+
nodeId: ctx.sourceNodeId,
|
|
1376
|
+
notificationType,
|
|
1377
|
+
supportedEvents,
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
persistValues(ctx) {
|
|
1381
|
+
if (!super.persistValues(ctx))
|
|
1382
|
+
return false;
|
|
1383
|
+
// Store which events this notification supports
|
|
1384
|
+
this.setValue(ctx, NotificationCCValues.supportedNotificationEvents(this.notificationType), this.supportedEvents);
|
|
1385
|
+
// For each event, predefine the value metadata
|
|
1386
|
+
const notification = getNotification(this.notificationType);
|
|
1387
|
+
if (!notification) {
|
|
1388
|
+
// This is an unknown notification
|
|
1389
|
+
this.setMetadata(ctx, NotificationCCValues.unknownNotificationType(this.notificationType));
|
|
1390
|
+
}
|
|
1391
|
+
else {
|
|
1392
|
+
// This is a standardized notification
|
|
1393
|
+
let isFirst = true;
|
|
1394
|
+
for (const value of this.supportedEvents) {
|
|
1395
|
+
// Find out which property we need to update
|
|
1396
|
+
const valueConfig = getNotificationValue(notification, value);
|
|
1397
|
+
if (valueConfig?.type === "state") {
|
|
1398
|
+
const notificationValue = NotificationCCValues
|
|
1399
|
+
.notificationVariable(notification.name, valueConfig.variableName);
|
|
1400
|
+
// After we've created the metadata initially, extend it
|
|
1401
|
+
const metadata = getNotificationValueMetadata(isFirst
|
|
1402
|
+
? undefined
|
|
1403
|
+
: this.getMetadata(ctx, notificationValue), notification, valueConfig);
|
|
1404
|
+
this.setMetadata(ctx, notificationValue, metadata);
|
|
1405
|
+
isFirst = false;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
return true;
|
|
1410
|
+
}
|
|
1411
|
+
notificationType;
|
|
1412
|
+
supportedEvents;
|
|
1413
|
+
serialize(ctx) {
|
|
1414
|
+
this.payload = Bytes.from([this.notificationType, 0]);
|
|
1415
|
+
if (this.supportedEvents.length > 0) {
|
|
1416
|
+
const bitMask = encodeBitMask(this.supportedEvents, Math.max(...this.supportedEvents), 0);
|
|
1417
|
+
this.payload[1] = bitMask.length;
|
|
1418
|
+
this.payload = Bytes.concat([this.payload, bitMask]);
|
|
1419
|
+
}
|
|
1420
|
+
return super.serialize(ctx);
|
|
1421
|
+
}
|
|
1422
|
+
toLogEntry(ctx) {
|
|
1423
|
+
return {
|
|
1424
|
+
...super.toLogEntry(ctx),
|
|
1425
|
+
message: {
|
|
1426
|
+
"notification type": getNotificationName(this.notificationType),
|
|
1427
|
+
"supported events": this.supportedEvents
|
|
1428
|
+
.map((e) => `\n· ${getNotificationValueName(this.notificationType, e)}`)
|
|
1429
|
+
.join(""),
|
|
1430
|
+
},
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
return NotificationCCEventSupportedReport = _classThis;
|
|
1435
|
+
})();
|
|
1436
|
+
export { NotificationCCEventSupportedReport };
|
|
1437
|
+
let NotificationCCEventSupportedGet = (() => {
|
|
1438
|
+
let _classDecorators = [CCCommand(NotificationCommand.EventSupportedGet), expectedCCResponse(NotificationCCEventSupportedReport)];
|
|
1439
|
+
let _classDescriptor;
|
|
1440
|
+
let _classExtraInitializers = [];
|
|
1441
|
+
let _classThis;
|
|
1442
|
+
let _classSuper = NotificationCC;
|
|
1443
|
+
var NotificationCCEventSupportedGet = class extends _classSuper {
|
|
1444
|
+
static { _classThis = this; }
|
|
1445
|
+
static {
|
|
1446
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1447
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1448
|
+
NotificationCCEventSupportedGet = _classThis = _classDescriptor.value;
|
|
1449
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1450
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1451
|
+
}
|
|
1452
|
+
constructor(options) {
|
|
1453
|
+
super(options);
|
|
1454
|
+
this.notificationType = options.notificationType;
|
|
1455
|
+
}
|
|
1456
|
+
static from(raw, ctx) {
|
|
1457
|
+
validatePayload(raw.payload.length >= 1);
|
|
1458
|
+
const notificationType = raw.payload[0];
|
|
1459
|
+
return new this({
|
|
1460
|
+
nodeId: ctx.sourceNodeId,
|
|
1461
|
+
notificationType,
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
notificationType;
|
|
1465
|
+
serialize(ctx) {
|
|
1466
|
+
this.payload = Bytes.from([this.notificationType]);
|
|
1467
|
+
return super.serialize(ctx);
|
|
1468
|
+
}
|
|
1469
|
+
toLogEntry(ctx) {
|
|
1470
|
+
return {
|
|
1471
|
+
...super.toLogEntry(ctx),
|
|
1472
|
+
message: {
|
|
1473
|
+
"notification type": getNotificationName(this.notificationType),
|
|
1474
|
+
},
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
return NotificationCCEventSupportedGet = _classThis;
|
|
1479
|
+
})();
|
|
1480
|
+
export { NotificationCCEventSupportedGet };
|
|
1481
|
+
//# sourceMappingURL=NotificationCC.js.map
|