@zwave-js/cc 15.1.0 → 15.1.2
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 +7 -7
- package/build/cjs/cc/AlarmSensorCC.js +22 -23
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.d.ts +8 -9
- package/build/cjs/cc/AssociationCC.js +29 -29
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/cjs/cc/AssociationGroupInfoCC.js +31 -32
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/cjs/cc/BarrierOperatorCC.js +35 -36
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.d.ts +4 -4
- package/build/cjs/cc/BasicCC.js +23 -24
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.d.ts +6 -8
- package/build/cjs/cc/BatteryCC.js +24 -28
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.d.ts +5 -5
- package/build/cjs/cc/BinarySensorCC.js +20 -21
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC._validateArgs.js +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +6 -6
- package/build/cjs/cc/BinarySwitchCC.js +26 -26
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.d.ts +3 -3
- package/build/cjs/cc/CRC16CC.js +15 -15
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.d.ts +8 -8
- package/build/cjs/cc/CentralSceneCC.js +23 -24
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/cjs/cc/ClimateControlScheduleCC.js +19 -20
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.d.ts +3 -4
- package/build/cjs/cc/ClockCC.js +13 -14
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.d.ts +3 -4
- package/build/cjs/cc/ColorSwitchCC.js +22 -24
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.d.ts +3 -3
- package/build/cjs/cc/ConfigurationCC.js +114 -115
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.js +5 -5
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cjs/cc/DoorLockCC.d.ts +29 -29
- package/build/cjs/cc/DoorLockCC.js +39 -40
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/cjs/cc/DoorLockLoggingCC.js +13 -14
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.d.ts +2 -3
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +8 -8
- package/build/cjs/cc/EntryControlCC.js +41 -42
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +52 -53
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +2 -2
- package/build/cjs/cc/HailCC.js.map +1 -1
- package/build/cjs/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/cjs/cc/HumidityControlModeCC.js +20 -21
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +9 -9
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/cjs/cc/HumidityControlSetpointCC.js +43 -44
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.d.ts +2 -3
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +3 -3
- package/build/cjs/cc/IndicatorCC.js +50 -52
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.d.ts +3 -3
- package/build/cjs/cc/IrrigationCC.js +74 -75
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.d.ts +5 -6
- package/build/cjs/cc/LanguageCC.js +14 -15
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.d.ts +4 -4
- package/build/cjs/cc/LockCC.js +10 -10
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +14 -12
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/cjs/cc/ManufacturerSpecificCC.js +20 -21
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.d.ts +4 -6
- package/build/cjs/cc/MeterCC.js +52 -54
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/cjs/cc/MultiChannelAssociationCC.js +34 -35
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.d.ts +13 -12
- package/build/cjs/cc/MultiChannelCC.js +104 -56
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.d.ts +3 -3
- package/build/cjs/cc/MultiCommandCC.js +13 -13
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/cjs/cc/MultilevelSensorCC.js +26 -28
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/cjs/cc/MultilevelSwitchCC.js +36 -37
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +4 -4
- package/build/cjs/cc/NoOperationCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC.d.ts +5 -5
- package/build/cjs/cc/NodeNamingCC.js +20 -20
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.d.ts +4 -5
- package/build/cjs/cc/NotificationCC.js +66 -68
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.d.ts +3 -3
- package/build/cjs/cc/PowerlevelCC.js +25 -26
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC._validateArgs.js +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +11 -11
- package/build/cjs/cc/ProtectionCC.js +35 -36
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +5 -6
- package/build/cjs/cc/SceneActivationCC.js +10 -10
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +19 -20
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -26
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +3 -4
- package/build/cjs/cc/Security2CC.js +60 -62
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +3 -4
- package/build/cjs/cc/SecurityCC.js +25 -26
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.d.ts +7 -7
- package/build/cjs/cc/SoundSwitchCC.js +28 -29
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.d.ts +4 -4
- package/build/cjs/cc/SupervisionCC.js +28 -29
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatFanModeCC.js +21 -22
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +9 -9
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js +30 -31
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/cjs/cc/ThermostatOperatingStateCC.js +9 -9
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +14 -15
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatSetpointCC.js +48 -49
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.d.ts +3 -4
- package/build/cjs/cc/TimeCC.js +9 -10
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.d.ts +3 -4
- package/build/cjs/cc/TimeParametersCC.js +2 -2
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +3 -3
- package/build/cjs/cc/TransportServiceCC.js +44 -45
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.d.ts +19 -19
- package/build/cjs/cc/UserCodeCC.js +102 -103
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.d.ts +17 -17
- package/build/cjs/cc/VersionCC.js +46 -47
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.d.ts +6 -6
- package/build/cjs/cc/WakeUpCC.js +16 -17
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -4
- package/build/cjs/cc/WindowCoveringCC.js +17 -18
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWavePlusCC.d.ts +8 -8
- package/build/cjs/cc/ZWavePlusCC.js +15 -16
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.js +35 -35
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +2 -0
- package/build/cjs/cc/_CCValues.generated.js +28 -27
- package/build/cjs/cc/_CCValues.generated.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +14 -14
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/cjs/lib/API.d.ts +3 -3
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +5 -6
- package/build/cjs/lib/CommandClass.js +45 -45
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +2 -2
- package/build/cjs/lib/CommandClassDecorators.js +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +2 -2
- package/build/cjs/lib/Security2/Extension.js +17 -17
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/cjs/lib/SetValueResult.d.ts +1 -1
- package/build/cjs/lib/SetValueResult.js.map +1 -1
- package/build/cjs/lib/Values.d.ts +3 -3
- package/build/cjs/lib/Values.js +6 -6
- package/build/cjs/lib/Values.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +2 -2
- package/build/cjs/lib/_Types.js +3 -3
- package/build/cjs/lib/_Types.js.map +1 -1
- package/build/cjs/lib/serializers.d.ts +1 -1
- package/build/cjs/lib/serializers.js +5 -5
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +2 -2
- package/build/cjs/lib/utils.d.ts +2 -2
- package/build/cjs/lib/utils.js +60 -60
- package/build/cjs/lib/utils.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts +7 -7
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -3
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +8 -9
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -2
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -3
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +4 -4
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -3
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +6 -8
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +13 -15
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +5 -5
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -3
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +6 -6
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +3 -3
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +2 -2
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +8 -8
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -3
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -3
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -4
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +2 -3
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +3 -4
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -4
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +3 -3
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -3
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +29 -29
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +2 -3
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -3
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +2 -3
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +8 -8
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -3
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -3
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +1 -1
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -3
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -3
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +2 -3
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +3 -3
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -4
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +3 -3
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +2 -3
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +5 -6
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -3
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +4 -4
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -2
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -3
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +5 -3
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -3
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +4 -6
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +2 -4
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -3
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +13 -12
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +65 -16
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +3 -3
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +2 -2
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -4
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +2 -3
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +1 -1
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +5 -5
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -2
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +4 -5
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +2 -4
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +3 -3
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +2 -3
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +11 -11
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +5 -6
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -2
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -3
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +3 -4
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +2 -4
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +3 -4
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +1 -2
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +7 -7
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -3
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +4 -4
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +2 -3
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -3
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -2
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -2
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +2 -3
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -3
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +3 -4
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +1 -2
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +3 -4
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -1
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +3 -3
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -3
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +19 -19
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -3
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +17 -17
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -3
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +6 -6
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -3
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -4
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +1 -2
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +8 -8
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -3
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +2 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js +5 -4
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +3 -3
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +5 -6
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +2 -2
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +2 -2
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +2 -2
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +2 -2
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/SetValueResult.d.ts +1 -1
- package/build/esm/lib/SetValueResult.d.ts.map +1 -1
- package/build/esm/lib/Values.d.ts +3 -3
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +2 -2
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +1 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +1 -1
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +2 -2
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.d.ts +2 -2
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js +2 -2
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/NodeNamingCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport {\n\tBytes,\n\tstringToUint8ArrayUTF16BE,\n\tuint8ArrayToStringUTF16BE,\n} from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NodeNamingAndLocationCommand } from \"../lib/_Types.js\";\n\nexport const NodeNamingAndLocationCCValues = V.defineCCValues(\n\tCommandClasses[\"Node Naming and Location\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"name\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node name\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"location\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node location\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t},\n);\n\nfunction isASCII(str: string): boolean {\n\treturn /^[\\x00-\\x7F]*$/.test(str);\n}\n\n@API(CommandClasses[\"Node Naming and Location\"])\nexport class NodeNamingAndLocationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: NodeNamingAndLocationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NodeNamingAndLocationCommand.NameGet:\n\t\t\tcase NodeNamingAndLocationCommand.NameSet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationGet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationSet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NodeNamingAndLocationCCAPI,\n\t\t\t{ property },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"name\" && property !== \"location\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"string\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"string\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.setName(value);\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.setLocation(value);\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected override get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: NodeNamingAndLocationCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.getName();\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.getLocation();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getName(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.name;\n\t}\n\n\t@validateArgs()\n\tpublic async setName(name: string): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tname,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLocation(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCLocationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.location;\n\t}\n\n\t@validateArgs()\n\tpublic async setLocation(\n\t\tlocation: string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocation,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Node Naming and Location\"])\n@implementedVersion(1)\n@ccValues(NodeNamingAndLocationCCValues)\nexport class NodeNamingAndLocationCC extends CommandClass {\n\tdeclare ccCommand: NodeNamingAndLocationCommand;\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// As the name says, this is for the node, not for endpoints\n\t\treturn true;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Node Naming and Location\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node name...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst name = await api.getName();\n\t\tif (name != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `is named \"${name}\"`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node location...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst location = await api.getLocation();\n\t\tif (location != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `received location: ${location}`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameSetOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCNameSet extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCNameSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic name: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.name) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.name.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet nameBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tnameBuffer = stringToUint8ArrayUTF16BE(this.name);\n\t\t} else {\n\t\t\tnameBuffer = Bytes.from(this.name, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tnameBuffer.subarray(0, Math.min(16, nameBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameReportOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameReport)\n@ccValueProperty(\"name\", NodeNamingAndLocationCCValues.name)\nexport class NodeNamingAndLocationCCNameReport extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst nameBuffer = raw.payload.subarray(1);\n\t\tlet name: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(nameBuffer.length % 2 === 0);\n\t\t\tname = uint8ArrayToStringUTF16BE(nameBuffer);\n\t\t} else {\n\t\t\tname = nameBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly name: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameGet)\n@expectedCCResponse(NodeNamingAndLocationCCNameReport)\nexport class NodeNamingAndLocationCCNameGet extends NodeNamingAndLocationCC {}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationSetOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCLocationSet\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCLocationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic location: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.location) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.location.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet locationBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tlocationBuffer = stringToUint8ArrayUTF16BE(this.location);\n\t\t} else {\n\t\t\tlocationBuffer = Bytes.from(this.location, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tlocationBuffer.subarray(0, Math.min(16, locationBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationReportOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationReport)\n@ccValueProperty(\"location\", NodeNamingAndLocationCCValues.location)\nexport class NodeNamingAndLocationCCLocationReport\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst locationBuffer = raw.payload.subarray(1);\n\t\tlet location: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(locationBuffer.length % 2 === 0);\n\t\t\tlocation = uint8ArrayToStringUTF16BE(locationBuffer);\n\t\t} else {\n\t\t\tlocation = locationBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocation,\n\t\t});\n\t}\n\n\tpublic readonly location: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationGet)\n@expectedCCResponse(NodeNamingAndLocationCCLocationReport)\nexport class NodeNamingAndLocationCCLocationGet\n\textends NodeNamingAndLocationCC\n{}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\tstringToUint8ArrayUTF16BE,\n\tuint8ArrayToStringUTF16BE,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NodeNamingAndLocationCommand } from \"../lib/_Types.js\";\n\nexport const NodeNamingAndLocationCCValues = V.defineCCValues(\n\tCommandClasses[\"Node Naming and Location\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"name\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node name\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"location\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.String,\n\t\t\t\tlabel: \"Node location\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t},\n);\n\nfunction isASCII(str: string): boolean {\n\treturn /^[\\x00-\\x7F]*$/.test(str);\n}\n\n@API(CommandClasses[\"Node Naming and Location\"])\nexport class NodeNamingAndLocationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: NodeNamingAndLocationCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NodeNamingAndLocationCommand.NameGet:\n\t\t\tcase NodeNamingAndLocationCommand.NameSet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationGet:\n\t\t\tcase NodeNamingAndLocationCommand.LocationSet:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NodeNamingAndLocationCCAPI,\n\t\t\t{ property },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"name\" && property !== \"location\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"string\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"string\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.setName(value);\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.setLocation(value);\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected override get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: NodeNamingAndLocationCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"name\":\n\t\t\t\t\treturn this.getName();\n\t\t\t\tcase \"location\":\n\t\t\t\t\treturn this.getLocation();\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getName(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.name;\n\t}\n\n\t@validateArgs()\n\tpublic async setName(name: string): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.NameSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCNameSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tname,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getLocation(): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationGet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNodeNamingAndLocationCCLocationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.location;\n\t}\n\n\t@validateArgs()\n\tpublic async setLocation(\n\t\tlocation: string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNodeNamingAndLocationCommand,\n\t\t\tNodeNamingAndLocationCommand.LocationSet,\n\t\t);\n\n\t\tconst cc = new NodeNamingAndLocationCCLocationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlocation,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Node Naming and Location\"])\n@implementedVersion(1)\n@ccValues(NodeNamingAndLocationCCValues)\nexport class NodeNamingAndLocationCC extends CommandClass {\n\tdeclare ccCommand: NodeNamingAndLocationCommand;\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// As the name says, this is for the node, not for endpoints\n\t\treturn true;\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Node Naming and Location\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node name...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst name = await api.getName();\n\t\tif (name != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `is named \"${name}\"`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"retrieving node location...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst location = await api.getLocation();\n\t\tif (location != undefined) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: `received location: ${location}`,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameSetOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCNameSet extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCNameSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic name: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.name) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.name.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet nameBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tnameBuffer = stringToUint8ArrayUTF16BE(this.name);\n\t\t} else {\n\t\t\tnameBuffer = Bytes.from(this.name, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tnameBuffer.subarray(0, Math.min(16, nameBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCNameReportOptions {\n\tname: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameReport)\n@ccValueProperty(\"name\", NodeNamingAndLocationCCValues.name)\nexport class NodeNamingAndLocationCCNameReport extends NodeNamingAndLocationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.name = options.name;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCNameReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst nameBuffer = raw.payload.subarray(1);\n\t\tlet name: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(nameBuffer.length % 2 === 0);\n\t\t\tname = uint8ArrayToStringUTF16BE(nameBuffer);\n\t\t} else {\n\t\t\tname = nameBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly name: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { name: this.name },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.NameGet)\n@expectedCCResponse(NodeNamingAndLocationCCNameReport)\nexport class NodeNamingAndLocationCCNameGet extends NodeNamingAndLocationCC {}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationSetOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationSet)\n@useSupervision()\nexport class NodeNamingAndLocationCCLocationSet\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new NodeNamingAndLocationCCLocationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic location: string;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encoding = isASCII(this.location) ? \"ascii\" : \"utf16le\";\n\t\tthis.payload = new Bytes(\n\t\t\t1 + this.location.length * (encoding === \"ascii\" ? 1 : 2),\n\t\t);\n\t\tthis.payload[0] = encoding === \"ascii\" ? 0x0 : 0x2;\n\t\tlet locationBuffer: Uint8Array;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tlocationBuffer = stringToUint8ArrayUTF16BE(this.location);\n\t\t} else {\n\t\t\tlocationBuffer = Bytes.from(this.location, \"ascii\");\n\t\t}\n\t\t// Copy at most 16 bytes\n\t\tthis.payload.set(\n\t\t\tlocationBuffer.subarray(0, Math.min(16, locationBuffer.length)),\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NodeNamingAndLocationCCLocationReportOptions {\n\tlocation: string;\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationReport)\n@ccValueProperty(\"location\", NodeNamingAndLocationCCValues.location)\nexport class NodeNamingAndLocationCCLocationReport\n\textends NodeNamingAndLocationCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<NodeNamingAndLocationCCLocationReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.location = options.location;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NodeNamingAndLocationCCLocationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst encoding = raw.payload[0] === 2 ? \"utf16le\" : \"ascii\";\n\t\tconst locationBuffer = raw.payload.subarray(1);\n\t\tlet location: string;\n\t\tif (encoding === \"utf16le\") {\n\t\t\tvalidatePayload(locationBuffer.length % 2 === 0);\n\t\t\tlocation = uint8ArrayToStringUTF16BE(locationBuffer);\n\t\t} else {\n\t\t\tlocation = locationBuffer.toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlocation,\n\t\t});\n\t}\n\n\tpublic readonly location: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { location: this.location },\n\t\t};\n\t}\n}\n\n@CCCommand(NodeNamingAndLocationCommand.LocationGet)\n@expectedCCResponse(NodeNamingAndLocationCCLocationReport)\nexport class NodeNamingAndLocationCCLocationGet\n\textends NodeNamingAndLocationCC\n{}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,oBAIO;AAEP,iBASO;AACP,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwB7C,SAAS,QAAQ,KAAW;AAC3B,SAAO,iBAAiB,KAAK,GAAG;AACjC;AAFS;IAKI,8BAA0B,MAAA;8BADtC,mCAAI,2BAAe,0BAA0B,CAAC,CAAC;;;;oBACA;;;;kDAAA,YAAa;WAAA;;;;;;;;6BA2E3D,gDAAA,CAAc;iCAkCd,oDAAA,CAAc;AAjCf,mBAAA,MAAA,MAAA,qBAAA,EAAA,MAAA,UAAA,MAAA,WAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,aAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,SAAb,OAAoB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAkCpB,mBAAA,MAAA,MAAA,yBAAA,EAAA,MAAA,UAAA,MAAA,eAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,iBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,aAAb,OAAwB,GAAA,UAAA,UA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
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { type GetNode, type GetSupportedCCVersion, type GetValueDB, type Notification, type NotificationState, type WithAddress } from "@zwave-js/core";
|
|
4
|
-
import {
|
|
5
|
-
import { Bytes } from "@zwave-js/shared/safe";
|
|
1
|
+
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import type { GetDeviceConfig } from "@zwave-js/config";
|
|
3
|
+
import { CommandClasses, type ControlsCC, Duration, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type NodeId, type Notification, type NotificationState, type SinglecastCC, type SupervisionResult, type SupportsCC, type ValueID, type ValueMetadataNumeric, type WithAddress } from "@zwave-js/core";
|
|
4
|
+
import { Bytes } from "@zwave-js/shared";
|
|
6
5
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API.js";
|
|
7
6
|
import { CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
8
7
|
import { NotificationCommand } from "../lib/_Types.js";
|
|
@@ -47,9 +47,7 @@ __export(NotificationCC_exports, {
|
|
|
47
47
|
module.exports = __toCommonJS(NotificationCC_exports);
|
|
48
48
|
var __validateArgs = __toESM(require("./NotificationCC._validateArgs.js"), 1);
|
|
49
49
|
var import_core = require("@zwave-js/core");
|
|
50
|
-
var
|
|
51
|
-
var import_safe2 = require("@zwave-js/shared/safe");
|
|
52
|
-
var import_safe3 = require("@zwave-js/shared/safe");
|
|
50
|
+
var import_shared = require("@zwave-js/shared");
|
|
53
51
|
var import_typeguards = require("alcalzone-shared/typeguards");
|
|
54
52
|
var import_API = require("../lib/API.js");
|
|
55
53
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
@@ -121,7 +119,7 @@ function shouldAutoCreateSimpleDoorSensorValue(ctx, endpoint) {
|
|
|
121
119
|
}
|
|
122
120
|
__name(shouldAutoCreateSimpleDoorSensorValue, "shouldAutoCreateSimpleDoorSensorValue");
|
|
123
121
|
let NotificationCCAPI = (() => {
|
|
124
|
-
let _classDecorators = [(0, import_CommandClassDecorators.API)(
|
|
122
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses.Notification)];
|
|
125
123
|
let _classDescriptor;
|
|
126
124
|
let _classExtraInitializers = [];
|
|
127
125
|
let _classThis;
|
|
@@ -208,7 +206,7 @@ let NotificationCCAPI = (() => {
|
|
|
208
206
|
async get(options) {
|
|
209
207
|
const response = await this.getInternal(options);
|
|
210
208
|
if (response) {
|
|
211
|
-
return (0,
|
|
209
|
+
return (0, import_shared.pick)(response, [
|
|
212
210
|
"notificationStatus",
|
|
213
211
|
"notificationEvent",
|
|
214
212
|
"alarmLevel",
|
|
@@ -236,7 +234,7 @@ let NotificationCCAPI = (() => {
|
|
|
236
234
|
});
|
|
237
235
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
238
236
|
if (response) {
|
|
239
|
-
return (0,
|
|
237
|
+
return (0, import_shared.pick)(response, [
|
|
240
238
|
"supportsV1Alarm",
|
|
241
239
|
"supportedNotificationTypes"
|
|
242
240
|
]);
|
|
@@ -278,7 +276,7 @@ function getNotificationStateValueWithEnum(stateValue, enumValue) {
|
|
|
278
276
|
__name(getNotificationStateValueWithEnum, "getNotificationStateValueWithEnum");
|
|
279
277
|
function getNotificationValueMetadata(previous, notification, valueConfig) {
|
|
280
278
|
const metadata = previous ?? {
|
|
281
|
-
...
|
|
279
|
+
...import_core.ValueMetadata.ReadOnlyUInt8,
|
|
282
280
|
label: valueConfig.variableName,
|
|
283
281
|
states: {},
|
|
284
282
|
ccSpecific: {
|
|
@@ -303,7 +301,7 @@ function getNotificationValueMetadata(previous, notification, valueConfig) {
|
|
|
303
301
|
}
|
|
304
302
|
__name(getNotificationValueMetadata, "getNotificationValueMetadata");
|
|
305
303
|
let NotificationCC = (() => {
|
|
306
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(
|
|
304
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses.Notification), (0, import_CommandClassDecorators.implementedVersion)(8), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.NotificationCCValues)];
|
|
307
305
|
let _classDescriptor;
|
|
308
306
|
let _classExtraInitializers = [];
|
|
309
307
|
let _classThis;
|
|
@@ -326,16 +324,16 @@ let NotificationCC = (() => {
|
|
|
326
324
|
determineRequiredCCInterviews() {
|
|
327
325
|
return [
|
|
328
326
|
...super.determineRequiredCCInterviews(),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
327
|
+
import_core.CommandClasses.Association,
|
|
328
|
+
import_core.CommandClasses["Multi Channel Association"],
|
|
329
|
+
import_core.CommandClasses["Association Group Information"]
|
|
332
330
|
];
|
|
333
331
|
}
|
|
334
332
|
async determineNotificationMode(ctx, api, supportedNotificationEvents) {
|
|
335
333
|
const node = this.getNode(ctx);
|
|
336
|
-
if (!node.supportsCC(
|
|
334
|
+
if (!node.supportsCC(import_core.CommandClasses.Association))
|
|
337
335
|
return "pull";
|
|
338
|
-
if (node.supportsCC(
|
|
336
|
+
if (node.supportsCC(import_core.CommandClasses["Association Group Information"])) {
|
|
339
337
|
try {
|
|
340
338
|
const groupsIssueingNotifications = import_AssociationGroupInfoCC.AssociationGroupInfoCC.findGroupsForIssuedCommand(ctx, node, this.ccId, import_Types.NotificationCommand.Report);
|
|
341
339
|
return groupsIssueingNotifications.length > 0 ? "push" : "pull";
|
|
@@ -375,8 +373,8 @@ let NotificationCC = (() => {
|
|
|
375
373
|
async interview(ctx) {
|
|
376
374
|
const node = this.getNode(ctx);
|
|
377
375
|
const endpoint = this.getEndpoint(ctx);
|
|
378
|
-
const api = import_API.CCAPI.create(
|
|
379
|
-
priority:
|
|
376
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses.Notification, ctx, endpoint).withOptions({
|
|
377
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
380
378
|
});
|
|
381
379
|
ctx.logNode(node.id, {
|
|
382
380
|
endpoint: this.endpointIndex,
|
|
@@ -388,7 +386,7 @@ let NotificationCC = (() => {
|
|
|
388
386
|
} catch {
|
|
389
387
|
ctx.logNode(node.id, {
|
|
390
388
|
endpoint: endpoint.index,
|
|
391
|
-
message: `Configuring associations to receive ${(0,
|
|
389
|
+
message: `Configuring associations to receive ${(0, import_core.getCCName)(this.ccId)} reports failed!`,
|
|
392
390
|
level: "warn"
|
|
393
391
|
});
|
|
394
392
|
}
|
|
@@ -512,8 +510,8 @@ let NotificationCC = (() => {
|
|
|
512
510
|
const node = this.getNode(ctx);
|
|
513
511
|
if (NotificationCC2.getNotificationMode(ctx, node) === "pull") {
|
|
514
512
|
const endpoint = this.getEndpoint(ctx);
|
|
515
|
-
const api = import_API.CCAPI.create(
|
|
516
|
-
priority:
|
|
513
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses.Notification, ctx, endpoint).withOptions({
|
|
514
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
517
515
|
});
|
|
518
516
|
const supportedNotificationTypes = this.getValue(ctx, import_CCValues_generated.NotificationCCValues.supportedNotificationTypes) ?? [];
|
|
519
517
|
const supportedNotificationNames = supportedNotificationTypes.map(import_core.getNotificationName);
|
|
@@ -570,7 +568,7 @@ let NotificationCCSet = (() => {
|
|
|
570
568
|
this.notificationStatus = options.notificationStatus;
|
|
571
569
|
}
|
|
572
570
|
static from(raw, ctx) {
|
|
573
|
-
(0,
|
|
571
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
574
572
|
const notificationType = raw.payload[0];
|
|
575
573
|
const notificationStatus = raw.payload[1] === 255;
|
|
576
574
|
return new this({
|
|
@@ -582,7 +580,7 @@ let NotificationCCSet = (() => {
|
|
|
582
580
|
notificationType;
|
|
583
581
|
notificationStatus;
|
|
584
582
|
serialize(ctx) {
|
|
585
|
-
this.payload =
|
|
583
|
+
this.payload = import_shared.Bytes.from([
|
|
586
584
|
this.notificationType,
|
|
587
585
|
this.notificationStatus ? 255 : 0
|
|
588
586
|
]);
|
|
@@ -635,7 +633,7 @@ let NotificationCCReport = (() => {
|
|
|
635
633
|
}
|
|
636
634
|
}
|
|
637
635
|
static from(raw, ctx) {
|
|
638
|
-
(0,
|
|
636
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
639
637
|
const alarmType = raw.payload[0];
|
|
640
638
|
const alarmLevel = raw.payload[1];
|
|
641
639
|
if (raw.payload.length < 7) {
|
|
@@ -652,12 +650,12 @@ let NotificationCCReport = (() => {
|
|
|
652
650
|
const numEventParams = raw.payload[6] & 31;
|
|
653
651
|
let eventParameters;
|
|
654
652
|
if (numEventParams > 0) {
|
|
655
|
-
(0,
|
|
653
|
+
(0, import_core.validatePayload)(raw.payload.length >= 7 + numEventParams);
|
|
656
654
|
eventParameters = raw.payload.subarray(7, 7 + numEventParams);
|
|
657
655
|
}
|
|
658
656
|
let sequenceNumber;
|
|
659
657
|
if (containsSeqNum) {
|
|
660
|
-
(0,
|
|
658
|
+
(0, import_core.validatePayload)(raw.payload.length >= 7 + numEventParams + 1);
|
|
661
659
|
sequenceNumber = raw.payload[7 + numEventParams];
|
|
662
660
|
}
|
|
663
661
|
return new this({
|
|
@@ -747,7 +745,7 @@ let NotificationCCReport = (() => {
|
|
|
747
745
|
...message,
|
|
748
746
|
"notification type": (0, import_core.getNotificationName)(this.notificationType),
|
|
749
747
|
"notification status": this.notificationStatus,
|
|
750
|
-
[`notification ${valueConfig.type}`]: valueConfig.label ?? `Unknown (${(0,
|
|
748
|
+
[`notification ${valueConfig.type}`]: valueConfig.label ?? `Unknown (${(0, import_shared.num2hex)(this.notificationEvent)})`
|
|
751
749
|
};
|
|
752
750
|
} else if (this.notificationEvent === 0) {
|
|
753
751
|
message = {
|
|
@@ -761,7 +759,7 @@ let NotificationCCReport = (() => {
|
|
|
761
759
|
...message,
|
|
762
760
|
"notification type": this.notificationType,
|
|
763
761
|
"notification status": this.notificationStatus,
|
|
764
|
-
"notification event": (0,
|
|
762
|
+
"notification event": (0, import_shared.num2hex)(this.notificationEvent)
|
|
765
763
|
};
|
|
766
764
|
}
|
|
767
765
|
}
|
|
@@ -779,15 +777,15 @@ let NotificationCCReport = (() => {
|
|
|
779
777
|
}
|
|
780
778
|
}
|
|
781
779
|
if (!found) {
|
|
782
|
-
message["state parameters"] = (0,
|
|
780
|
+
message["state parameters"] = (0, import_shared.num2hex)(this.eventParameters);
|
|
783
781
|
}
|
|
784
|
-
} else if ((0,
|
|
785
|
-
message["event parameters"] = (0,
|
|
786
|
-
} else if (
|
|
782
|
+
} else if ((0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
783
|
+
message["event parameters"] = (0, import_shared.buffer2hex)(this.eventParameters);
|
|
784
|
+
} else if (import_core.Duration.isDuration(this.eventParameters)) {
|
|
787
785
|
message["event parameters"] = this.eventParameters.toString();
|
|
788
786
|
} else {
|
|
789
787
|
message["event parameters"] = Object.entries(this.eventParameters).map(([param, val]) => `
|
|
790
|
-
${param}: ${(0,
|
|
788
|
+
${param}: ${(0, import_shared.num2hex)(val)}`).join("");
|
|
791
789
|
}
|
|
792
790
|
} else if (valueConfig?.parameter?.type === "enum" && valueConfig.parameter.default != void 0) {
|
|
793
791
|
const label = valueConfig.parameter.values[valueConfig.parameter.default];
|
|
@@ -811,12 +809,12 @@ let NotificationCCReport = (() => {
|
|
|
811
809
|
if (!valueConfig)
|
|
812
810
|
return;
|
|
813
811
|
if (valueConfig.parameter?.type === "duration") {
|
|
814
|
-
if (!(0,
|
|
812
|
+
if (!(0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
815
813
|
return;
|
|
816
814
|
}
|
|
817
|
-
this.eventParameters =
|
|
815
|
+
this.eventParameters = import_core.Duration.parseReport(this.eventParameters[0]);
|
|
818
816
|
} else if (valueConfig.parameter?.type === "commandclass") {
|
|
819
|
-
if (!(0,
|
|
817
|
+
if (!(0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
820
818
|
return;
|
|
821
819
|
}
|
|
822
820
|
if (this.eventParameters.length === 1 && notification.type === 6 && (this.notificationEvent === 5 || this.notificationEvent === 6)) {
|
|
@@ -827,11 +825,11 @@ let NotificationCCReport = (() => {
|
|
|
827
825
|
try {
|
|
828
826
|
const raw = import_CommandClass.CCRaw.parse(this.eventParameters);
|
|
829
827
|
if (raw.ccCommand == void 0) {
|
|
830
|
-
|
|
828
|
+
import_core.validatePayload.fail("event parameters contain an invalid CC");
|
|
831
829
|
}
|
|
832
830
|
const CommandConstructor = (0, import_CommandClassDecorators.getCCCommandConstructor)(raw.ccId, raw.ccCommand);
|
|
833
831
|
if (!CommandConstructor) {
|
|
834
|
-
|
|
832
|
+
import_core.validatePayload.fail("event parameters contain an invalid CC");
|
|
835
833
|
}
|
|
836
834
|
const cc = CommandConstructor.from(raw, {
|
|
837
835
|
...ctx,
|
|
@@ -840,7 +838,7 @@ let NotificationCCReport = (() => {
|
|
|
840
838
|
// Security encapsulation is handled outside of this CC,
|
|
841
839
|
// so it is not needed here:
|
|
842
840
|
hasSecurityClass: /* @__PURE__ */ __name(() => false, "hasSecurityClass"),
|
|
843
|
-
getHighestSecurityClass: /* @__PURE__ */ __name(() =>
|
|
841
|
+
getHighestSecurityClass: /* @__PURE__ */ __name(() => import_core.SecurityClass.None, "getHighestSecurityClass"),
|
|
844
842
|
setSecurityClass: /* @__PURE__ */ __name(() => {
|
|
845
843
|
}, "setSecurityClass"),
|
|
846
844
|
securityManager: void 0,
|
|
@@ -848,23 +846,23 @@ let NotificationCCReport = (() => {
|
|
|
848
846
|
securityManagerLR: void 0
|
|
849
847
|
});
|
|
850
848
|
if (cc instanceof Promise) {
|
|
851
|
-
|
|
849
|
+
import_core.validatePayload.fail("Cannot asynchronously parse CC from event parameters");
|
|
852
850
|
}
|
|
853
|
-
(0,
|
|
851
|
+
(0, import_core.validatePayload)(!(cc instanceof import_CommandClass.InvalidCC));
|
|
854
852
|
cc.encapsulatingCC = this;
|
|
855
853
|
if ((0, import_NotificationEventPayload.isNotificationEventPayload)(cc)) {
|
|
856
854
|
this.eventParameters = cc.toNotificationEventParameters();
|
|
857
855
|
} else {
|
|
858
856
|
let json = cc.toJSON();
|
|
859
857
|
if ("nodeId" in json && "ccId" in json && "payload" in json) {
|
|
860
|
-
json = (0,
|
|
858
|
+
json = (0, import_shared.pick)(json, ["payload"]);
|
|
861
859
|
}
|
|
862
860
|
this.eventParameters = json;
|
|
863
861
|
}
|
|
864
862
|
} catch (e) {
|
|
865
|
-
if ((0,
|
|
863
|
+
if ((0, import_core.isZWaveError)(e) && e.code === import_core.ZWaveErrorCodes.PacketFormat_InvalidPayload && (0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
866
864
|
const { ccId, ccCommand } = import_CommandClass.CCRaw.parse(this.eventParameters);
|
|
867
|
-
if (ccId ===
|
|
865
|
+
if (ccId === import_core.CommandClasses["User Code"] && ccCommand === import_Types.UserCodeCommand.Report && this.eventParameters.length >= 3) {
|
|
868
866
|
this.eventParameters = {
|
|
869
867
|
userId: this.eventParameters[2]
|
|
870
868
|
};
|
|
@@ -877,14 +875,14 @@ let NotificationCCReport = (() => {
|
|
|
877
875
|
}
|
|
878
876
|
}
|
|
879
877
|
} else if (valueConfig.parameter?.type === "value") {
|
|
880
|
-
if (!(0,
|
|
878
|
+
if (!(0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
881
879
|
return;
|
|
882
880
|
}
|
|
883
881
|
this.eventParameters = {
|
|
884
|
-
[valueConfig.parameter.propertyName]:
|
|
882
|
+
[valueConfig.parameter.propertyName]: import_shared.Bytes.view(this.eventParameters).readUIntBE(0, this.eventParameters.length)
|
|
885
883
|
};
|
|
886
884
|
} else if (valueConfig.parameter?.type === "enum") {
|
|
887
|
-
this.eventParameters = (0,
|
|
885
|
+
this.eventParameters = (0, import_shared.isUint8Array)(this.eventParameters) && this.eventParameters.length === 1 ? this.eventParameters[0] : void 0;
|
|
888
886
|
if (this.eventParameters == void 0 && valueConfig.parameter.default != void 0) {
|
|
889
887
|
this.eventParameters = valueConfig.parameter.default;
|
|
890
888
|
}
|
|
@@ -893,12 +891,12 @@ let NotificationCCReport = (() => {
|
|
|
893
891
|
serialize(ctx) {
|
|
894
892
|
if (this.notificationType != void 0) {
|
|
895
893
|
if (this.notificationEvent == void 0) {
|
|
896
|
-
throw new
|
|
897
|
-
} else if (this.eventParameters != void 0 && !(0,
|
|
898
|
-
throw new
|
|
894
|
+
throw new import_core.ZWaveError(`Notification CC reports requires the notification event to be set!`, import_core.ZWaveErrorCodes.Argument_Invalid);
|
|
895
|
+
} else if (this.eventParameters != void 0 && !(0, import_shared.isUint8Array)(this.eventParameters)) {
|
|
896
|
+
throw new import_core.ZWaveError(`When sending Notification CC reports, the event parameters can only be buffers!`, import_core.ZWaveErrorCodes.Argument_Invalid);
|
|
899
897
|
}
|
|
900
898
|
const controlByte = (this.sequenceNumber != void 0 ? 128 : 0) | (this.eventParameters?.length ?? 0) & 31;
|
|
901
|
-
this.payload =
|
|
899
|
+
this.payload = import_shared.Bytes.from([
|
|
902
900
|
0,
|
|
903
901
|
0,
|
|
904
902
|
0,
|
|
@@ -908,19 +906,19 @@ let NotificationCCReport = (() => {
|
|
|
908
906
|
controlByte
|
|
909
907
|
]);
|
|
910
908
|
if (this.eventParameters) {
|
|
911
|
-
this.payload =
|
|
909
|
+
this.payload = import_shared.Bytes.concat([
|
|
912
910
|
this.payload,
|
|
913
911
|
this.eventParameters
|
|
914
912
|
]);
|
|
915
913
|
}
|
|
916
914
|
if (this.sequenceNumber != void 0) {
|
|
917
|
-
this.payload =
|
|
915
|
+
this.payload = import_shared.Bytes.concat([
|
|
918
916
|
this.payload,
|
|
919
|
-
|
|
917
|
+
import_shared.Bytes.from([this.sequenceNumber])
|
|
920
918
|
]);
|
|
921
919
|
}
|
|
922
920
|
} else {
|
|
923
|
-
this.payload =
|
|
921
|
+
this.payload = import_shared.Bytes.from([
|
|
924
922
|
this.alarmType ?? 0,
|
|
925
923
|
this.alarmLevel ?? 0
|
|
926
924
|
]);
|
|
@@ -960,7 +958,7 @@ let NotificationCCGet = (() => {
|
|
|
960
958
|
}
|
|
961
959
|
}
|
|
962
960
|
static from(raw, ctx) {
|
|
963
|
-
(0,
|
|
961
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
964
962
|
if (raw.payload.length >= 2) {
|
|
965
963
|
const notificationType = raw.payload[1];
|
|
966
964
|
let notificationEvent;
|
|
@@ -987,7 +985,7 @@ let NotificationCCGet = (() => {
|
|
|
987
985
|
notificationEvent;
|
|
988
986
|
serialize(ctx) {
|
|
989
987
|
const notificationEvent = this.notificationEvent === 255 ? 0 : this.notificationEvent;
|
|
990
|
-
this.payload =
|
|
988
|
+
this.payload = import_shared.Bytes.from([
|
|
991
989
|
this.alarmType ?? 0,
|
|
992
990
|
this.notificationType ?? 255,
|
|
993
991
|
notificationEvent ?? 0
|
|
@@ -1039,12 +1037,12 @@ let NotificationCCSupportedReport = (() => {
|
|
|
1039
1037
|
this.supportedNotificationTypes = options.supportedNotificationTypes;
|
|
1040
1038
|
}
|
|
1041
1039
|
static from(raw, ctx) {
|
|
1042
|
-
(0,
|
|
1040
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1043
1041
|
const supportsV1Alarm = !!(raw.payload[0] & 128);
|
|
1044
1042
|
const numBitMaskBytes = raw.payload[0] & 31;
|
|
1045
|
-
(0,
|
|
1043
|
+
(0, import_core.validatePayload)(numBitMaskBytes > 0, raw.payload.length >= 1 + numBitMaskBytes);
|
|
1046
1044
|
const notificationBitMask = raw.payload.subarray(1, 1 + numBitMaskBytes);
|
|
1047
|
-
const supportedNotificationTypes = (0,
|
|
1045
|
+
const supportedNotificationTypes = (0, import_core.parseBitMask)(
|
|
1048
1046
|
notificationBitMask,
|
|
1049
1047
|
// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0
|
|
1050
1048
|
0
|
|
@@ -1058,9 +1056,9 @@ let NotificationCCSupportedReport = (() => {
|
|
|
1058
1056
|
supportsV1Alarm;
|
|
1059
1057
|
supportedNotificationTypes;
|
|
1060
1058
|
serialize(ctx) {
|
|
1061
|
-
const bitMask = (0,
|
|
1062
|
-
this.payload =
|
|
1063
|
-
|
|
1059
|
+
const bitMask = (0, import_core.encodeBitMask)(this.supportedNotificationTypes, Math.max(...this.supportedNotificationTypes), 0);
|
|
1060
|
+
this.payload = import_shared.Bytes.concat([
|
|
1061
|
+
import_shared.Bytes.from([
|
|
1064
1062
|
(this.supportsV1Alarm ? 128 : 0) | bitMask.length
|
|
1065
1063
|
]),
|
|
1066
1064
|
bitMask
|
|
@@ -1129,7 +1127,7 @@ let NotificationCCEventSupportedReport = (() => {
|
|
|
1129
1127
|
this.supportedEvents = options.supportedEvents;
|
|
1130
1128
|
}
|
|
1131
1129
|
static from(raw, ctx) {
|
|
1132
|
-
(0,
|
|
1130
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1133
1131
|
const notificationType = raw.payload[0];
|
|
1134
1132
|
const numBitMaskBytes = raw.payload[1] & 31;
|
|
1135
1133
|
if (numBitMaskBytes === 0) {
|
|
@@ -1139,9 +1137,9 @@ let NotificationCCEventSupportedReport = (() => {
|
|
|
1139
1137
|
supportedEvents: []
|
|
1140
1138
|
});
|
|
1141
1139
|
}
|
|
1142
|
-
(0,
|
|
1140
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2 + numBitMaskBytes);
|
|
1143
1141
|
const eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);
|
|
1144
|
-
const supportedEvents = (0,
|
|
1142
|
+
const supportedEvents = (0, import_core.parseBitMask)(
|
|
1145
1143
|
eventBitMask,
|
|
1146
1144
|
// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0
|
|
1147
1145
|
0
|
|
@@ -1176,11 +1174,11 @@ let NotificationCCEventSupportedReport = (() => {
|
|
|
1176
1174
|
notificationType;
|
|
1177
1175
|
supportedEvents;
|
|
1178
1176
|
serialize(ctx) {
|
|
1179
|
-
this.payload =
|
|
1177
|
+
this.payload = import_shared.Bytes.from([this.notificationType, 0]);
|
|
1180
1178
|
if (this.supportedEvents.length > 0) {
|
|
1181
|
-
const bitMask = (0,
|
|
1179
|
+
const bitMask = (0, import_core.encodeBitMask)(this.supportedEvents, Math.max(...this.supportedEvents), 0);
|
|
1182
1180
|
this.payload[1] = bitMask.length;
|
|
1183
|
-
this.payload =
|
|
1181
|
+
this.payload = import_shared.Bytes.concat([this.payload, bitMask]);
|
|
1184
1182
|
}
|
|
1185
1183
|
return super.serialize(ctx);
|
|
1186
1184
|
}
|
|
@@ -1222,7 +1220,7 @@ let NotificationCCEventSupportedGet = (() => {
|
|
|
1222
1220
|
this.notificationType = options.notificationType;
|
|
1223
1221
|
}
|
|
1224
1222
|
static from(raw, ctx) {
|
|
1225
|
-
(0,
|
|
1223
|
+
(0, import_core.validatePayload)(raw.payload.length >= 1);
|
|
1226
1224
|
const notificationType = raw.payload[0];
|
|
1227
1225
|
return new this({
|
|
1228
1226
|
nodeId: ctx.sourceNodeId,
|
|
@@ -1231,7 +1229,7 @@ let NotificationCCEventSupportedGet = (() => {
|
|
|
1231
1229
|
}
|
|
1232
1230
|
notificationType;
|
|
1233
1231
|
serialize(ctx) {
|
|
1234
|
-
this.payload =
|
|
1232
|
+
this.payload = import_shared.Bytes.from([this.notificationType]);
|
|
1235
1233
|
return super.serialize(ctx);
|
|
1236
1234
|
}
|
|
1237
1235
|
toLogEntry(ctx) {
|