@zwave-js/cc 15.1.1 → 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 +4 -7
- package/build/cjs/cc/BatteryCC.js +18 -20
- 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 +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +10 -10
- 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 +11 -11
- package/build/cjs/cc/MultiChannelCC.js +53 -53
- 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.js +24 -26
- 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 +4 -7
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -4
- 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 +3 -3
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +2 -2
- 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 +11 -11
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +2 -2
- 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.map +1 -1
- package/build/esm/cc/_CCValues.generated.js +2 -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
|
@@ -39,9 +39,8 @@ __export(ManufacturerSpecificCC_exports, {
|
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(ManufacturerSpecificCC_exports);
|
|
41
41
|
var __validateArgs = __toESM(require("./ManufacturerSpecificCC._validateArgs.js"), 1);
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var import_safe3 = require("@zwave-js/shared/safe");
|
|
42
|
+
var import_core = require("@zwave-js/core");
|
|
43
|
+
var import_shared = require("@zwave-js/shared");
|
|
45
44
|
var import_API = require("../lib/API.js");
|
|
46
45
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
47
46
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
@@ -90,7 +89,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
90
89
|
};
|
|
91
90
|
const { validateArgs_ManufacturerSpecificCCAPI_deviceSpecificGet, validateArgs_ManufacturerSpecificCCAPI_sendReport } = __validateArgs;
|
|
92
91
|
let ManufacturerSpecificCCAPI = (() => {
|
|
93
|
-
let _classDecorators = [(0, import_CommandClassDecorators.API)(
|
|
92
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Manufacturer Specific"])];
|
|
94
93
|
let _classDescriptor;
|
|
95
94
|
let _classExtraInitializers = [];
|
|
96
95
|
let _classThis;
|
|
@@ -137,7 +136,7 @@ let ManufacturerSpecificCCAPI = (() => {
|
|
|
137
136
|
});
|
|
138
137
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
139
138
|
if (response) {
|
|
140
|
-
return (0,
|
|
139
|
+
return (0, import_shared.pick)(response, [
|
|
141
140
|
"manufacturerId",
|
|
142
141
|
"productType",
|
|
143
142
|
"productId"
|
|
@@ -171,7 +170,7 @@ let ManufacturerSpecificCCAPI = (() => {
|
|
|
171
170
|
return ManufacturerSpecificCCAPI2 = _classThis;
|
|
172
171
|
})();
|
|
173
172
|
let ManufacturerSpecificCC = (() => {
|
|
174
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(
|
|
173
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Manufacturer Specific"]), (0, import_CommandClassDecorators.implementedVersion)(2), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.ManufacturerSpecificCCValues)];
|
|
175
174
|
let _classDescriptor;
|
|
176
175
|
let _classExtraInitializers = [];
|
|
177
176
|
let _classThis;
|
|
@@ -196,7 +195,7 @@ let ManufacturerSpecificCC = (() => {
|
|
|
196
195
|
async interview(ctx) {
|
|
197
196
|
const node = this.getNode(ctx);
|
|
198
197
|
const endpoint = this.getEndpoint(ctx);
|
|
199
|
-
const api = import_API.CCAPI.create(
|
|
198
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses["Manufacturer Specific"], ctx, endpoint).withOptions({ priority: import_core.MessagePriority.NodeQuery });
|
|
200
199
|
if (node.id !== ctx.ownNodeId) {
|
|
201
200
|
ctx.logNode(node.id, {
|
|
202
201
|
endpoint: this.endpointIndex,
|
|
@@ -211,9 +210,9 @@ let ManufacturerSpecificCC = (() => {
|
|
|
211
210
|
const mfResp = await api.get();
|
|
212
211
|
if (mfResp) {
|
|
213
212
|
const logMessage = `received response for manufacturer information:
|
|
214
|
-
manufacturer: ${ctx.lookupManufacturer(mfResp.manufacturerId) || "unknown"} (${(0,
|
|
215
|
-
product type: ${(0,
|
|
216
|
-
product id: ${(0,
|
|
213
|
+
manufacturer: ${ctx.lookupManufacturer(mfResp.manufacturerId) || "unknown"} (${(0, import_shared.num2hex)(mfResp.manufacturerId)})
|
|
214
|
+
product type: ${(0, import_shared.num2hex)(mfResp.productType)}
|
|
215
|
+
product id: ${(0, import_shared.num2hex)(mfResp.productId)}`;
|
|
217
216
|
ctx.logNode(node.id, {
|
|
218
217
|
endpoint: this.endpointIndex,
|
|
219
218
|
message: logMessage,
|
|
@@ -253,7 +252,7 @@ let ManufacturerSpecificCCReport = (() => {
|
|
|
253
252
|
this.productId = options.productId;
|
|
254
253
|
}
|
|
255
254
|
static from(raw, ctx) {
|
|
256
|
-
(0,
|
|
255
|
+
(0, import_core.validatePayload)(raw.payload.length >= 6);
|
|
257
256
|
const manufacturerId = raw.payload.readUInt16BE(0);
|
|
258
257
|
const productType = raw.payload.readUInt16BE(2);
|
|
259
258
|
const productId = raw.payload.readUInt16BE(4);
|
|
@@ -268,7 +267,7 @@ let ManufacturerSpecificCCReport = (() => {
|
|
|
268
267
|
productType;
|
|
269
268
|
productId;
|
|
270
269
|
serialize(ctx) {
|
|
271
|
-
this.payload = new
|
|
270
|
+
this.payload = new import_shared.Bytes(6);
|
|
272
271
|
this.payload.writeUInt16BE(this.manufacturerId, 0);
|
|
273
272
|
this.payload.writeUInt16BE(this.productType, 2);
|
|
274
273
|
this.payload.writeUInt16BE(this.productId, 4);
|
|
@@ -278,9 +277,9 @@ let ManufacturerSpecificCCReport = (() => {
|
|
|
278
277
|
return {
|
|
279
278
|
...super.toLogEntry(ctx),
|
|
280
279
|
message: {
|
|
281
|
-
"manufacturer id": (0,
|
|
282
|
-
"product type": (0,
|
|
283
|
-
"product id": (0,
|
|
280
|
+
"manufacturer id": (0, import_shared.num2hex)(this.manufacturerId),
|
|
281
|
+
"product type": (0, import_shared.num2hex)(this.productType),
|
|
282
|
+
"product id": (0, import_shared.num2hex)(this.productId)
|
|
284
283
|
}
|
|
285
284
|
};
|
|
286
285
|
}
|
|
@@ -336,11 +335,11 @@ let ManufacturerSpecificCCDeviceSpecificReport = (() => {
|
|
|
336
335
|
this.deviceId = options.deviceId;
|
|
337
336
|
}
|
|
338
337
|
static from(raw, ctx) {
|
|
339
|
-
(0,
|
|
338
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
340
339
|
const type = raw.payload[0] & 7;
|
|
341
340
|
const dataFormat = raw.payload[1] >>> 5;
|
|
342
341
|
const dataLength = raw.payload[1] & 31;
|
|
343
|
-
(0,
|
|
342
|
+
(0, import_core.validatePayload)(dataLength > 0, raw.payload.length >= 2 + dataLength);
|
|
344
343
|
const deviceIdData = raw.payload.subarray(2, 2 + dataLength);
|
|
345
344
|
const deviceId = dataFormat === 0 ? deviceIdData.toString("utf8") : "0x" + deviceIdData.toString("hex");
|
|
346
345
|
return new this({
|
|
@@ -355,7 +354,7 @@ let ManufacturerSpecificCCDeviceSpecificReport = (() => {
|
|
|
355
354
|
return {
|
|
356
355
|
...super.toLogEntry(ctx),
|
|
357
356
|
message: {
|
|
358
|
-
"device id type": (0,
|
|
357
|
+
"device id type": (0, import_shared.getEnumMemberName)(import_Types.DeviceIdType, this.type),
|
|
359
358
|
"device id": this.deviceId
|
|
360
359
|
}
|
|
361
360
|
};
|
|
@@ -388,18 +387,18 @@ let ManufacturerSpecificCCDeviceSpecificGet = (() => {
|
|
|
388
387
|
this.deviceIdType = options.deviceIdType;
|
|
389
388
|
}
|
|
390
389
|
static from(_raw, _ctx) {
|
|
391
|
-
throw new
|
|
390
|
+
throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
392
391
|
}
|
|
393
392
|
deviceIdType;
|
|
394
393
|
serialize(ctx) {
|
|
395
|
-
this.payload =
|
|
394
|
+
this.payload = import_shared.Bytes.from([(this.deviceIdType || 0) & 7]);
|
|
396
395
|
return super.serialize(ctx);
|
|
397
396
|
}
|
|
398
397
|
toLogEntry(ctx) {
|
|
399
398
|
return {
|
|
400
399
|
...super.toLogEntry(ctx),
|
|
401
400
|
message: {
|
|
402
|
-
"device id type": (0,
|
|
401
|
+
"device id type": (0, import_shared.getEnumMemberName)(import_Types.DeviceIdType, this.deviceIdType)
|
|
403
402
|
}
|
|
404
403
|
};
|
|
405
404
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/ManufacturerSpecificCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport type {\n\tGetValueDB,\n\tMessageOrCCLogEntry,\n\tWithAddress,\n} from \"@zwave-js/core/safe\";\nimport {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\tMessagePriority,\n\tValueMetadata,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, num2hex, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { DeviceIdType, ManufacturerSpecificCommand } from \"../lib/_Types.js\";\n\nexport const ManufacturerSpecificCCValues = V.defineCCValues(\n\tCommandClasses[\"Manufacturer Specific\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"manufacturerId\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Manufacturer ID\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"productType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Product type\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"productId\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Product ID\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"deviceId\",\n\t\t\t\"deviceId\",\n\t\t\t(type: DeviceIdType) => getEnumMemberName(DeviceIdType, type),\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"deviceId\"\n\t\t\t\t&& typeof propertyKey === \"string\"\n\t\t\t\t&& propertyKey in DeviceIdType,\n\t\t\t(type: DeviceIdType) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\t\tlabel: `Device ID (${getEnumMemberName(DeviceIdType, type)})`,\n\t\t\t}),\n\t\t\t{ minVersion: 2 } as const,\n\t\t),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Manufacturer Specific\"])\nexport class ManufacturerSpecificCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ManufacturerSpecificCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ManufacturerSpecificCommand.Get:\n\t\t\tcase ManufacturerSpecificCommand.Report:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase ManufacturerSpecificCommand.DeviceSpecificGet:\n\t\t\tcase ManufacturerSpecificCommand.DeviceSpecificReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.Get,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCGet({\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\tManufacturerSpecificCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"manufacturerId\",\n\t\t\t\t\"productType\",\n\t\t\t\t\"productId\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async deviceSpecificGet(\n\t\tdeviceIdType: DeviceIdType,\n\t): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.DeviceSpecificGet,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCDeviceSpecificGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tdeviceIdType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tManufacturerSpecificCCDeviceSpecificReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.deviceId;\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: ManufacturerSpecificCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.Report,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Manufacturer Specific\"])\n@implementedVersion(2)\n@ccValues(ManufacturerSpecificCCValues)\nexport class ManufacturerSpecificCC extends CommandClass {\n\tdeclare ccCommand: ManufacturerSpecificCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// The Manufacturer Specific CC MUST be interviewed first\n\t\treturn [];\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\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[\"Manufacturer Specific\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\tif (node.id !== ctx.ownNodeId) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying manufacturer information...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst mfResp = await api.get();\n\t\t\tif (mfResp) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received response for manufacturer information:\n manufacturer: ${\n\t\t\t\t\t\tctx.lookupManufacturer(\n\t\t\t\t\t\t\tmfResp.manufacturerId,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t|| \"unknown\"\n\t\t\t\t\t} (${num2hex(mfResp.manufacturerId)})\n product type: ${num2hex(mfResp.productType)}\n product id: ${num2hex(mfResp.productId)}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCReportOptions {\n\tmanufacturerId: number;\n\tproductType: number;\n\tproductId: number;\n}\n\n@CCCommand(ManufacturerSpecificCommand.Report)\n@ccValueProperty(\"manufacturerId\", ManufacturerSpecificCCValues.manufacturerId)\n@ccValueProperty(\"productType\", ManufacturerSpecificCCValues.productType)\n@ccValueProperty(\"productId\", ManufacturerSpecificCCValues.productId)\nexport class ManufacturerSpecificCCReport extends ManufacturerSpecificCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.manufacturerId = options.manufacturerId;\n\t\tthis.productType = options.productType;\n\t\tthis.productId = options.productId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ManufacturerSpecificCCReport {\n\t\tvalidatePayload(raw.payload.length >= 6);\n\t\tconst manufacturerId = raw.payload.readUInt16BE(0);\n\t\tconst productType = raw.payload.readUInt16BE(2);\n\t\tconst productId = raw.payload.readUInt16BE(4);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t});\n\t}\n\n\tpublic readonly manufacturerId: number;\n\n\tpublic readonly productType: number;\n\n\tpublic readonly productId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(6);\n\t\tthis.payload.writeUInt16BE(this.manufacturerId, 0);\n\t\tthis.payload.writeUInt16BE(this.productType, 2);\n\t\tthis.payload.writeUInt16BE(this.productId, 4);\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: {\n\t\t\t\t\"manufacturer id\": num2hex(this.manufacturerId),\n\t\t\t\t\"product type\": num2hex(this.productType),\n\t\t\t\t\"product id\": num2hex(this.productId),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ManufacturerSpecificCommand.Get)\n@expectedCCResponse(ManufacturerSpecificCCReport)\nexport class ManufacturerSpecificCCGet extends ManufacturerSpecificCC {}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCDeviceSpecificReportOptions {\n\ttype: DeviceIdType;\n\tdeviceId: string;\n}\n\n@CCCommand(ManufacturerSpecificCommand.DeviceSpecificReport)\n@ccValueProperty(\n\t\"deviceId\",\n\tManufacturerSpecificCCValues.deviceId,\n\t(self) => [self.type],\n)\nexport class ManufacturerSpecificCCDeviceSpecificReport\n\textends ManufacturerSpecificCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCDeviceSpecificReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.type = options.type;\n\t\tthis.deviceId = options.deviceId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ManufacturerSpecificCCDeviceSpecificReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst type: DeviceIdType = raw.payload[0] & 0b111;\n\t\tconst dataFormat = raw.payload[1] >>> 5;\n\t\tconst dataLength = raw.payload[1] & 0b11111;\n\t\tvalidatePayload(dataLength > 0, raw.payload.length >= 2 + dataLength);\n\t\tconst deviceIdData = raw.payload.subarray(2, 2 + dataLength);\n\t\tconst deviceId: string = dataFormat === 0\n\t\t\t? deviceIdData.toString(\"utf8\")\n\t\t\t: \"0x\" + deviceIdData.toString(\"hex\");\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttype,\n\t\t\tdeviceId,\n\t\t});\n\t}\n\n\tpublic readonly type: DeviceIdType;\n\n\tpublic readonly deviceId: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"device id type\": getEnumMemberName(DeviceIdType, this.type),\n\t\t\t\t\"device id\": this.deviceId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCDeviceSpecificGetOptions {\n\tdeviceIdType: DeviceIdType;\n}\n\n@CCCommand(ManufacturerSpecificCommand.DeviceSpecificGet)\n@expectedCCResponse(ManufacturerSpecificCCDeviceSpecificReport)\nexport class ManufacturerSpecificCCDeviceSpecificGet\n\textends ManufacturerSpecificCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCDeviceSpecificGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.deviceIdType = options.deviceIdType;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ManufacturerSpecificCCDeviceSpecificGet {\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 ManufacturerSpecificCCDeviceSpecificGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic deviceIdType: DeviceIdType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([(this.deviceIdType || 0) & 0b111]);\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: {\n\t\t\t\t\"device id type\": getEnumMemberName(\n\t\t\t\t\tDeviceIdType,\n\t\t\t\t\tthis.deviceIdType,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { DeviceIdType, ManufacturerSpecificCommand } from \"../lib/_Types.js\";\n\nexport const ManufacturerSpecificCCValues = V.defineCCValues(\n\tCommandClasses[\"Manufacturer Specific\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"manufacturerId\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Manufacturer ID\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"productType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Product type\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"productId\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt16,\n\t\t\t\tlabel: \"Product ID\",\n\t\t\t} as const,\n\t\t\t{ supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"deviceId\",\n\t\t\t\"deviceId\",\n\t\t\t(type: DeviceIdType) => getEnumMemberName(DeviceIdType, type),\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"deviceId\"\n\t\t\t\t&& typeof propertyKey === \"string\"\n\t\t\t\t&& propertyKey in DeviceIdType,\n\t\t\t(type: DeviceIdType) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\t\tlabel: `Device ID (${getEnumMemberName(DeviceIdType, type)})`,\n\t\t\t}),\n\t\t\t{ minVersion: 2 } as const,\n\t\t),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Manufacturer Specific\"])\nexport class ManufacturerSpecificCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ManufacturerSpecificCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ManufacturerSpecificCommand.Get:\n\t\t\tcase ManufacturerSpecificCommand.Report:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase ManufacturerSpecificCommand.DeviceSpecificGet:\n\t\t\tcase ManufacturerSpecificCommand.DeviceSpecificReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.Get,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCGet({\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\tManufacturerSpecificCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"manufacturerId\",\n\t\t\t\t\"productType\",\n\t\t\t\t\"productId\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async deviceSpecificGet(\n\t\tdeviceIdType: DeviceIdType,\n\t): Promise<MaybeNotKnown<string>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.DeviceSpecificGet,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCDeviceSpecificGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tdeviceIdType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tManufacturerSpecificCCDeviceSpecificReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.deviceId;\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: ManufacturerSpecificCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tManufacturerSpecificCommand,\n\t\t\tManufacturerSpecificCommand.Report,\n\t\t);\n\n\t\tconst cc = new ManufacturerSpecificCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Manufacturer Specific\"])\n@implementedVersion(2)\n@ccValues(ManufacturerSpecificCCValues)\nexport class ManufacturerSpecificCC extends CommandClass {\n\tdeclare ccCommand: ManufacturerSpecificCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\t// The Manufacturer Specific CC MUST be interviewed first\n\t\treturn [];\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\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[\"Manufacturer Specific\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({ priority: MessagePriority.NodeQuery });\n\n\t\tif (node.id !== ctx.ownNodeId) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying manufacturer information...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst mfResp = await api.get();\n\t\t\tif (mfResp) {\n\t\t\t\tconst logMessage =\n\t\t\t\t\t`received response for manufacturer information:\n manufacturer: ${\n\t\t\t\t\t\tctx.lookupManufacturer(\n\t\t\t\t\t\t\tmfResp.manufacturerId,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t|| \"unknown\"\n\t\t\t\t\t} (${num2hex(mfResp.manufacturerId)})\n product type: ${num2hex(mfResp.productType)}\n product id: ${num2hex(mfResp.productId)}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCReportOptions {\n\tmanufacturerId: number;\n\tproductType: number;\n\tproductId: number;\n}\n\n@CCCommand(ManufacturerSpecificCommand.Report)\n@ccValueProperty(\"manufacturerId\", ManufacturerSpecificCCValues.manufacturerId)\n@ccValueProperty(\"productType\", ManufacturerSpecificCCValues.productType)\n@ccValueProperty(\"productId\", ManufacturerSpecificCCValues.productId)\nexport class ManufacturerSpecificCCReport extends ManufacturerSpecificCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.manufacturerId = options.manufacturerId;\n\t\tthis.productType = options.productType;\n\t\tthis.productId = options.productId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ManufacturerSpecificCCReport {\n\t\tvalidatePayload(raw.payload.length >= 6);\n\t\tconst manufacturerId = raw.payload.readUInt16BE(0);\n\t\tconst productType = raw.payload.readUInt16BE(2);\n\t\tconst productId = raw.payload.readUInt16BE(4);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tmanufacturerId,\n\t\t\tproductType,\n\t\t\tproductId,\n\t\t});\n\t}\n\n\tpublic readonly manufacturerId: number;\n\n\tpublic readonly productType: number;\n\n\tpublic readonly productId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(6);\n\t\tthis.payload.writeUInt16BE(this.manufacturerId, 0);\n\t\tthis.payload.writeUInt16BE(this.productType, 2);\n\t\tthis.payload.writeUInt16BE(this.productId, 4);\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: {\n\t\t\t\t\"manufacturer id\": num2hex(this.manufacturerId),\n\t\t\t\t\"product type\": num2hex(this.productType),\n\t\t\t\t\"product id\": num2hex(this.productId),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ManufacturerSpecificCommand.Get)\n@expectedCCResponse(ManufacturerSpecificCCReport)\nexport class ManufacturerSpecificCCGet extends ManufacturerSpecificCC {}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCDeviceSpecificReportOptions {\n\ttype: DeviceIdType;\n\tdeviceId: string;\n}\n\n@CCCommand(ManufacturerSpecificCommand.DeviceSpecificReport)\n@ccValueProperty(\n\t\"deviceId\",\n\tManufacturerSpecificCCValues.deviceId,\n\t(self) => [self.type],\n)\nexport class ManufacturerSpecificCCDeviceSpecificReport\n\textends ManufacturerSpecificCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCDeviceSpecificReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.type = options.type;\n\t\tthis.deviceId = options.deviceId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ManufacturerSpecificCCDeviceSpecificReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst type: DeviceIdType = raw.payload[0] & 0b111;\n\t\tconst dataFormat = raw.payload[1] >>> 5;\n\t\tconst dataLength = raw.payload[1] & 0b11111;\n\t\tvalidatePayload(dataLength > 0, raw.payload.length >= 2 + dataLength);\n\t\tconst deviceIdData = raw.payload.subarray(2, 2 + dataLength);\n\t\tconst deviceId: string = dataFormat === 0\n\t\t\t? deviceIdData.toString(\"utf8\")\n\t\t\t: \"0x\" + deviceIdData.toString(\"hex\");\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttype,\n\t\t\tdeviceId,\n\t\t});\n\t}\n\n\tpublic readonly type: DeviceIdType;\n\n\tpublic readonly deviceId: string;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"device id type\": getEnumMemberName(DeviceIdType, this.type),\n\t\t\t\t\"device id\": this.deviceId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ManufacturerSpecificCCDeviceSpecificGetOptions {\n\tdeviceIdType: DeviceIdType;\n}\n\n@CCCommand(ManufacturerSpecificCommand.DeviceSpecificGet)\n@expectedCCResponse(ManufacturerSpecificCCDeviceSpecificReport)\nexport class ManufacturerSpecificCCDeviceSpecificGet\n\textends ManufacturerSpecificCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ManufacturerSpecificCCDeviceSpecificGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.deviceIdType = options.deviceIdType;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ManufacturerSpecificCCDeviceSpecificGet {\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 ManufacturerSpecificCCDeviceSpecificGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic deviceIdType: DeviceIdType;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([(this.deviceIdType || 0) & 0b111]);\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: {\n\t\t\t\t\"device id type\": getEnumMemberName(\n\t\t\t\t\tDeviceIdType,\n\t\t\t\t\tthis.deviceIdType,\n\t\t\t\t),\n\t\t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jC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,sBAAkB,iCACjB,2BACA,KAAK,YAAY;;;IAIrB;;;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeUnknown, type WithAddress } from "@zwave-js/core";
|
|
4
|
-
import {
|
|
5
|
-
import { Bytes } from "@zwave-js/shared/safe";
|
|
6
|
-
import { type AllOrNone } 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, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, type NodeId, type SinglecastCC, type SupervisionResult, type SupportsCC, type WithAddress } from "@zwave-js/core";
|
|
4
|
+
import { type AllOrNone, Bytes } from "@zwave-js/shared";
|
|
7
5
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API.js";
|
|
8
6
|
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
9
7
|
import { MeterCommand, type MeterReading, RateType } from "../lib/_Types.js";
|
package/build/cjs/cc/MeterCC.js
CHANGED
|
@@ -42,9 +42,7 @@ __export(MeterCC_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(MeterCC_exports);
|
|
43
43
|
var __validateArgs = __toESM(require("./MeterCC._validateArgs.js"), 1);
|
|
44
44
|
var import_core = require("@zwave-js/core");
|
|
45
|
-
var
|
|
46
|
-
var import_safe2 = require("@zwave-js/shared/safe");
|
|
47
|
-
var import_safe3 = require("@zwave-js/shared/safe");
|
|
45
|
+
var import_shared = require("@zwave-js/shared");
|
|
48
46
|
var import_API = require("../lib/API.js");
|
|
49
47
|
var import_CCValueUtils = require("../lib/CCValueUtils.js");
|
|
50
48
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
@@ -121,11 +119,11 @@ function getValueLabel(meterType, scale, rateType, suffix) {
|
|
|
121
119
|
}
|
|
122
120
|
__name(getValueLabel, "getValueLabel");
|
|
123
121
|
function parseMeterValueAndInfo(data, offset) {
|
|
124
|
-
(0,
|
|
122
|
+
(0, import_core.validatePayload)(data.length >= offset + 1);
|
|
125
123
|
const type = data[offset] & 31;
|
|
126
124
|
const rateType = (data[offset] & 96) >>> 5;
|
|
127
125
|
const scale1Bit2 = (data[offset] & 128) >>> 7;
|
|
128
|
-
const { scale: scale1Bits10, value, bytesRead } = (0,
|
|
126
|
+
const { scale: scale1Bits10, value, bytesRead } = (0, import_core.parseFloatWithScale)(data.subarray(offset + 1));
|
|
129
127
|
return {
|
|
130
128
|
type,
|
|
131
129
|
rateType,
|
|
@@ -146,15 +144,15 @@ function encodeMeterValueAndInfo(type, rateType, scale, value) {
|
|
|
146
144
|
const floatParams = (0, import_core.getFloatParameters)(value);
|
|
147
145
|
const valueBytes = (0, import_core.encodeFloatWithScale)(value, scale1Bits10, floatParams);
|
|
148
146
|
return {
|
|
149
|
-
data:
|
|
150
|
-
floatParams: (0,
|
|
147
|
+
data: import_shared.Bytes.concat([import_shared.Bytes.from([typeByte]), valueBytes]),
|
|
148
|
+
floatParams: (0, import_shared.pick)(floatParams, ["precision", "size"]),
|
|
151
149
|
scale2
|
|
152
150
|
};
|
|
153
151
|
}
|
|
154
152
|
__name(encodeMeterValueAndInfo, "encodeMeterValueAndInfo");
|
|
155
153
|
function parseScale(scale1, data, scale2Offset) {
|
|
156
154
|
if (scale1 === 7) {
|
|
157
|
-
(0,
|
|
155
|
+
(0, import_core.validatePayload)(data.length >= scale2Offset + 1);
|
|
158
156
|
const scale2 = data[scale2Offset];
|
|
159
157
|
return scale1 + scale2;
|
|
160
158
|
} else {
|
|
@@ -192,7 +190,7 @@ function isAccumulatedValue(meterType, scale) {
|
|
|
192
190
|
}
|
|
193
191
|
__name(isAccumulatedValue, "isAccumulatedValue");
|
|
194
192
|
let MeterCCAPI = (() => {
|
|
195
|
-
let _classDecorators = [(0, import_CommandClassDecorators.API)(
|
|
193
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses.Meter)];
|
|
196
194
|
let _classDescriptor;
|
|
197
195
|
let _classExtraInitializers = [];
|
|
198
196
|
let _classThis;
|
|
@@ -276,7 +274,7 @@ let MeterCCAPI = (() => {
|
|
|
276
274
|
return {
|
|
277
275
|
type: response.type,
|
|
278
276
|
scale: (0, import_core.getMeterScale)(response.type, response.scale) ?? (0, import_core.getUnknownMeterScale)(response.scale),
|
|
279
|
-
...(0,
|
|
277
|
+
...(0, import_shared.pick)(response, [
|
|
280
278
|
"value",
|
|
281
279
|
"previousValue",
|
|
282
280
|
"rateType",
|
|
@@ -330,7 +328,7 @@ let MeterCCAPI = (() => {
|
|
|
330
328
|
});
|
|
331
329
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
332
330
|
if (response) {
|
|
333
|
-
return (0,
|
|
331
|
+
return (0, import_shared.pick)(response, [
|
|
334
332
|
"type",
|
|
335
333
|
"supportsReset",
|
|
336
334
|
"supportedScales",
|
|
@@ -435,7 +433,7 @@ let MeterCCAPI = (() => {
|
|
|
435
433
|
return MeterCCAPI2 = _classThis;
|
|
436
434
|
})();
|
|
437
435
|
let MeterCC = (() => {
|
|
438
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(
|
|
436
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses.Meter), (0, import_CommandClassDecorators.implementedVersion)(6), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.MeterCCValues)];
|
|
439
437
|
let _classDescriptor;
|
|
440
438
|
let _classExtraInitializers = [];
|
|
441
439
|
let _classThis;
|
|
@@ -457,8 +455,8 @@ let MeterCC = (() => {
|
|
|
457
455
|
async interview(ctx) {
|
|
458
456
|
const node = this.getNode(ctx);
|
|
459
457
|
const endpoint = this.getEndpoint(ctx);
|
|
460
|
-
const api = import_API.CCAPI.create(
|
|
461
|
-
priority:
|
|
458
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses.Meter, ctx, endpoint).withOptions({
|
|
459
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
462
460
|
});
|
|
463
461
|
ctx.logNode(node.id, {
|
|
464
462
|
endpoint: this.endpointIndex,
|
|
@@ -477,7 +475,7 @@ let MeterCC = (() => {
|
|
|
477
475
|
type: ${(0, import_core.getMeterName)(suppResp.type)}
|
|
478
476
|
supported scales: ${suppResp.supportedScales.map((s) => ((0, import_core.getMeterScale)(suppResp.type, s) ?? (0, import_core.getUnknownMeterScale)(s)).label).map((label) => `
|
|
479
477
|
\xB7 ${label}`).join("")}
|
|
480
|
-
supported rate types: ${suppResp.supportedRateTypes.map((rt) => (0,
|
|
478
|
+
supported rate types: ${suppResp.supportedRateTypes.map((rt) => (0, import_shared.getEnumMemberName)(import_Types.RateType, rt)).map((label) => `
|
|
481
479
|
\xB7 ${label}`).join("")}
|
|
482
480
|
supports reset: ${suppResp.supportsReset}`;
|
|
483
481
|
ctx.logNode(node.id, {
|
|
@@ -500,8 +498,8 @@ supports reset: ${suppResp.supportsReset}`;
|
|
|
500
498
|
async refreshValues(ctx) {
|
|
501
499
|
const node = this.getNode(ctx);
|
|
502
500
|
const endpoint = this.getEndpoint(ctx);
|
|
503
|
-
const api = import_API.CCAPI.create(
|
|
504
|
-
priority:
|
|
501
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses.Meter, ctx, endpoint).withOptions({
|
|
502
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
505
503
|
});
|
|
506
504
|
if (api.version === 1) {
|
|
507
505
|
ctx.logNode(node.id, {
|
|
@@ -519,7 +517,7 @@ supports reset: ${suppResp.supportsReset}`;
|
|
|
519
517
|
for (const scale of supportedScales) {
|
|
520
518
|
ctx.logNode(node.id, {
|
|
521
519
|
endpoint: this.endpointIndex,
|
|
522
|
-
message: `querying meter value (type = ${(0, import_core.getMeterName)(type)}, scale = ${((0, import_core.getMeterScale)(type, scale) ?? (0, import_core.getUnknownMeterScale)(scale)).label}${rateType != void 0 ? `, rate type = ${(0,
|
|
520
|
+
message: `querying meter value (type = ${(0, import_core.getMeterName)(type)}, scale = ${((0, import_core.getMeterScale)(type, scale) ?? (0, import_core.getUnknownMeterScale)(scale)).label}${rateType != void 0 ? `, rate type = ${(0, import_shared.getEnumMemberName)(import_Types.RateType, rateType)}` : ""})...`,
|
|
523
521
|
direction: "outbound"
|
|
524
522
|
});
|
|
525
523
|
await api.get({ scale, rateType });
|
|
@@ -575,7 +573,7 @@ supports reset: ${suppResp.supportsReset}`;
|
|
|
575
573
|
ret = "default";
|
|
576
574
|
}
|
|
577
575
|
if (rateType !== import_Types.RateType.Unspecified) {
|
|
578
|
-
ret += "_" + (0,
|
|
576
|
+
ret += "_" + (0, import_shared.getEnumMemberName)(import_Types.RateType, rateType);
|
|
579
577
|
}
|
|
580
578
|
return ret;
|
|
581
579
|
} else if (property === "reset" && typeof propertyKey === "number") {
|
|
@@ -613,7 +611,7 @@ let MeterCCReport = (() => {
|
|
|
613
611
|
this.value = options.value;
|
|
614
612
|
this.previousValue = options.previousValue;
|
|
615
613
|
this.rateType = options.rateType ?? import_Types.RateType.Unspecified;
|
|
616
|
-
this.deltaTime = options.deltaTime ??
|
|
614
|
+
this.deltaTime = options.deltaTime ?? import_core.UNKNOWN_STATE;
|
|
617
615
|
}
|
|
618
616
|
static from(raw, ctx) {
|
|
619
617
|
const { type, rateType, scale1, value, bytesRead } = parseMeterValueAndInfo(raw.payload, 0);
|
|
@@ -625,16 +623,16 @@ let MeterCCReport = (() => {
|
|
|
625
623
|
deltaTime = raw.payload.readUInt16BE(offset);
|
|
626
624
|
offset += 2;
|
|
627
625
|
if (deltaTime === 65535) {
|
|
628
|
-
deltaTime =
|
|
626
|
+
deltaTime = import_core.UNKNOWN_STATE;
|
|
629
627
|
}
|
|
630
628
|
if (
|
|
631
629
|
// Previous value is included only if delta time is not 0
|
|
632
630
|
deltaTime !== 0 && raw.payload.length >= offset + floatSize
|
|
633
631
|
) {
|
|
634
|
-
const { value: prevValue } = (0,
|
|
632
|
+
const { value: prevValue } = (0, import_core.parseFloatWithScale)(
|
|
635
633
|
// This float is split in the payload
|
|
636
|
-
|
|
637
|
-
|
|
634
|
+
import_shared.Bytes.concat([
|
|
635
|
+
import_shared.Bytes.from([raw.payload[1]]),
|
|
638
636
|
raw.payload.subarray(offset)
|
|
639
637
|
])
|
|
640
638
|
);
|
|
@@ -663,20 +661,20 @@ let MeterCCReport = (() => {
|
|
|
663
661
|
const scale = (0, import_core.getMeterScale)(this.type, this.scale) ?? (0, import_core.getUnknownMeterScale)(this.scale);
|
|
664
662
|
const measurementValidation = !ctx.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;
|
|
665
663
|
if (measurementValidation) {
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
import_core.validatePayload.withReason(`Unknown meter type ${(0, import_shared.num2hex)(this.type)} or corrupted data`)(!!meter);
|
|
665
|
+
import_core.validatePayload.withReason(`Unknown meter scale ${(0, import_shared.num2hex)(this.scale)} or corrupted data`)(scale.label !== (0, import_core.getUnknownMeterScale)(this.scale).label);
|
|
668
666
|
if (ccVersion >= 2) {
|
|
669
667
|
const expectedType = this.getValue(ctx, import_CCValues_generated.MeterCCValues.type);
|
|
670
668
|
if (expectedType != void 0) {
|
|
671
|
-
|
|
669
|
+
import_core.validatePayload.withReason("Unexpected meter type or corrupted data")(this.type === expectedType);
|
|
672
670
|
}
|
|
673
671
|
const supportedScales = this.getValue(ctx, import_CCValues_generated.MeterCCValues.supportedScales);
|
|
674
672
|
if (supportedScales?.length) {
|
|
675
|
-
|
|
673
|
+
import_core.validatePayload.withReason(`Unsupported meter scale ${scale.label} or corrupted data`)(supportedScales.includes(this.scale));
|
|
676
674
|
}
|
|
677
675
|
const supportedRateTypes = this.getValue(ctx, import_CCValues_generated.MeterCCValues.supportedRateTypes);
|
|
678
676
|
if (supportedRateTypes?.length) {
|
|
679
|
-
|
|
677
|
+
import_core.validatePayload.withReason(`Unsupported rate type ${(0, import_shared.getEnumMemberName)(import_Types.RateType, this.rateType)} or corrupted data`)(supportedRateTypes.includes(this.rateType));
|
|
680
678
|
}
|
|
681
679
|
}
|
|
682
680
|
}
|
|
@@ -703,9 +701,9 @@ let MeterCCReport = (() => {
|
|
|
703
701
|
serialize(ctx) {
|
|
704
702
|
const { data: typeAndValue, floatParams, scale2 } = encodeMeterValueAndInfo(this.type, this.rateType, this.scale, this.value);
|
|
705
703
|
const deltaTime = this.deltaTime ?? 65535;
|
|
706
|
-
const deltaTimeBytes = new
|
|
704
|
+
const deltaTimeBytes = new import_shared.Bytes(2);
|
|
707
705
|
deltaTimeBytes.writeUInt16BE(deltaTime, 0);
|
|
708
|
-
this.payload =
|
|
706
|
+
this.payload = import_shared.Bytes.concat([
|
|
709
707
|
typeAndValue,
|
|
710
708
|
deltaTimeBytes
|
|
711
709
|
]);
|
|
@@ -716,15 +714,15 @@ let MeterCCReport = (() => {
|
|
|
716
714
|
// we discard the scale anyways
|
|
717
715
|
floatParams
|
|
718
716
|
).subarray(1);
|
|
719
|
-
this.payload =
|
|
717
|
+
this.payload = import_shared.Bytes.concat([
|
|
720
718
|
this.payload,
|
|
721
719
|
prevValueBytes
|
|
722
720
|
]);
|
|
723
721
|
}
|
|
724
722
|
if (scale2 != void 0) {
|
|
725
|
-
this.payload =
|
|
723
|
+
this.payload = import_shared.Bytes.concat([
|
|
726
724
|
this.payload,
|
|
727
|
-
|
|
725
|
+
import_shared.Bytes.from([scale2])
|
|
728
726
|
]);
|
|
729
727
|
}
|
|
730
728
|
return super.serialize(ctx);
|
|
@@ -734,10 +732,10 @@ let MeterCCReport = (() => {
|
|
|
734
732
|
const message = {
|
|
735
733
|
"meter type": (0, import_core.getMeterName)(this.type),
|
|
736
734
|
scale: scale.label,
|
|
737
|
-
"rate type": (0,
|
|
735
|
+
"rate type": (0, import_shared.getEnumMemberName)(import_Types.RateType, this.rateType),
|
|
738
736
|
value: this.value
|
|
739
737
|
};
|
|
740
|
-
if (this.deltaTime !==
|
|
738
|
+
if (this.deltaTime !== import_core.UNKNOWN_STATE) {
|
|
741
739
|
message["time delta"] = `${this.deltaTime} seconds`;
|
|
742
740
|
}
|
|
743
741
|
if (this.previousValue != void 0) {
|
|
@@ -787,7 +785,7 @@ let MeterCCGet = (() => {
|
|
|
787
785
|
rateType = (raw.payload[0] & 192) >>> 6;
|
|
788
786
|
scale = (raw.payload[0] & 56) >>> 3;
|
|
789
787
|
if (scale === 7) {
|
|
790
|
-
(0,
|
|
788
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
791
789
|
scale += raw.payload[1];
|
|
792
790
|
}
|
|
793
791
|
}
|
|
@@ -824,7 +822,7 @@ let MeterCCGet = (() => {
|
|
|
824
822
|
rateTypeFlags = this.rateType & 3;
|
|
825
823
|
bufferLength = Math.max(bufferLength, 1);
|
|
826
824
|
}
|
|
827
|
-
this.payload =
|
|
825
|
+
this.payload = import_shared.Bytes.alloc(bufferLength, 0);
|
|
828
826
|
this.payload[0] = rateTypeFlags << 6 | scale1 << 3;
|
|
829
827
|
if (scale2)
|
|
830
828
|
this.payload[1] = scale2;
|
|
@@ -833,7 +831,7 @@ let MeterCCGet = (() => {
|
|
|
833
831
|
toLogEntry(ctx) {
|
|
834
832
|
const message = {};
|
|
835
833
|
if (this.rateType != void 0) {
|
|
836
|
-
message["rate type"] = (0,
|
|
834
|
+
message["rate type"] = (0, import_shared.getEnumMemberName)(import_Types.RateType, this.rateType);
|
|
837
835
|
}
|
|
838
836
|
if (this.scale != void 0) {
|
|
839
837
|
if (ctx) {
|
|
@@ -881,23 +879,23 @@ let MeterCCSupportedReport = (() => {
|
|
|
881
879
|
this.supportedRateTypes = options.supportedRateTypes;
|
|
882
880
|
}
|
|
883
881
|
static from(raw, ctx) {
|
|
884
|
-
(0,
|
|
882
|
+
(0, import_core.validatePayload)(raw.payload.length >= 2);
|
|
885
883
|
const type = raw.payload[0] & 31;
|
|
886
884
|
const supportsReset = !!(raw.payload[0] & 128);
|
|
887
885
|
const hasMoreScales = !!(raw.payload[1] & 128);
|
|
888
886
|
let supportedScales;
|
|
889
887
|
if (hasMoreScales) {
|
|
890
|
-
(0,
|
|
888
|
+
(0, import_core.validatePayload)(raw.payload.length >= 3);
|
|
891
889
|
const extraBytes = raw.payload[2];
|
|
892
|
-
(0,
|
|
893
|
-
supportedScales = (0,
|
|
894
|
-
|
|
890
|
+
(0, import_core.validatePayload)(raw.payload.length >= 3 + extraBytes);
|
|
891
|
+
supportedScales = (0, import_core.parseBitMask)(import_shared.Bytes.concat([
|
|
892
|
+
import_shared.Bytes.from([raw.payload[1] & 127]),
|
|
895
893
|
raw.payload.subarray(3, 3 + extraBytes)
|
|
896
894
|
]), 0).map((scale) => scale >= 8 ? scale - 1 : scale);
|
|
897
895
|
} else {
|
|
898
|
-
supportedScales = (0,
|
|
896
|
+
supportedScales = (0, import_core.parseBitMask)(import_shared.Bytes.from([raw.payload[1]]), 0);
|
|
899
897
|
}
|
|
900
|
-
const supportedRateTypes = (0,
|
|
898
|
+
const supportedRateTypes = (0, import_core.parseBitMask)(import_shared.Bytes.from([(raw.payload[0] & 96) >>> 5]), 1);
|
|
901
899
|
return new this({
|
|
902
900
|
nodeId: ctx.sourceNodeId,
|
|
903
901
|
type,
|
|
@@ -944,15 +942,15 @@ let MeterCCSupportedReport = (() => {
|
|
|
944
942
|
-1
|
|
945
943
|
);
|
|
946
944
|
const scalesByte1 = supportedScales[0] >>> 1 | (supportedScales.length > 1 ? 128 : 0);
|
|
947
|
-
this.payload =
|
|
945
|
+
this.payload = import_shared.Bytes.from([
|
|
948
946
|
typeByte,
|
|
949
947
|
scalesByte1
|
|
950
948
|
]);
|
|
951
949
|
if (supportedScales.length > 1) {
|
|
952
|
-
this.payload =
|
|
950
|
+
this.payload = import_shared.Bytes.concat([
|
|
953
951
|
this.payload,
|
|
954
|
-
|
|
955
|
-
|
|
952
|
+
import_shared.Bytes.from([supportedScales.length - 1]),
|
|
953
|
+
import_shared.Bytes.from(supportedScales.subarray(1))
|
|
956
954
|
]);
|
|
957
955
|
}
|
|
958
956
|
return super.serialize(ctx);
|
|
@@ -963,7 +961,7 @@ let MeterCCSupportedReport = (() => {
|
|
|
963
961
|
"supports reset": this.supportsReset,
|
|
964
962
|
"supported scales": `${this.supportedScales.map((scale) => `
|
|
965
963
|
\xB7 ${((0, import_core.getMeterScale)(this.type, scale) ?? (0, import_core.getUnknownMeterScale)(scale)).label}`).join("")}`,
|
|
966
|
-
"supported rate types": this.supportedRateTypes.map((rt) => (0,
|
|
964
|
+
"supported rate types": this.supportedRateTypes.map((rt) => (0, import_shared.getEnumMemberName)(import_Types.RateType, rt)).join(", ")
|
|
967
965
|
};
|
|
968
966
|
return {
|
|
969
967
|
...super.toLogEntry(ctx),
|
|
@@ -1048,9 +1046,9 @@ let MeterCCReset = (() => {
|
|
|
1048
1046
|
const { data: typeAndValue, scale2 } = encodeMeterValueAndInfo(this.type, this.rateType, this.scale, this.targetValue);
|
|
1049
1047
|
this.payload = typeAndValue;
|
|
1050
1048
|
if (scale2 != void 0) {
|
|
1051
|
-
this.payload =
|
|
1049
|
+
this.payload = import_shared.Bytes.concat([
|
|
1052
1050
|
this.payload,
|
|
1053
|
-
|
|
1051
|
+
import_shared.Bytes.from([scale2])
|
|
1054
1052
|
]);
|
|
1055
1053
|
}
|
|
1056
1054
|
}
|
|
@@ -1062,7 +1060,7 @@ let MeterCCReset = (() => {
|
|
|
1062
1060
|
message.type = (0, import_core.getMeterName)(this.type);
|
|
1063
1061
|
}
|
|
1064
1062
|
if (this.rateType != void 0) {
|
|
1065
|
-
message["rate type"] = (0,
|
|
1063
|
+
message["rate type"] = (0, import_shared.getEnumMemberName)(import_Types.RateType, this.rateType);
|
|
1066
1064
|
}
|
|
1067
1065
|
if (this.type != void 0 && this.scale != void 0) {
|
|
1068
1066
|
message.scale = ((0, import_core.getMeterScale)(this.type, this.scale) ?? (0, import_core.getUnknownMeterScale)(this.scale)).label;
|