zwave-js 9.2.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Controller.d.ts +2 -2
- package/build/Controller.d.ts.map +1 -1
- package/build/Controller.js +1 -1
- package/build/Controller.js.map +1 -1
- package/build/Driver.d.ts +3 -4
- package/build/Driver.d.ts.map +1 -1
- package/build/Driver.js +6 -7
- package/build/Driver.js.map +1 -1
- package/build/Utils.d.ts +2 -0
- package/build/Utils.d.ts.map +1 -1
- package/build/Utils.js +5 -1
- package/build/Utils.js.map +1 -1
- package/build/lib/commandclass/AlarmSensorCC.d.ts +6 -5
- package/build/lib/commandclass/AlarmSensorCC.d.ts.map +1 -1
- package/build/lib/commandclass/AlarmSensorCC.js +23 -23
- package/build/lib/commandclass/AlarmSensorCC.js.map +1 -1
- package/build/lib/commandclass/AssociationCC.d.ts +12 -11
- package/build/lib/commandclass/AssociationCC.d.ts.map +1 -1
- package/build/lib/commandclass/AssociationCC.js +47 -41
- package/build/lib/commandclass/AssociationCC.js.map +1 -1
- package/build/lib/commandclass/AssociationGroupInfoCC.d.ts +15 -14
- package/build/lib/commandclass/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/lib/commandclass/AssociationGroupInfoCC.js +56 -51
- package/build/lib/commandclass/AssociationGroupInfoCC.js.map +1 -1
- package/build/lib/commandclass/BarrierOperatorCC.d.ts +9 -8
- package/build/lib/commandclass/BarrierOperatorCC.d.ts.map +1 -1
- package/build/lib/commandclass/BarrierOperatorCC.js +28 -28
- package/build/lib/commandclass/BarrierOperatorCC.js.map +1 -1
- package/build/lib/commandclass/BasicCC.d.ts +5 -4
- package/build/lib/commandclass/BasicCC.d.ts.map +1 -1
- package/build/lib/commandclass/BasicCC.js +18 -18
- package/build/lib/commandclass/BasicCC.js.map +1 -1
- package/build/lib/commandclass/BatteryCC.d.ts +5 -4
- package/build/lib/commandclass/BatteryCC.d.ts.map +1 -1
- package/build/lib/commandclass/BatteryCC.js +17 -17
- package/build/lib/commandclass/BatteryCC.js.map +1 -1
- package/build/lib/commandclass/BinarySensorCC.d.ts +6 -5
- package/build/lib/commandclass/BinarySensorCC.d.ts.map +1 -1
- package/build/lib/commandclass/BinarySensorCC.js +24 -24
- package/build/lib/commandclass/BinarySensorCC.js.map +1 -1
- package/build/lib/commandclass/BinarySwitchCC.d.ts +5 -4
- package/build/lib/commandclass/BinarySwitchCC.d.ts.map +1 -1
- package/build/lib/commandclass/BinarySwitchCC.js +15 -15
- package/build/lib/commandclass/BinarySwitchCC.js.map +1 -1
- package/build/lib/commandclass/CRC16CC.d.ts +3 -3
- package/build/lib/commandclass/CRC16CC.d.ts.map +1 -1
- package/build/lib/commandclass/CRC16CC.js +5 -5
- package/build/lib/commandclass/CRC16CC.js.map +1 -1
- package/build/lib/commandclass/CentralSceneCC.d.ts +6 -5
- package/build/lib/commandclass/CentralSceneCC.d.ts.map +1 -1
- package/build/lib/commandclass/CentralSceneCC.js +23 -25
- package/build/lib/commandclass/CentralSceneCC.js.map +1 -1
- package/build/lib/commandclass/ClimateControlScheduleCC.d.ts +7 -7
- package/build/lib/commandclass/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/lib/commandclass/ClimateControlScheduleCC.js +12 -12
- package/build/lib/commandclass/ClimateControlScheduleCC.js.map +1 -1
- package/build/lib/commandclass/ClockCC.d.ts +5 -4
- package/build/lib/commandclass/ClockCC.d.ts.map +1 -1
- package/build/lib/commandclass/ClockCC.js +15 -15
- package/build/lib/commandclass/ClockCC.js.map +1 -1
- package/build/lib/commandclass/ColorSwitchCC.d.ts +10 -9
- package/build/lib/commandclass/ColorSwitchCC.d.ts.map +1 -1
- package/build/lib/commandclass/ColorSwitchCC.js +29 -29
- package/build/lib/commandclass/ColorSwitchCC.js.map +1 -1
- package/build/lib/commandclass/CommandClass.d.ts +17 -10
- package/build/lib/commandclass/CommandClass.d.ts.map +1 -1
- package/build/lib/commandclass/CommandClass.js +53 -27
- package/build/lib/commandclass/CommandClass.js.map +1 -1
- package/build/lib/commandclass/ConfigurationCC.d.ts +16 -15
- package/build/lib/commandclass/ConfigurationCC.d.ts.map +1 -1
- package/build/lib/commandclass/ConfigurationCC.js +66 -59
- package/build/lib/commandclass/ConfigurationCC.js.map +1 -1
- package/build/lib/commandclass/DoorLockCC.d.ts +8 -7
- package/build/lib/commandclass/DoorLockCC.d.ts.map +1 -1
- package/build/lib/commandclass/DoorLockCC.js +27 -27
- package/build/lib/commandclass/DoorLockCC.js.map +1 -1
- package/build/lib/commandclass/DoorLockLoggingCC.d.ts +6 -5
- package/build/lib/commandclass/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/lib/commandclass/DoorLockLoggingCC.js +18 -18
- package/build/lib/commandclass/DoorLockLoggingCC.js.map +1 -1
- package/build/lib/commandclass/EntryControlCC.d.ts +8 -7
- package/build/lib/commandclass/EntryControlCC.d.ts.map +1 -1
- package/build/lib/commandclass/EntryControlCC.js +27 -27
- package/build/lib/commandclass/EntryControlCC.js.map +1 -1
- package/build/lib/commandclass/FirmwareUpdateMetaDataCC.d.ts +11 -11
- package/build/lib/commandclass/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/lib/commandclass/FirmwareUpdateMetaDataCC.js +20 -20
- package/build/lib/commandclass/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/lib/commandclass/HumidityControlModeCC.d.ts +6 -5
- package/build/lib/commandclass/HumidityControlModeCC.d.ts.map +1 -1
- package/build/lib/commandclass/HumidityControlModeCC.js +22 -22
- package/build/lib/commandclass/HumidityControlModeCC.js.map +1 -1
- package/build/lib/commandclass/HumidityControlOperatingStateCC.d.ts +4 -3
- package/build/lib/commandclass/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/lib/commandclass/HumidityControlOperatingStateCC.js +13 -13
- package/build/lib/commandclass/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/lib/commandclass/HumidityControlSetpointCC.d.ts +11 -10
- package/build/lib/commandclass/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/lib/commandclass/HumidityControlSetpointCC.js +46 -46
- package/build/lib/commandclass/HumidityControlSetpointCC.js.map +1 -1
- package/build/lib/commandclass/IndicatorCC.d.ts +9 -8
- package/build/lib/commandclass/IndicatorCC.d.ts.map +1 -1
- package/build/lib/commandclass/IndicatorCC.js +37 -37
- package/build/lib/commandclass/IndicatorCC.js.map +1 -1
- package/build/lib/commandclass/IrrigationCC.d.ts +18 -17
- package/build/lib/commandclass/IrrigationCC.d.ts.map +1 -1
- package/build/lib/commandclass/IrrigationCC.js +51 -51
- package/build/lib/commandclass/IrrigationCC.js.map +1 -1
- package/build/lib/commandclass/LanguageCC.d.ts +5 -4
- package/build/lib/commandclass/LanguageCC.d.ts.map +1 -1
- package/build/lib/commandclass/LanguageCC.js +15 -15
- package/build/lib/commandclass/LanguageCC.js.map +1 -1
- package/build/lib/commandclass/LockCC.d.ts +5 -4
- package/build/lib/commandclass/LockCC.d.ts.map +1 -1
- package/build/lib/commandclass/LockCC.js +15 -15
- package/build/lib/commandclass/LockCC.js.map +1 -1
- package/build/lib/commandclass/ManufacturerProprietaryCC.d.ts +11 -3
- package/build/lib/commandclass/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/lib/commandclass/ManufacturerProprietaryCC.js +44 -18
- package/build/lib/commandclass/ManufacturerProprietaryCC.js.map +1 -1
- package/build/lib/commandclass/ManufacturerSpecificCC.d.ts +5 -4
- package/build/lib/commandclass/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/lib/commandclass/ManufacturerSpecificCC.js +15 -15
- package/build/lib/commandclass/ManufacturerSpecificCC.js.map +1 -1
- package/build/lib/commandclass/MeterCC.d.ts +8 -7
- package/build/lib/commandclass/MeterCC.d.ts.map +1 -1
- package/build/lib/commandclass/MeterCC.js +49 -41
- package/build/lib/commandclass/MeterCC.js.map +1 -1
- package/build/lib/commandclass/MultiChannelAssociationCC.d.ts +12 -11
- package/build/lib/commandclass/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/lib/commandclass/MultiChannelAssociationCC.js +45 -43
- package/build/lib/commandclass/MultiChannelAssociationCC.js.map +1 -1
- package/build/lib/commandclass/MultiChannelCC.d.ts +15 -14
- package/build/lib/commandclass/MultiChannelCC.d.ts.map +1 -1
- package/build/lib/commandclass/MultiChannelCC.js +61 -61
- package/build/lib/commandclass/MultiChannelCC.js.map +1 -1
- package/build/lib/commandclass/MultiCommandCC.d.ts +3 -3
- package/build/lib/commandclass/MultiCommandCC.d.ts.map +1 -1
- package/build/lib/commandclass/MultiCommandCC.js +5 -5
- package/build/lib/commandclass/MultiCommandCC.js.map +1 -1
- package/build/lib/commandclass/MultilevelSensorCC.d.ts +8 -7
- package/build/lib/commandclass/MultilevelSensorCC.d.ts.map +1 -1
- package/build/lib/commandclass/MultilevelSensorCC.js +50 -50
- package/build/lib/commandclass/MultilevelSensorCC.js.map +1 -1
- package/build/lib/commandclass/MultilevelSwitchCC.d.ts +8 -7
- package/build/lib/commandclass/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/lib/commandclass/MultilevelSwitchCC.js +31 -31
- package/build/lib/commandclass/MultilevelSwitchCC.js.map +1 -1
- package/build/lib/commandclass/NoOperationCC.d.ts +1 -1
- package/build/lib/commandclass/NoOperationCC.d.ts.map +1 -1
- package/build/lib/commandclass/NoOperationCC.js +2 -2
- package/build/lib/commandclass/NoOperationCC.js.map +1 -1
- package/build/lib/commandclass/NodeNamingCC.d.ts +7 -6
- package/build/lib/commandclass/NodeNamingCC.d.ts.map +1 -1
- package/build/lib/commandclass/NodeNamingCC.js +21 -21
- package/build/lib/commandclass/NodeNamingCC.js.map +1 -1
- package/build/lib/commandclass/NotificationCC.d.ts +10 -9
- package/build/lib/commandclass/NotificationCC.d.ts.map +1 -1
- package/build/lib/commandclass/NotificationCC.js +54 -54
- package/build/lib/commandclass/NotificationCC.js.map +1 -1
- package/build/lib/commandclass/PowerlevelCC.d.ts +5 -5
- package/build/lib/commandclass/PowerlevelCC.d.ts.map +1 -1
- package/build/lib/commandclass/PowerlevelCC.js +9 -9
- package/build/lib/commandclass/PowerlevelCC.js.map +1 -1
- package/build/lib/commandclass/ProtectionCC.d.ts +10 -9
- package/build/lib/commandclass/ProtectionCC.d.ts.map +1 -1
- package/build/lib/commandclass/ProtectionCC.js +33 -33
- package/build/lib/commandclass/ProtectionCC.js.map +1 -1
- package/build/lib/commandclass/SceneActivationCC.d.ts +2 -2
- package/build/lib/commandclass/SceneActivationCC.d.ts.map +1 -1
- package/build/lib/commandclass/SceneActivationCC.js +2 -2
- package/build/lib/commandclass/SceneActivationCC.js.map +1 -1
- package/build/lib/commandclass/SceneActuatorConfigurationCC.d.ts +5 -4
- package/build/lib/commandclass/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/lib/commandclass/SceneActuatorConfigurationCC.js +9 -9
- package/build/lib/commandclass/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/lib/commandclass/SceneControllerConfigurationCC.d.ts +7 -6
- package/build/lib/commandclass/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/lib/commandclass/SceneControllerConfigurationCC.js +32 -28
- package/build/lib/commandclass/SceneControllerConfigurationCC.js.map +1 -1
- package/build/lib/commandclass/Security2CC.d.ts +17 -26
- package/build/lib/commandclass/Security2CC.d.ts.map +1 -1
- package/build/lib/commandclass/Security2CC.js +68 -68
- package/build/lib/commandclass/Security2CC.js.map +1 -1
- package/build/lib/commandclass/SecurityCC.d.ts +11 -14
- package/build/lib/commandclass/SecurityCC.d.ts.map +1 -1
- package/build/lib/commandclass/SecurityCC.js +41 -41
- package/build/lib/commandclass/SecurityCC.js.map +1 -1
- package/build/lib/commandclass/SoundSwitchCC.d.ts +9 -8
- package/build/lib/commandclass/SoundSwitchCC.d.ts.map +1 -1
- package/build/lib/commandclass/SoundSwitchCC.js +27 -27
- package/build/lib/commandclass/SoundSwitchCC.js.map +1 -1
- package/build/lib/commandclass/SupervisionCC.d.ts +4 -4
- package/build/lib/commandclass/SupervisionCC.d.ts.map +1 -1
- package/build/lib/commandclass/SupervisionCC.js +9 -9
- package/build/lib/commandclass/SupervisionCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatFanModeCC.d.ts +6 -5
- package/build/lib/commandclass/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatFanModeCC.js +22 -22
- package/build/lib/commandclass/ThermostatFanModeCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatFanStateCC.d.ts +4 -3
- package/build/lib/commandclass/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatFanStateCC.js +13 -13
- package/build/lib/commandclass/ThermostatFanStateCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatModeCC.d.ts +6 -5
- package/build/lib/commandclass/ThermostatModeCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatModeCC.js +22 -22
- package/build/lib/commandclass/ThermostatModeCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatOperatingStateCC.d.ts +4 -3
- package/build/lib/commandclass/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatOperatingStateCC.js +13 -13
- package/build/lib/commandclass/ThermostatOperatingStateCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatSetbackCC.d.ts +5 -4
- package/build/lib/commandclass/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatSetbackCC.js +15 -15
- package/build/lib/commandclass/ThermostatSetbackCC.js.map +1 -1
- package/build/lib/commandclass/ThermostatSetpointCC.d.ts +10 -9
- package/build/lib/commandclass/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/lib/commandclass/ThermostatSetpointCC.js +48 -48
- package/build/lib/commandclass/ThermostatSetpointCC.js.map +1 -1
- package/build/lib/commandclass/TimeCC.d.ts +6 -5
- package/build/lib/commandclass/TimeCC.d.ts.map +1 -1
- package/build/lib/commandclass/TimeCC.js +15 -15
- package/build/lib/commandclass/TimeCC.js.map +1 -1
- package/build/lib/commandclass/TimeParametersCC.d.ts +4 -3
- package/build/lib/commandclass/TimeParametersCC.d.ts.map +1 -1
- package/build/lib/commandclass/TimeParametersCC.js +11 -11
- package/build/lib/commandclass/TimeParametersCC.js.map +1 -1
- package/build/lib/commandclass/TransportServiceCC.d.ts +7 -7
- package/build/lib/commandclass/TransportServiceCC.d.ts.map +1 -1
- package/build/lib/commandclass/TransportServiceCC.js +12 -12
- package/build/lib/commandclass/TransportServiceCC.js.map +1 -1
- package/build/lib/commandclass/UserCodeCC.d.ts +17 -16
- package/build/lib/commandclass/UserCodeCC.d.ts.map +1 -1
- package/build/lib/commandclass/UserCodeCC.js +58 -58
- package/build/lib/commandclass/UserCodeCC.js.map +1 -1
- package/build/lib/commandclass/VersionCC.d.ts +7 -6
- package/build/lib/commandclass/VersionCC.d.ts.map +1 -1
- package/build/lib/commandclass/VersionCC.js +28 -28
- package/build/lib/commandclass/VersionCC.js.map +1 -1
- package/build/lib/commandclass/WakeUpCC.d.ts +5 -5
- package/build/lib/commandclass/WakeUpCC.d.ts.map +1 -1
- package/build/lib/commandclass/WakeUpCC.js +24 -28
- package/build/lib/commandclass/WakeUpCC.js.map +1 -1
- package/build/lib/commandclass/ZWavePlusCC.d.ts +20 -14
- package/build/lib/commandclass/ZWavePlusCC.d.ts.map +1 -1
- package/build/lib/commandclass/ZWavePlusCC.js +119 -41
- package/build/lib/commandclass/ZWavePlusCC.js.map +1 -1
- package/build/lib/commandclass/manufacturerProprietary/Fibaro.d.ts +8 -7
- package/build/lib/commandclass/manufacturerProprietary/Fibaro.d.ts.map +1 -1
- package/build/lib/commandclass/manufacturerProprietary/Fibaro.js +21 -21
- package/build/lib/commandclass/manufacturerProprietary/Fibaro.js.map +1 -1
- package/build/lib/controller/Controller.d.ts +21 -14
- package/build/lib/controller/Controller.d.ts.map +1 -1
- package/build/lib/controller/Controller.js +129 -140
- package/build/lib/controller/Controller.js.map +1 -1
- package/build/lib/controller/Inclusion.d.ts +1 -1
- package/build/lib/controller/Inclusion.d.ts.map +1 -1
- package/build/lib/controller/MockControllerBehaviors.d.ts +4 -0
- package/build/lib/controller/MockControllerBehaviors.d.ts.map +1 -0
- package/build/lib/controller/MockControllerBehaviors.js +161 -0
- package/build/lib/controller/MockControllerBehaviors.js.map +1 -0
- package/build/lib/controller/NodeInformationFrame.d.ts +9 -0
- package/build/lib/controller/NodeInformationFrame.d.ts.map +1 -0
- package/build/lib/controller/NodeInformationFrame.js +53 -0
- package/build/lib/controller/NodeInformationFrame.js.map +1 -0
- package/build/lib/controller/ZWaveChipTypes.d.ts +10 -0
- package/build/lib/controller/ZWaveChipTypes.d.ts.map +1 -0
- package/build/lib/controller/ZWaveChipTypes.js +32 -0
- package/build/lib/controller/ZWaveChipTypes.js.map +1 -0
- package/build/lib/controller/utils.d.ts +3 -0
- package/build/lib/controller/utils.d.ts.map +1 -0
- package/build/lib/controller/utils.js +40 -0
- package/build/lib/controller/utils.js.map +1 -0
- package/build/lib/driver/CommandQueueMachine.d.ts +1 -1
- package/build/lib/driver/CommandQueueMachine.d.ts.map +1 -1
- package/build/lib/driver/CommandQueueMachine.js.map +1 -1
- package/build/lib/driver/Driver.d.ts +7 -4
- package/build/lib/driver/Driver.d.ts.map +1 -1
- package/build/lib/driver/Driver.js +89 -67
- package/build/lib/driver/Driver.js.map +1 -1
- package/build/lib/driver/DriverMock.d.ts +13 -0
- package/build/lib/driver/DriverMock.d.ts.map +1 -0
- package/build/lib/driver/DriverMock.js +53 -0
- package/build/lib/driver/DriverMock.js.map +1 -0
- package/build/lib/driver/MessageGenerators.d.ts +1 -1
- package/build/lib/driver/MessageGenerators.d.ts.map +1 -1
- package/build/lib/driver/MessageGenerators.js.map +1 -1
- package/build/lib/driver/NetworkCache.d.ts +1 -1
- package/build/lib/driver/NetworkCache.d.ts.map +1 -1
- package/build/lib/driver/NetworkCache.js +80 -38
- package/build/lib/driver/NetworkCache.js.map +1 -1
- package/build/lib/driver/SendThreadMachine.d.ts +2 -2
- package/build/lib/driver/SendThreadMachine.d.ts.map +1 -1
- package/build/lib/driver/SendThreadMachine.js +4 -4
- package/build/lib/driver/SendThreadMachine.js.map +1 -1
- package/build/lib/driver/SerialAPICommandMachine.d.ts +1 -1
- package/build/lib/driver/SerialAPICommandMachine.d.ts.map +1 -1
- package/build/lib/driver/SerialAPICommandMachine.js +6 -7
- package/build/lib/driver/SerialAPICommandMachine.js.map +1 -1
- package/build/lib/driver/StateMachineShared.d.ts +1 -1
- package/build/lib/driver/StateMachineShared.d.ts.map +1 -1
- package/build/lib/driver/StateMachineShared.js.map +1 -1
- package/build/lib/driver/Transaction.d.ts +2 -2
- package/build/lib/driver/Transaction.d.ts.map +1 -1
- package/build/lib/driver/Transaction.js +5 -5
- package/build/lib/driver/Transaction.js.map +1 -1
- package/build/lib/driver/TransactionMachine.d.ts +1 -1
- package/build/lib/driver/TransactionMachine.d.ts.map +1 -1
- package/build/lib/driver/TransactionMachine.js.map +1 -1
- package/build/lib/driver/ZWaveOptions.d.ts +1 -1
- package/build/lib/driver/ZWaveOptions.d.ts.map +1 -1
- package/build/lib/log/Driver.d.ts +1 -1
- package/build/lib/log/Driver.d.ts.map +1 -1
- package/build/lib/log/Driver.js +4 -4
- package/build/lib/log/Driver.js.map +1 -1
- package/build/lib/node/Endpoint.d.ts +3 -2
- package/build/lib/node/Endpoint.d.ts.map +1 -1
- package/build/lib/node/Endpoint.js +32 -31
- package/build/lib/node/Endpoint.js.map +1 -1
- package/build/lib/node/Node.d.ts +4 -13
- package/build/lib/node/Node.d.ts.map +1 -1
- package/build/lib/node/Node.js +64 -150
- package/build/lib/node/Node.js.map +1 -1
- package/build/lib/node/_Types.d.ts +2 -30
- package/build/lib/node/_Types.d.ts.map +1 -1
- package/build/lib/node/_Types.js +3 -33
- package/build/lib/node/_Types.js.map +1 -1
- package/build/lib/node/utils.d.ts +28 -0
- package/build/lib/node/utils.d.ts.map +1 -0
- package/build/lib/node/utils.js +187 -0
- package/build/lib/node/utils.js.map +1 -0
- package/build/lib/serialapi/_Types.d.ts +1 -14
- package/build/lib/serialapi/_Types.d.ts.map +1 -1
- package/build/lib/serialapi/_Types.js +2 -15
- package/build/lib/serialapi/_Types.js.map +1 -1
- package/build/lib/serialapi/application/ApplicationCommandRequest.d.ts +4 -3
- package/build/lib/serialapi/application/ApplicationCommandRequest.d.ts.map +1 -1
- package/build/lib/serialapi/application/ApplicationCommandRequest.js +15 -14
- package/build/lib/serialapi/application/ApplicationCommandRequest.js.map +1 -1
- package/build/lib/serialapi/application/ApplicationUpdateRequest.d.ts +6 -6
- package/build/lib/serialapi/application/ApplicationUpdateRequest.d.ts.map +1 -1
- package/build/lib/serialapi/application/ApplicationUpdateRequest.js +10 -11
- package/build/lib/serialapi/application/ApplicationUpdateRequest.js.map +1 -1
- package/build/lib/serialapi/application/BridgeApplicationCommandRequest.d.ts +4 -3
- package/build/lib/serialapi/application/BridgeApplicationCommandRequest.d.ts.map +1 -1
- package/build/lib/serialapi/application/BridgeApplicationCommandRequest.js +14 -9
- package/build/lib/serialapi/application/BridgeApplicationCommandRequest.js.map +1 -1
- package/build/lib/serialapi/application/SerialAPIStartedRequest.d.ts +23 -11
- package/build/lib/serialapi/application/SerialAPIStartedRequest.d.ts.map +1 -1
- package/build/lib/serialapi/application/SerialAPIStartedRequest.js +59 -36
- package/build/lib/serialapi/application/SerialAPIStartedRequest.js.map +1 -1
- package/build/lib/serialapi/capability/GetControllerCapabilitiesMessages.d.ts +17 -11
- package/build/lib/serialapi/capability/GetControllerCapabilitiesMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/GetControllerCapabilitiesMessages.js +40 -34
- package/build/lib/serialapi/capability/GetControllerCapabilitiesMessages.js.map +1 -1
- package/build/lib/serialapi/capability/GetControllerVersionMessages.d.ts +11 -9
- package/build/lib/serialapi/capability/GetControllerVersionMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/GetControllerVersionMessages.js +24 -24
- package/build/lib/serialapi/capability/GetControllerVersionMessages.js.map +1 -1
- package/build/lib/serialapi/capability/GetProtocolVersionMessages.d.ts +3 -3
- package/build/lib/serialapi/capability/GetProtocolVersionMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/GetProtocolVersionMessages.js +9 -10
- package/build/lib/serialapi/capability/GetProtocolVersionMessages.js.map +1 -1
- package/build/lib/serialapi/capability/GetSerialApiCapabilitiesMessages.d.ts +17 -16
- package/build/lib/serialapi/capability/GetSerialApiCapabilitiesMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/GetSerialApiCapabilitiesMessages.js +39 -42
- package/build/lib/serialapi/capability/GetSerialApiCapabilitiesMessages.js.map +1 -1
- package/build/lib/serialapi/capability/GetSerialApiInitDataMessages.d.ts +26 -14
- package/build/lib/serialapi/capability/GetSerialApiInitDataMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/GetSerialApiInitDataMessages.js +138 -51
- package/build/lib/serialapi/capability/GetSerialApiInitDataMessages.js.map +1 -1
- package/build/lib/serialapi/capability/HardResetRequest.d.ts +12 -2
- package/build/lib/serialapi/capability/HardResetRequest.d.ts.map +1 -1
- package/build/lib/serialapi/capability/HardResetRequest.js +41 -11
- package/build/lib/serialapi/capability/HardResetRequest.js.map +1 -1
- package/build/lib/serialapi/capability/SerialAPISetupMessages.d.ts +22 -22
- package/build/lib/serialapi/capability/SerialAPISetupMessages.d.ts.map +1 -1
- package/build/lib/serialapi/capability/SerialAPISetupMessages.js +50 -51
- package/build/lib/serialapi/capability/SerialAPISetupMessages.js.map +1 -1
- package/build/lib/serialapi/capability/SetApplicationNodeInformationRequest.d.ts +22 -0
- package/build/lib/serialapi/capability/SetApplicationNodeInformationRequest.d.ts.map +1 -0
- package/build/lib/serialapi/capability/SetApplicationNodeInformationRequest.js +60 -0
- package/build/lib/serialapi/capability/SetApplicationNodeInformationRequest.js.map +1 -0
- package/build/lib/serialapi/memory/GetControllerIdMessages.d.ts +13 -9
- package/build/lib/serialapi/memory/GetControllerIdMessages.d.ts.map +1 -1
- package/build/lib/serialapi/memory/GetControllerIdMessages.js +31 -23
- package/build/lib/serialapi/memory/GetControllerIdMessages.js.map +1 -1
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts +3 -3
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts.map +1 -1
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js +9 -10
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js.map +1 -1
- package/build/lib/serialapi/misc/SetRFReceiveModeMessages.d.ts +5 -5
- package/build/lib/serialapi/misc/SetRFReceiveModeMessages.d.ts.map +1 -1
- package/build/lib/serialapi/misc/SetRFReceiveModeMessages.js +12 -13
- package/build/lib/serialapi/misc/SetRFReceiveModeMessages.js.map +1 -1
- package/build/lib/serialapi/misc/SetSerialApiTimeoutsMessages.d.ts +4 -4
- package/build/lib/serialapi/misc/SetSerialApiTimeoutsMessages.d.ts.map +1 -1
- package/build/lib/serialapi/misc/SetSerialApiTimeoutsMessages.js +11 -12
- package/build/lib/serialapi/misc/SetSerialApiTimeoutsMessages.js.map +1 -1
- package/build/lib/serialapi/misc/SoftResetRequest.d.ts +1 -1
- package/build/lib/serialapi/misc/SoftResetRequest.d.ts.map +1 -1
- package/build/lib/serialapi/misc/SoftResetRequest.js +4 -5
- package/build/lib/serialapi/misc/SoftResetRequest.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/AddNodeToNetworkRequest.d.ts +8 -8
- package/build/lib/serialapi/network-mgmt/AddNodeToNetworkRequest.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/AddNodeToNetworkRequest.js +17 -18
- package/build/lib/serialapi/network-mgmt/AddNodeToNetworkRequest.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/AssignReturnRouteMessages.d.ts +7 -8
- package/build/lib/serialapi/network-mgmt/AssignReturnRouteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/AssignReturnRouteMessages.js +19 -20
- package/build/lib/serialapi/network-mgmt/AssignReturnRouteMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/AssignSUCReturnRouteMessages.d.ts +7 -8
- package/build/lib/serialapi/network-mgmt/AssignSUCReturnRouteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/AssignSUCReturnRouteMessages.js +19 -20
- package/build/lib/serialapi/network-mgmt/AssignSUCReturnRouteMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/DeleteReturnRouteMessages.d.ts +7 -8
- package/build/lib/serialapi/network-mgmt/DeleteReturnRouteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/DeleteReturnRouteMessages.js +19 -20
- package/build/lib/serialapi/network-mgmt/DeleteReturnRouteMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/DeleteSUCReturnRouteMessages.d.ts +7 -8
- package/build/lib/serialapi/network-mgmt/DeleteSUCReturnRouteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/DeleteSUCReturnRouteMessages.js +19 -20
- package/build/lib/serialapi/network-mgmt/DeleteSUCReturnRouteMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetNodeProtocolInfoMessages.d.ts +20 -18
- package/build/lib/serialapi/network-mgmt/GetNodeProtocolInfoMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetNodeProtocolInfoMessages.js +72 -26
- package/build/lib/serialapi/network-mgmt/GetNodeProtocolInfoMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetRoutingInfoMessages.d.ts +4 -4
- package/build/lib/serialapi/network-mgmt/GetRoutingInfoMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetRoutingInfoMessages.js +11 -12
- package/build/lib/serialapi/network-mgmt/GetRoutingInfoMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetSUCNodeIdMessages.d.ts +9 -7
- package/build/lib/serialapi/network-mgmt/GetSUCNodeIdMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/GetSUCNodeIdMessages.js +18 -19
- package/build/lib/serialapi/network-mgmt/GetSUCNodeIdMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/IsFailedNodeMessages.d.ts +4 -4
- package/build/lib/serialapi/network-mgmt/IsFailedNodeMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/IsFailedNodeMessages.js +11 -12
- package/build/lib/serialapi/network-mgmt/IsFailedNodeMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/RemoveFailedNodeMessages.d.ts +7 -7
- package/build/lib/serialapi/network-mgmt/RemoveFailedNodeMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/RemoveFailedNodeMessages.js +18 -19
- package/build/lib/serialapi/network-mgmt/RemoveFailedNodeMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/RemoveNodeFromNetworkRequest.d.ts +6 -6
- package/build/lib/serialapi/network-mgmt/RemoveNodeFromNetworkRequest.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/RemoveNodeFromNetworkRequest.js +13 -14
- package/build/lib/serialapi/network-mgmt/RemoveNodeFromNetworkRequest.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/ReplaceFailedNodeRequest.d.ts +7 -7
- package/build/lib/serialapi/network-mgmt/ReplaceFailedNodeRequest.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/ReplaceFailedNodeRequest.js +17 -18
- package/build/lib/serialapi/network-mgmt/ReplaceFailedNodeRequest.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/RequestNodeInfoMessages.d.ts +5 -6
- package/build/lib/serialapi/network-mgmt/RequestNodeInfoMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/RequestNodeInfoMessages.js +12 -13
- package/build/lib/serialapi/network-mgmt/RequestNodeInfoMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/RequestNodeNeighborUpdateMessages.d.ts +6 -6
- package/build/lib/serialapi/network-mgmt/RequestNodeNeighborUpdateMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/RequestNodeNeighborUpdateMessages.js +14 -15
- package/build/lib/serialapi/network-mgmt/RequestNodeNeighborUpdateMessages.js.map +1 -1
- package/build/lib/serialapi/network-mgmt/SetSUCNodeIDMessages.d.ts +7 -7
- package/build/lib/serialapi/network-mgmt/SetSUCNodeIDMessages.d.ts.map +1 -1
- package/build/lib/serialapi/network-mgmt/SetSUCNodeIDMessages.js +21 -22
- package/build/lib/serialapi/network-mgmt/SetSUCNodeIDMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMReadLongBufferMessages.d.ts +4 -4
- package/build/lib/serialapi/nvm/ExtNVMReadLongBufferMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMReadLongBufferMessages.js +12 -13
- package/build/lib/serialapi/nvm/ExtNVMReadLongBufferMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMReadLongByteMessages.d.ts +4 -4
- package/build/lib/serialapi/nvm/ExtNVMReadLongByteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMReadLongByteMessages.js +12 -13
- package/build/lib/serialapi/nvm/ExtNVMReadLongByteMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMWriteLongBufferMessages.d.ts +4 -4
- package/build/lib/serialapi/nvm/ExtNVMWriteLongBufferMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMWriteLongBufferMessages.js +12 -13
- package/build/lib/serialapi/nvm/ExtNVMWriteLongBufferMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMWriteLongByteMessages.d.ts +4 -4
- package/build/lib/serialapi/nvm/ExtNVMWriteLongByteMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/ExtNVMWriteLongByteMessages.js +12 -13
- package/build/lib/serialapi/nvm/ExtNVMWriteLongByteMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/GetNVMIdMessages.d.ts +3 -3
- package/build/lib/serialapi/nvm/GetNVMIdMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/GetNVMIdMessages.js +9 -10
- package/build/lib/serialapi/nvm/GetNVMIdMessages.js.map +1 -1
- package/build/lib/serialapi/nvm/NVMOperationsMessages.d.ts +8 -8
- package/build/lib/serialapi/nvm/NVMOperationsMessages.d.ts.map +1 -1
- package/build/lib/serialapi/nvm/NVMOperationsMessages.js +19 -20
- package/build/lib/serialapi/nvm/NVMOperationsMessages.js.map +1 -1
- package/build/lib/serialapi/transport/SendDataBridgeMessages.d.ts +13 -11
- package/build/lib/serialapi/transport/SendDataBridgeMessages.d.ts.map +1 -1
- package/build/lib/serialapi/transport/SendDataBridgeMessages.js +48 -44
- package/build/lib/serialapi/transport/SendDataBridgeMessages.js.map +1 -1
- package/build/lib/serialapi/transport/SendDataMessages.d.ts +13 -11
- package/build/lib/serialapi/transport/SendDataMessages.d.ts.map +1 -1
- package/build/lib/serialapi/transport/SendDataMessages.js +49 -43
- package/build/lib/serialapi/transport/SendDataMessages.js.map +1 -1
- package/build/lib/telemetry/deviceConfig.d.ts.map +1 -1
- package/build/lib/telemetry/deviceConfig.js +2 -3
- package/build/lib/telemetry/deviceConfig.js.map +1 -1
- package/package.json +9 -8
- package/build/lib/driver/FileSystem.d.ts +0 -11
- package/build/lib/driver/FileSystem.d.ts.map +0 -1
- package/build/lib/driver/FileSystem.js +0 -3
- package/build/lib/driver/FileSystem.js.map +0 -1
- package/build/lib/log/Controller.d.ts +0 -68
- package/build/lib/log/Controller.d.ts.map +0 -1
- package/build/lib/log/Controller.js +0 -221
- package/build/lib/log/Controller.js.map +0 -1
- package/build/lib/message/Constants.d.ts +0 -150
- package/build/lib/message/Constants.d.ts.map +0 -1
- package/build/lib/message/Constants.js +0 -176
- package/build/lib/message/Constants.js.map +0 -1
- package/build/lib/message/Message.d.ts +0 -172
- package/build/lib/message/Message.d.ts.map +0 -1
- package/build/lib/message/Message.js +0 -465
- package/build/lib/message/Message.js.map +0 -1
- package/build/lib/message/SuccessIndicator.d.ts +0 -16
- package/build/lib/message/SuccessIndicator.d.ts.map +0 -1
- package/build/lib/message/SuccessIndicator.js +0 -12
- package/build/lib/message/SuccessIndicator.js.map +0 -1
- package/build/lib/node/INodeQuery.d.ts +0 -7
- package/build/lib/node/INodeQuery.d.ts.map +0 -1
- package/build/lib/node/INodeQuery.js +0 -9
- package/build/lib/node/INodeQuery.js.map +0 -1
|
@@ -59,12 +59,7 @@ const _Types_1 = require("../commandclass/_Types");
|
|
|
59
59
|
const Controller_1 = require("../controller/Controller");
|
|
60
60
|
const Inclusion_1 = require("../controller/Inclusion");
|
|
61
61
|
const _Types_2 = require("../controller/_Types");
|
|
62
|
-
const Controller_2 = require("../log/Controller");
|
|
63
62
|
const Driver_1 = require("../log/Driver");
|
|
64
|
-
const Constants_1 = require("../message/Constants");
|
|
65
|
-
const Message_1 = require("../message/Message");
|
|
66
|
-
const SuccessIndicator_1 = require("../message/SuccessIndicator");
|
|
67
|
-
const INodeQuery_1 = require("../node/INodeQuery");
|
|
68
63
|
const _Types_3 = require("../node/_Types");
|
|
69
64
|
const ApplicationCommandRequest_1 = require("../serialapi/application/ApplicationCommandRequest");
|
|
70
65
|
const ApplicationUpdateRequest_1 = require("../serialapi/application/ApplicationUpdateRequest");
|
|
@@ -232,10 +227,9 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
232
227
|
// Initialize logging
|
|
233
228
|
this._logContainer = new core_1.ZWaveLogContainer(this.options.logConfig);
|
|
234
229
|
this._driverLog = new Driver_1.DriverLogger(this._logContainer);
|
|
235
|
-
this._controllerLog = new
|
|
230
|
+
this._controllerLog = new core_1.ControllerLogger(this._logContainer);
|
|
236
231
|
// Initialize the cache
|
|
237
232
|
this.cacheDir = this.options.storage.cacheDir;
|
|
238
|
-
// TODO: Load provisioning list
|
|
239
233
|
// Initialize config manager
|
|
240
234
|
this.configManager = new config_1.ConfigManager({
|
|
241
235
|
logContainer: this._logContainer,
|
|
@@ -412,6 +406,27 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
412
406
|
get securityManager2() {
|
|
413
407
|
return this._securityManager2;
|
|
414
408
|
}
|
|
409
|
+
/** @internal This is needed for the ZWaveHost interface */
|
|
410
|
+
get homeId() {
|
|
411
|
+
return this.controller.homeId;
|
|
412
|
+
}
|
|
413
|
+
/** @internal This is needed for the ZWaveHost interface */
|
|
414
|
+
get ownNodeId() {
|
|
415
|
+
return this.controller.ownNodeId;
|
|
416
|
+
}
|
|
417
|
+
/** @internal This is needed for the ZWaveHost interface */
|
|
418
|
+
get nodes() {
|
|
419
|
+
return this.controller.nodes;
|
|
420
|
+
}
|
|
421
|
+
getNodeUnsafe(msg) {
|
|
422
|
+
const nodeId = msg.getNodeId();
|
|
423
|
+
if (nodeId != undefined)
|
|
424
|
+
return this.controller.nodes.get(nodeId);
|
|
425
|
+
}
|
|
426
|
+
getValueDB(nodeId) {
|
|
427
|
+
const node = this.controller.nodes.getOrThrow(nodeId);
|
|
428
|
+
return node.valueDB;
|
|
429
|
+
}
|
|
415
430
|
/** Updates the logging configuration without having to restart the driver. */
|
|
416
431
|
updateLogConfig(config) {
|
|
417
432
|
this._logContainer.updateConfiguration(config);
|
|
@@ -431,6 +446,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
431
446
|
}
|
|
432
447
|
/** Start the driver */
|
|
433
448
|
async start() {
|
|
449
|
+
var _a;
|
|
434
450
|
// avoid starting twice
|
|
435
451
|
if (this.wasDestroyed) {
|
|
436
452
|
throw new core_1.ZWaveError("The driver was destroyed. Create a new instance and start that one.", core_1.ZWaveErrorCodes.Driver_Destroyed);
|
|
@@ -438,8 +454,9 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
438
454
|
if (this._wasStarted)
|
|
439
455
|
return Promise.resolve();
|
|
440
456
|
this._wasStarted = true;
|
|
441
|
-
// Enforce that an error handler is attached
|
|
442
|
-
if (this.
|
|
457
|
+
// Enforce that an error handler is attached, except for testing with a mocked serialport
|
|
458
|
+
if (!this.options.testingHooks &&
|
|
459
|
+
this.listenerCount("error") === 0) {
|
|
443
460
|
throw new core_1.ZWaveError(`Before starting the driver, a handler for the "error" event must be attached.`, core_1.ZWaveErrorCodes.Driver_NoErrorHandler);
|
|
444
461
|
}
|
|
445
462
|
const spOpenPromise = (0, deferred_promise_1.createDeferredPromise)();
|
|
@@ -460,7 +477,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
460
477
|
}
|
|
461
478
|
else {
|
|
462
479
|
this.driverLog.print(`opening serial port ${this.port}`);
|
|
463
|
-
this.serial = new serial_1.ZWaveSerialPort(this.port, this._logContainer);
|
|
480
|
+
this.serial = new serial_1.ZWaveSerialPort(this.port, this._logContainer, (_a = this.options.testingHooks) === null || _a === void 0 ? void 0 : _a.serialPortBinding);
|
|
464
481
|
}
|
|
465
482
|
this.serial
|
|
466
483
|
.on("data", this.serialport_onData.bind(this))
|
|
@@ -487,6 +504,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
487
504
|
// Everything async (inluding opening the serial port) must happen in the setImmediate callback
|
|
488
505
|
// asynchronously open the serial port
|
|
489
506
|
setImmediate(async () => {
|
|
507
|
+
var _a;
|
|
490
508
|
try {
|
|
491
509
|
await this.openSerialport();
|
|
492
510
|
}
|
|
@@ -498,6 +516,10 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
498
516
|
this.driverLog.print("serial port opened");
|
|
499
517
|
this._isOpen = true;
|
|
500
518
|
spOpenPromise.resolve();
|
|
519
|
+
if (typeof ((_a = this.options.testingHooks) === null || _a === void 0 ? void 0 : _a.onSerialPortOpen) ===
|
|
520
|
+
"function") {
|
|
521
|
+
await this.options.testingHooks.onSerialPortOpen(this.serial);
|
|
522
|
+
}
|
|
501
523
|
// Perform initialization sequence
|
|
502
524
|
await this.writeHeader(serial_1.MessageHeaders.NAK);
|
|
503
525
|
// Per the specs, this should be followed by a soft-reset but we need to be able
|
|
@@ -827,7 +849,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
827
849
|
}
|
|
828
850
|
// Drop all pending messages that come from a previous interview attempt
|
|
829
851
|
this.rejectTransactions((t) => t.message.getNodeId() === node.id &&
|
|
830
|
-
(t.priority ===
|
|
852
|
+
(t.priority === serial_1.MessagePriority.NodeQuery ||
|
|
831
853
|
t.tag === "interview"), "The interview was restarted", core_1.ZWaveErrorCodes.Controller_InterviewRestarted);
|
|
832
854
|
const maxInterviewAttempts = this.options.attempts.nodeInterview;
|
|
833
855
|
try {
|
|
@@ -1339,7 +1361,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1339
1361
|
// Z-Wave 700 sticks are relatively fast, so we also wait for the Serial API started command
|
|
1340
1362
|
// to bail early
|
|
1341
1363
|
this.controllerLog.print("Waiting for the controller to reconnect...");
|
|
1342
|
-
let waitResult = await this.waitForMessage((msg) => msg.functionType ===
|
|
1364
|
+
let waitResult = await this.waitForMessage((msg) => msg.functionType === serial_1.FunctionType.SerialAPIStarted, 1500).catch(() => false);
|
|
1343
1365
|
if (waitResult) {
|
|
1344
1366
|
// Serial API did start, maybe do something with the information?
|
|
1345
1367
|
this.controllerLog.print("reconnected and restarted");
|
|
@@ -1357,7 +1379,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1357
1379
|
}
|
|
1358
1380
|
// Wait the configured amount of time for the Serial API started command to be received
|
|
1359
1381
|
this.controllerLog.print("Waiting for the Serial API to start...");
|
|
1360
|
-
waitResult = await this.waitForMessage((msg) => msg.functionType ===
|
|
1382
|
+
waitResult = await this.waitForMessage((msg) => msg.functionType === serial_1.FunctionType.SerialAPIStarted, this.options.timeouts.serialAPIStarted).catch(() => false);
|
|
1361
1383
|
if (waitResult) {
|
|
1362
1384
|
// Serial API did start, maybe do something with the information?
|
|
1363
1385
|
this.controllerLog.print("Serial API started");
|
|
@@ -1401,7 +1423,8 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1401
1423
|
*/
|
|
1402
1424
|
async hardReset() {
|
|
1403
1425
|
this.ensureReady(true);
|
|
1404
|
-
//
|
|
1426
|
+
// Update the controller NIF prior to hard resetting
|
|
1427
|
+
await this._controller.setControllerNIF();
|
|
1405
1428
|
await this._controller.hardReset();
|
|
1406
1429
|
// Clean up
|
|
1407
1430
|
this.rejectTransactions(() => true, `The controller was hard-reset`);
|
|
@@ -1526,14 +1549,14 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1526
1549
|
try {
|
|
1527
1550
|
// Parse the message while remembering potential decoding errors in embedded CCs
|
|
1528
1551
|
// This way we can log the invalid CC contents
|
|
1529
|
-
msg =
|
|
1552
|
+
msg = serial_1.Message.from(this, data);
|
|
1530
1553
|
// Then ensure there are no errors
|
|
1531
1554
|
if ((0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
1532
1555
|
(0, CommandClass_1.assertValidCCs)(msg);
|
|
1533
1556
|
}
|
|
1534
1557
|
if (!!this._controller) {
|
|
1535
1558
|
if ((0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
1536
|
-
(_c =
|
|
1559
|
+
(_c = this.getNodeUnsafe(msg)) === null || _c === void 0 ? void 0 : _c.incrementStatistics("commandsRX");
|
|
1537
1560
|
}
|
|
1538
1561
|
else {
|
|
1539
1562
|
this._controller.incrementStatistics("messagesRX");
|
|
@@ -1553,14 +1576,13 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1553
1576
|
await this.writeHeader(response);
|
|
1554
1577
|
if (!!this._controller) {
|
|
1555
1578
|
if ((0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
1556
|
-
(_d =
|
|
1579
|
+
(_d = this.getNodeUnsafe(msg)) === null || _d === void 0 ? void 0 : _d.incrementStatistics("commandsDroppedRX");
|
|
1557
1580
|
// Figure out if the command was received with supervision encapsulation
|
|
1558
1581
|
const supervisionSessionId = SupervisionCC_1.SupervisionCC.getSessionId(msg.command);
|
|
1559
1582
|
if (supervisionSessionId !== undefined &&
|
|
1560
1583
|
msg.command instanceof CommandClass_1.InvalidCC) {
|
|
1561
1584
|
// If it was, we need to notify the sender that we couldn't decode the command
|
|
1562
|
-
await ((_e = msg
|
|
1563
|
-
.getNodeUnsafe()) === null || _e === void 0 ? void 0 : _e.createAPI(core_1.CommandClasses.Supervision, false).sendReport({
|
|
1585
|
+
await ((_e = this.getNodeUnsafe(msg)) === null || _e === void 0 ? void 0 : _e.createAPI(core_1.CommandClasses.Supervision, false).sendReport({
|
|
1564
1586
|
sessionId: supervisionSessionId,
|
|
1565
1587
|
moreUpdatesFollow: false,
|
|
1566
1588
|
status: _Types_1.SupervisionStatus.NoSupport,
|
|
@@ -1598,7 +1620,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1598
1620
|
// and handle the encapsulation part normally
|
|
1599
1621
|
if (msg.command instanceof
|
|
1600
1622
|
SecurityCC_1.SecurityCCCommandEncapsulationNonceGet) {
|
|
1601
|
-
void ((_g =
|
|
1623
|
+
void ((_g = this.getNodeUnsafe(msg)) === null || _g === void 0 ? void 0 : _g.handleSecurityNonceGet());
|
|
1602
1624
|
}
|
|
1603
1625
|
// Transport Service commands must be handled before assembling partial CCs
|
|
1604
1626
|
if ((0, TransportServiceCC_1.isTransportServiceEncapsulation)(msg.command)) {
|
|
@@ -1808,7 +1830,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1808
1830
|
* Returns `true` if the transaction failure was handled, `false` if it needs to be rejected.
|
|
1809
1831
|
*/
|
|
1810
1832
|
handleMissingNodeACK(transaction) {
|
|
1811
|
-
const node = transaction.message
|
|
1833
|
+
const node = this.getNodeUnsafe(transaction.message);
|
|
1812
1834
|
if (!node)
|
|
1813
1835
|
return false; // This should never happen, but whatever
|
|
1814
1836
|
const messagePart1 = (0, SendDataShared_1.isSendData)(transaction.message)
|
|
@@ -1955,7 +1977,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1955
1977
|
});
|
|
1956
1978
|
await this.sendCommand(cc, {
|
|
1957
1979
|
maxSendAttempts: 1,
|
|
1958
|
-
priority:
|
|
1980
|
+
priority: serial_1.MessagePriority.Nonce,
|
|
1959
1981
|
});
|
|
1960
1982
|
},
|
|
1961
1983
|
sendSegmentsComplete: async () => {
|
|
@@ -1970,7 +1992,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
1970
1992
|
});
|
|
1971
1993
|
await this.sendCommand(cc, {
|
|
1972
1994
|
maxSendAttempts: 1,
|
|
1973
|
-
priority:
|
|
1995
|
+
priority: serial_1.MessagePriority.Nonce,
|
|
1974
1996
|
});
|
|
1975
1997
|
},
|
|
1976
1998
|
}, {
|
|
@@ -2012,7 +2034,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
2012
2034
|
});
|
|
2013
2035
|
await this.sendCommand(cc, {
|
|
2014
2036
|
maxSendAttempts: 1,
|
|
2015
|
-
priority:
|
|
2037
|
+
priority: serial_1.MessagePriority.Nonce,
|
|
2016
2038
|
});
|
|
2017
2039
|
}
|
|
2018
2040
|
}
|
|
@@ -2022,7 +2044,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
2022
2044
|
* @param msg The decoded message
|
|
2023
2045
|
*/
|
|
2024
2046
|
async handleUnsolicitedMessage(msg) {
|
|
2025
|
-
if (msg.type ===
|
|
2047
|
+
if (msg.type === serial_1.MessageType.Request) {
|
|
2026
2048
|
// This is a request we might have registered handlers for
|
|
2027
2049
|
try {
|
|
2028
2050
|
await this.handleRequest(msg);
|
|
@@ -2057,7 +2079,7 @@ class Driver extends shared_1.TypedEventEmitter {
|
|
|
2057
2079
|
: [];
|
|
2058
2080
|
const entry = { invoke: handler, oneTime };
|
|
2059
2081
|
handlers.push(entry);
|
|
2060
|
-
this.driverLog.print(`added${oneTime ? " one-time" : ""} request handler for ${
|
|
2082
|
+
this.driverLog.print(`added${oneTime ? " one-time" : ""} request handler for ${serial_1.FunctionType[fnType]} (${(0, shared_1.num2hex)(fnType)})...
|
|
2061
2083
|
${handlers.length} registered`);
|
|
2062
2084
|
this.requestHandlers.set(fnType, handlers);
|
|
2063
2085
|
}
|
|
@@ -2077,7 +2099,7 @@ ${handlers.length} registered`);
|
|
|
2077
2099
|
break;
|
|
2078
2100
|
}
|
|
2079
2101
|
}
|
|
2080
|
-
this.driverLog.print(`removed request handler for ${
|
|
2102
|
+
this.driverLog.print(`removed request handler for ${serial_1.FunctionType[fnType]} (${fnType})...
|
|
2081
2103
|
${handlers.length} left`);
|
|
2082
2104
|
this.requestHandlers.set(fnType, handlers);
|
|
2083
2105
|
}
|
|
@@ -2114,8 +2136,8 @@ ${handlers.length} left`);
|
|
|
2114
2136
|
*/
|
|
2115
2137
|
async handleRequest(msg) {
|
|
2116
2138
|
let handlers;
|
|
2117
|
-
if ((0,
|
|
2118
|
-
const node =
|
|
2139
|
+
if ((0, serial_1.isNodeQuery)(msg) || (0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
2140
|
+
const node = this.getNodeUnsafe(msg);
|
|
2119
2141
|
if (node) {
|
|
2120
2142
|
// We have received an unsolicited message from a dead node, bring it back to life
|
|
2121
2143
|
if (node.status === _Types_3.NodeStatus.Dead) {
|
|
@@ -2134,7 +2156,7 @@ ${handlers.length} left`);
|
|
|
2134
2156
|
if ((0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
2135
2157
|
// For further actions, we are only interested in the innermost CC
|
|
2136
2158
|
this.unwrapCommands(msg);
|
|
2137
|
-
const node =
|
|
2159
|
+
const node = this.getNodeUnsafe(msg);
|
|
2138
2160
|
// If we receive an encrypted message but assume the node is insecure, change our assumption
|
|
2139
2161
|
if ((node === null || node === void 0 ? void 0 : node.isSecure) === false &&
|
|
2140
2162
|
(msg.command.ccId === core_1.CommandClasses.Security ||
|
|
@@ -2255,7 +2277,7 @@ ${handlers.length} left`);
|
|
|
2255
2277
|
}
|
|
2256
2278
|
else if (msg instanceof ApplicationUpdateRequest_1.ApplicationUpdateRequest) {
|
|
2257
2279
|
if (msg instanceof ApplicationUpdateRequest_1.ApplicationUpdateRequestNodeInfoReceived) {
|
|
2258
|
-
const node =
|
|
2280
|
+
const node = this.getNodeUnsafe(msg);
|
|
2259
2281
|
if (node) {
|
|
2260
2282
|
this.controllerLog.logNode(node.id, {
|
|
2261
2283
|
message: "Received updated node info",
|
|
@@ -2305,7 +2327,7 @@ ${handlers.length} left`);
|
|
|
2305
2327
|
}
|
|
2306
2328
|
else {
|
|
2307
2329
|
// TODO: This deserves a nicer formatting
|
|
2308
|
-
this.driverLog.print(`handling request ${
|
|
2330
|
+
this.driverLog.print(`handling request ${serial_1.FunctionType[msg.functionType]} (${msg.functionType})`);
|
|
2309
2331
|
handlers = this.requestHandlers.get(msg.functionType);
|
|
2310
2332
|
}
|
|
2311
2333
|
if (handlers != undefined && handlers.length > 0) {
|
|
@@ -2369,7 +2391,7 @@ ${handlers.length} left`);
|
|
|
2369
2391
|
// 5.
|
|
2370
2392
|
// When a node supports S2 and has a valid security class, the command
|
|
2371
2393
|
// must be S2-encapsulated
|
|
2372
|
-
const node = msg.command.getNode();
|
|
2394
|
+
const node = msg.command.getNode(this);
|
|
2373
2395
|
if (node === null || node === void 0 ? void 0 : node.supportsCC(core_1.CommandClasses["Security 2"])) {
|
|
2374
2396
|
const securityClass = node.getHighestSecurityClass();
|
|
2375
2397
|
if (((securityClass != undefined &&
|
|
@@ -2402,9 +2424,9 @@ ${handlers.length} left`);
|
|
|
2402
2424
|
handleSerialAPICommandResult(msg, options, result) {
|
|
2403
2425
|
var _a, _b;
|
|
2404
2426
|
// Update statistics
|
|
2405
|
-
const node =
|
|
2427
|
+
const node = this.getNodeUnsafe(msg);
|
|
2406
2428
|
let success = true;
|
|
2407
|
-
if ((0, SendDataShared_1.isSendData)(msg) || (0,
|
|
2429
|
+
if ((0, SendDataShared_1.isSendData)(msg) || (0, serial_1.isNodeQuery)(msg)) {
|
|
2408
2430
|
// This shouldn't happen, but just in case
|
|
2409
2431
|
if (!node)
|
|
2410
2432
|
return;
|
|
@@ -2428,8 +2450,8 @@ ${handlers.length} left`);
|
|
|
2428
2450
|
if (success) {
|
|
2429
2451
|
if (node.canSleep) {
|
|
2430
2452
|
// Do not update the node status when we only responded to a nonce request
|
|
2431
|
-
if (options.priority !==
|
|
2432
|
-
options.priority !==
|
|
2453
|
+
if (options.priority !== serial_1.MessagePriority.Nonce &&
|
|
2454
|
+
options.priority !== serial_1.MessagePriority.Supervision) {
|
|
2433
2455
|
// If the node is not meant to be kept awake, try to send it back to sleep
|
|
2434
2456
|
if (!node.keepAwake) {
|
|
2435
2457
|
setImmediate(() => this.debounceSendNodeToSleep(node));
|
|
@@ -2458,8 +2480,8 @@ ${handlers.length} left`);
|
|
|
2458
2480
|
this.ensureReady();
|
|
2459
2481
|
let node;
|
|
2460
2482
|
// Don't send messages to dead nodes
|
|
2461
|
-
if ((0,
|
|
2462
|
-
node =
|
|
2483
|
+
if ((0, serial_1.isNodeQuery)(msg) || (0, ICommandClassContainer_1.isCommandClassContainer)(msg)) {
|
|
2484
|
+
node = this.getNodeUnsafe(msg);
|
|
2463
2485
|
if (!(0, NoOperationCC_1.messageIsPing)(msg) && (node === null || node === void 0 ? void 0 : node.status) === _Types_3.NodeStatus.Dead) {
|
|
2464
2486
|
// Instead of throwing immediately, try to ping the node first - if it responds, continue
|
|
2465
2487
|
if (!(await node.ping())) {
|
|
@@ -2468,10 +2490,10 @@ ${handlers.length} left`);
|
|
|
2468
2490
|
}
|
|
2469
2491
|
}
|
|
2470
2492
|
if (options.priority == undefined)
|
|
2471
|
-
options.priority = (0,
|
|
2493
|
+
options.priority = (0, serial_1.getDefaultPriority)(msg);
|
|
2472
2494
|
if (options.priority == undefined) {
|
|
2473
2495
|
const className = msg.constructor.name;
|
|
2474
|
-
const msgTypeName =
|
|
2496
|
+
const msgTypeName = serial_1.FunctionType[msg.functionType];
|
|
2475
2497
|
throw new core_1.ZWaveError(`No default priority has been defined for ${className} (${msgTypeName}), so you have to provide one for your message`, core_1.ZWaveErrorCodes.Driver_NoPriority);
|
|
2476
2498
|
}
|
|
2477
2499
|
if (options.supportCheck == undefined)
|
|
@@ -2479,7 +2501,7 @@ ${handlers.length} left`);
|
|
|
2479
2501
|
if (options.supportCheck &&
|
|
2480
2502
|
this._controller != undefined &&
|
|
2481
2503
|
!this._controller.isFunctionSupported(msg.functionType)) {
|
|
2482
|
-
throw new core_1.ZWaveError(`Your hardware does not support the ${
|
|
2504
|
+
throw new core_1.ZWaveError(`Your hardware does not support the ${serial_1.FunctionType[msg.functionType]} function`, core_1.ZWaveErrorCodes.Driver_NotSupported);
|
|
2483
2505
|
}
|
|
2484
2506
|
// When sending a message to a node that is known to be sleeping,
|
|
2485
2507
|
// the priority must be WakeUp, so the message gets deprioritized
|
|
@@ -2499,13 +2521,13 @@ ${handlers.length} left`);
|
|
|
2499
2521
|
!(msg instanceof SendDataMessages_1.SendDataMulticastRequest) &&
|
|
2500
2522
|
!(msg instanceof SendDataBridgeMessages_1.SendDataMulticastBridgeRequest) &&
|
|
2501
2523
|
// Nonces and responses to Supervision Get have to be sent immediately
|
|
2502
|
-
options.priority !==
|
|
2503
|
-
options.priority !==
|
|
2504
|
-
if (options.priority ===
|
|
2524
|
+
options.priority !== serial_1.MessagePriority.Nonce &&
|
|
2525
|
+
options.priority !== serial_1.MessagePriority.Supervision) {
|
|
2526
|
+
if (options.priority === serial_1.MessagePriority.NodeQuery) {
|
|
2505
2527
|
// Remember that this transaction was part of an interview
|
|
2506
2528
|
options.tag = "interview";
|
|
2507
2529
|
}
|
|
2508
|
-
options.priority =
|
|
2530
|
+
options.priority = serial_1.MessagePriority.WakeUp;
|
|
2509
2531
|
}
|
|
2510
2532
|
// Create the transaction
|
|
2511
2533
|
const { generator, resultPromise } = (0, MessageGenerators_1.createMessageGenerator)(this, msg, (msg, _result) => {
|
|
@@ -2554,24 +2576,24 @@ ${handlers.length} left`);
|
|
|
2554
2576
|
if ((0, SendDataShared_1.isSendData)(msg)) {
|
|
2555
2577
|
// For SendData messages, make sure the message is not a nonce
|
|
2556
2578
|
maybeSendToSleep =
|
|
2557
|
-
options.priority !==
|
|
2558
|
-
options.priority !==
|
|
2579
|
+
options.priority !== serial_1.MessagePriority.Nonce &&
|
|
2580
|
+
options.priority !== serial_1.MessagePriority.Supervision &&
|
|
2559
2581
|
// And that the result is either a response from the node
|
|
2560
2582
|
// or a transmit report indicating success
|
|
2561
2583
|
result &&
|
|
2562
2584
|
(result.functionType ===
|
|
2563
|
-
|
|
2585
|
+
serial_1.FunctionType.BridgeApplicationCommand ||
|
|
2564
2586
|
result.functionType ===
|
|
2565
|
-
|
|
2587
|
+
serial_1.FunctionType.ApplicationCommand ||
|
|
2566
2588
|
((0, SendDataShared_1.isSendDataTransmitReport)(result) && result.isOK()));
|
|
2567
2589
|
}
|
|
2568
2590
|
else {
|
|
2569
2591
|
// For other messages to the node, just check for successful completion. If the callback is not OK,
|
|
2570
2592
|
// we might not be able to communicate with the node. Sending another message is not a good idea.
|
|
2571
2593
|
maybeSendToSleep =
|
|
2572
|
-
(0,
|
|
2594
|
+
(0, serial_1.isNodeQuery)(msg) &&
|
|
2573
2595
|
result &&
|
|
2574
|
-
(0,
|
|
2596
|
+
(0, serial_1.isSuccessIndicator)(result) &&
|
|
2575
2597
|
result.isOK();
|
|
2576
2598
|
}
|
|
2577
2599
|
if (maybeSendToSleep && node && node.canSleep && !node.keepAwake) {
|
|
@@ -2585,13 +2607,13 @@ ${handlers.length} left`);
|
|
|
2585
2607
|
// If a controller command failed (that is not SendData), pass the response/callback through
|
|
2586
2608
|
(e.code === core_1.ZWaveErrorCodes.Controller_ResponseNOK ||
|
|
2587
2609
|
e.code === core_1.ZWaveErrorCodes.Controller_CallbackNOK) &&
|
|
2588
|
-
e.context instanceof
|
|
2610
|
+
e.context instanceof serial_1.Message &&
|
|
2589
2611
|
// We need to check the function type here because context can be the transmit reports
|
|
2590
|
-
e.context.functionType !==
|
|
2591
|
-
e.context.functionType !==
|
|
2592
|
-
e.context.functionType !==
|
|
2612
|
+
e.context.functionType !== serial_1.FunctionType.SendData &&
|
|
2613
|
+
e.context.functionType !== serial_1.FunctionType.SendDataMulticast &&
|
|
2614
|
+
e.context.functionType !== serial_1.FunctionType.SendDataBridge &&
|
|
2593
2615
|
e.context.functionType !==
|
|
2594
|
-
|
|
2616
|
+
serial_1.FunctionType.SendDataMulticastBridge) {
|
|
2595
2617
|
(_a = this._controller) === null || _a === void 0 ? void 0 : _a.incrementStatistics("messagesDroppedTX");
|
|
2596
2618
|
return e.context;
|
|
2597
2619
|
}
|
|
@@ -2616,7 +2638,7 @@ ${handlers.length} left`);
|
|
|
2616
2638
|
createSendDataMessage(command, options = {}) {
|
|
2617
2639
|
let msg;
|
|
2618
2640
|
if (command.isSinglecast()) {
|
|
2619
|
-
if (this.controller.isFunctionSupported(
|
|
2641
|
+
if (this.controller.isFunctionSupported(serial_1.FunctionType.SendDataBridge)) {
|
|
2620
2642
|
// Prioritize Bridge commands when they are supported
|
|
2621
2643
|
msg = new SendDataBridgeMessages_1.SendDataBridgeRequest(this, { command });
|
|
2622
2644
|
}
|
|
@@ -2625,7 +2647,7 @@ ${handlers.length} left`);
|
|
|
2625
2647
|
}
|
|
2626
2648
|
}
|
|
2627
2649
|
else if (command.isMulticast()) {
|
|
2628
|
-
if (this.controller.isFunctionSupported(
|
|
2650
|
+
if (this.controller.isFunctionSupported(serial_1.FunctionType.SendDataMulticastBridge)) {
|
|
2629
2651
|
// Prioritize Bridge commands when they are supported
|
|
2630
2652
|
msg = new SendDataBridgeMessages_1.SendDataMulticastBridgeRequest(this, { command });
|
|
2631
2653
|
}
|
|
@@ -2697,7 +2719,7 @@ ${handlers.length} left`);
|
|
|
2697
2719
|
throw new core_1.ZWaveError(`Sending a supervised command is only supported with singlecast!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
2698
2720
|
}
|
|
2699
2721
|
// Check if the target supports this command
|
|
2700
|
-
if (!((_a = command.getNode()) === null || _a === void 0 ? void 0 : _a.supportsCC(core_1.CommandClasses.Supervision))) {
|
|
2722
|
+
if (!((_a = command.getNode(this)) === null || _a === void 0 ? void 0 : _a.supportsCC(core_1.CommandClasses.Supervision))) {
|
|
2701
2723
|
throw new core_1.ZWaveError(`Node ${nodeId} does not support the Supervision CC!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
2702
2724
|
}
|
|
2703
2725
|
// Create the encapsulating CC so we have a session ID
|
|
@@ -2724,7 +2746,7 @@ ${handlers.length} left`);
|
|
|
2724
2746
|
*/
|
|
2725
2747
|
async trySendCommandSupervised(command, options) {
|
|
2726
2748
|
var _a;
|
|
2727
|
-
if ((_a = command.getNode()) === null || _a === void 0 ? void 0 : _a.supportsCC(core_1.CommandClasses.Supervision)) {
|
|
2749
|
+
if ((_a = command.getNode(this)) === null || _a === void 0 ? void 0 : _a.supportsCC(core_1.CommandClasses.Supervision)) {
|
|
2728
2750
|
return this.sendSupervisedCommand(command, options);
|
|
2729
2751
|
}
|
|
2730
2752
|
else {
|
|
@@ -2816,8 +2838,8 @@ ${handlers.length} left`);
|
|
|
2816
2838
|
switch (true) {
|
|
2817
2839
|
// Pings, nonces and Supervision Reports will block the send queue until wakeup, so they must be dropped
|
|
2818
2840
|
case (0, NoOperationCC_1.messageIsPing)(msg):
|
|
2819
|
-
case transaction.priority ===
|
|
2820
|
-
case transaction.priority ===
|
|
2841
|
+
case transaction.priority === serial_1.MessagePriority.Nonce:
|
|
2842
|
+
case transaction.priority === serial_1.MessagePriority.Supervision:
|
|
2821
2843
|
// We also don't want to immediately send the node to sleep when it wakes up
|
|
2822
2844
|
case (0, ICommandClassContainer_1.isCommandClassContainer)(msg) &&
|
|
2823
2845
|
msg.command instanceof WakeUpCC_1.WakeUpCCNoMoreInformation:
|
|
@@ -2836,7 +2858,7 @@ ${handlers.length} left`);
|
|
|
2836
2858
|
};
|
|
2837
2859
|
const requeue = {
|
|
2838
2860
|
type: "requeue",
|
|
2839
|
-
priority:
|
|
2861
|
+
priority: serial_1.MessagePriority.WakeUp,
|
|
2840
2862
|
};
|
|
2841
2863
|
const requeueAndTagAsInterview = {
|
|
2842
2864
|
...requeue,
|
|
@@ -2849,7 +2871,7 @@ ${handlers.length} left`);
|
|
|
2849
2871
|
// Drop all messages that are not allowed in the wakeup queue
|
|
2850
2872
|
// For all other messages, change the priority to wakeup
|
|
2851
2873
|
return this.mayMoveToWakeupQueue(transaction)
|
|
2852
|
-
? transaction.priority ===
|
|
2874
|
+
? transaction.priority === serial_1.MessagePriority.NodeQuery
|
|
2853
2875
|
? requeueAndTagAsInterview
|
|
2854
2876
|
: requeue
|
|
2855
2877
|
: reject;
|
|
@@ -3012,14 +3034,14 @@ ${handlers.length} left`);
|
|
|
3012
3034
|
/** Returns the preferred constructor to use for singlecast SendData commands */
|
|
3013
3035
|
getSendDataSinglecastConstructor() {
|
|
3014
3036
|
var _a;
|
|
3015
|
-
return ((_a = this._controller) === null || _a === void 0 ? void 0 : _a.isFunctionSupported(
|
|
3037
|
+
return ((_a = this._controller) === null || _a === void 0 ? void 0 : _a.isFunctionSupported(serial_1.FunctionType.SendDataBridge))
|
|
3016
3038
|
? SendDataBridgeMessages_1.SendDataBridgeRequest
|
|
3017
3039
|
: SendDataMessages_1.SendDataRequest;
|
|
3018
3040
|
}
|
|
3019
3041
|
/** Returns the preferred constructor to use for multicast SendData commands */
|
|
3020
3042
|
getSendDataMulticastConstructor() {
|
|
3021
3043
|
var _a;
|
|
3022
|
-
return ((_a = this._controller) === null || _a === void 0 ? void 0 : _a.isFunctionSupported(
|
|
3044
|
+
return ((_a = this._controller) === null || _a === void 0 ? void 0 : _a.isFunctionSupported(serial_1.FunctionType.SendDataMulticastBridge))
|
|
3023
3045
|
? SendDataBridgeMessages_1.SendDataMulticastBridgeRequest
|
|
3024
3046
|
: SendDataMessages_1.SendDataMulticastRequest;
|
|
3025
3047
|
}
|