@zwave-js/cc 15.15.3 → 15.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +1 -1
- package/build/cjs/cc/AlarmSensorCC.js.map +1 -1
- package/build/cjs/cc/ApplicationStatusCC.d.ts +33 -0
- package/build/cjs/cc/ApplicationStatusCC.js +229 -0
- package/build/cjs/cc/ApplicationStatusCC.js.map +7 -0
- package/build/cjs/cc/AssociationCC.js.map +1 -1
- package/build/cjs/cc/AssociationGroupInfoCC.js +4 -4
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.js +9 -2
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.js +1 -1
- package/build/cjs/cc/BasicCC.js.map +1 -1
- package/build/cjs/cc/BatteryCC.js +6 -2
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.js +1 -1
- package/build/cjs/cc/BinarySwitchCC.js.map +1 -1
- package/build/cjs/cc/CRC16CC.js +2 -2
- package/build/cjs/cc/CRC16CC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.js +2 -2
- package/build/cjs/cc/CentralSceneCC.js.map +1 -1
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -5
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.js +1 -1
- package/build/cjs/cc/ClockCC.js.map +1 -1
- package/build/cjs/cc/ColorSwitchCC.js.map +1 -1
- package/build/cjs/cc/ConfigurationCC.d.ts +6 -0
- package/build/cjs/cc/ConfigurationCC.js +52 -4
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.js +3 -3
- package/build/cjs/cc/DoorLockCC.js.map +1 -1
- package/build/cjs/cc/EntryControlCC.d.ts +2 -2
- package/build/cjs/cc/EntryControlCC.js +3 -3
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.js +5 -5
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.js +3 -3
- package/build/cjs/cc/IrrigationCC.js.map +1 -1
- package/build/cjs/cc/LanguageCC.js +1 -1
- package/build/cjs/cc/LanguageCC.js.map +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/cjs/cc/ManufacturerProprietaryCC.js +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +1 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cjs/cc/MeterCC.js +3 -3
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.js +8 -8
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cjs/cc/MultilevelSwitchCC.js +1 -1
- package/build/cjs/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +3 -3
- package/build/cjs/cc/NotificationCC.js +29 -23
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.js +10 -3
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.js +1 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cjs/cc/Security2CC.d.ts +14 -14
- package/build/cjs/cc/Security2CC.js +6 -5
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.d.ts +10 -10
- package/build/cjs/cc/SecurityCC.js +3 -3
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.js +2 -2
- package/build/cjs/cc/SoundSwitchCC.js.map +1 -1
- package/build/cjs/cc/SupervisionCC.js +1 -1
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.js +1 -1
- package/build/cjs/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cjs/cc/ThermostatFanStateCC.js +1 -1
- package/build/cjs/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js +2 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.js +1 -1
- package/build/cjs/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cjs/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cjs/cc/TimeCC.js +2 -2
- package/build/cjs/cc/TimeCC.js.map +1 -1
- package/build/cjs/cc/TransportServiceCC.d.ts +7 -7
- package/build/cjs/cc/TransportServiceCC.js +1 -1
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +14 -6
- package/build/cjs/cc/UserCodeCC.js +16 -4
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.js +3 -3
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.js +2 -2
- package/build/cjs/cc/WakeUpCC.js.map +1 -1
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -1
- package/build/cjs/cc/WindowCoveringCC.js +28 -8
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +1 -1
- package/build/cjs/cc/ZWavePlusCC.js.map +1 -1
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/cc/index.d.ts +3 -0
- package/build/cjs/cc/index.js +8 -0
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/cjs/lib/API.d.ts +2 -0
- package/build/cjs/lib/API.js +2 -2
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +7 -7
- package/build/cjs/lib/CommandClass.js +6 -6
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/NotificationEventPayload.d.ts +2 -1
- package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +12 -12
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +11 -1
- package/build/cjs/lib/_Types.js +15 -0
- package/build/cjs/lib/_Types.js.map +3 -3
- package/build/cjs/lib/serializers.d.ts +4 -4
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +5 -0
- package/build/cjs/lib/utils.js +1 -1
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.js +1 -1
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts +33 -0
- package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -0
- package/build/esm/cc/ApplicationStatusCC.js +175 -0
- package/build/esm/cc/ApplicationStatusCC.js.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +4 -4
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +13 -2
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.js +1 -1
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +5 -2
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +1 -1
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- 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.js +2 -2
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +5 -5
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +1 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +6 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +65 -5
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.js +3 -3
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +2 -2
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +3 -3
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +6 -6
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -3
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.js +1 -1
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -3
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +8 -8
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +3 -3
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +43 -31
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +16 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +14 -14
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +7 -6
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +10 -10
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +4 -4
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -2
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +1 -1
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +1 -1
- 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 +3 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +2 -2
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +7 -7
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -1
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +14 -6
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +20 -4
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +4 -4
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -2
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +30 -9
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +1 -1
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/index.d.ts +3 -0
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js +5 -0
- package/build/esm/cc/index.js.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 +2 -0
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js +2 -2
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +7 -7
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +6 -6
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/NotificationEventPayload.d.ts +2 -1
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
- package/build/esm/lib/NotificationEventPayload.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +12 -12
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +11 -1
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +11 -0
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +4 -4
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +5 -0
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.js +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +12 -13
- package/build/cjs/lib/ICommandClassContainer.d.ts +0 -2
- package/build/cjs/lib/ICommandClassContainer.js +0 -17
- package/build/cjs/lib/ICommandClassContainer.js.map +0 -7
- package/build/esm/lib/ICommandClassContainer.d.ts +0 -2
- package/build/esm/lib/ICommandClassContainer.d.ts.map +0 -1
- package/build/esm/lib/ICommandClassContainer.js +0 -2
- package/build/esm/lib/ICommandClassContainer.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/IrrigationCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeFloatWithScale,\n\tenumValuesToMetadataStates,\n\tparseFloatWithScale,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport { irrigationValveIdToMetadataPrefix } from \"../lib/CCValueUtils.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\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 {\n\tIrrigationCommand,\n\tIrrigationSensorPolarity,\n\ttype ValveId,\n\ttype ValveTableEntry,\n\tValveType,\n} from \"../lib/_Types.js\";\n\nexport const IrrigationCCValues = V.defineCCValues(CommandClasses.Irrigation, {\n\t...V.staticProperty(\"numValves\", undefined, { internal: true }),\n\t...V.staticProperty(\"numValveTables\", undefined, { internal: true }),\n\t...V.staticProperty(\"supportsMasterValve\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"maxValveTableSize\", undefined, { internal: true }),\n\t...V.staticProperty(\n\t\t\"systemVoltage\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"System voltage\",\n\t\t\tunit: \"V\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"masterValveDelay\",\n\t\t{\n\t\t\t...ValueMetadata.UInt8,\n\t\t\tlabel: \"Master valve delay\",\n\t\t\tdescription:\n\t\t\t\t\"The delay between turning on the master valve and turning on any zone valve\",\n\t\t\tunit: \"seconds\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"flowSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Flow sensor active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"pressureSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Pressure sensor active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"rainSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Rain sensor attached and active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"rainSensorPolarity\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Rain sensor polarity\",\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstates: enumValuesToMetadataStates(IrrigationSensorPolarity),\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"moistureSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Moisture sensor attached and active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"moistureSensorPolarity\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Moisture sensor polarity\",\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstates: enumValuesToMetadataStates(IrrigationSensorPolarity),\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"flow\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"Flow\",\n\t\t\tunit: \"l/h\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"pressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"Pressure\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"shutoffDuration\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"Remaining shutoff duration\",\n\t\t\tunit: \"hours\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorNotProgrammed\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: device not programmed\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorEmergencyShutdown\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: emergency shutdown\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorHighPressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: high pressure\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"highPressureThreshold\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"High pressure threshold\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorLowPressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: low pressure\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"lowPressureThreshold\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Low pressure threshold\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorValve\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: valve reporting error\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"masterValveOpen\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Master valve is open\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"firstOpenZoneId\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"First open zone valve ID\",\n\t\t} as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"shutoffSystem\",\n\t\t\"shutoff\",\n\t\t{\n\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\tlabel: `Shutoff system`,\n\t\t\tstates: {\n\t\t\t\ttrue: \"Shutoff\",\n\t\t\t},\n\t\t} as const,\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveConnected\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"valveConnected\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"valveConnected\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${irrigationValveIdToMetadataPrefix(valveId)}: Connected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current`,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrentHighThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrentHighThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrentHighThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current - high threshold`,\n\t\t\tmin: 0,\n\t\t\tmax: 2550,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrentLowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrentLowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrentLowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current - low threshold`,\n\t\t\tmin: 0,\n\t\t\tmax: 2550,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorShortCircuit\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorShortCircuit\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorShortCircuit\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Short circuit detected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorHighCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorHighCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorHighCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Current above high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorLowCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorLowCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorLowCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Current below low threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"maximumFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"maximumFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"maximumFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(valveId)\n\t\t\t}: Maximum flow`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorMaximumFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorMaximumFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorMaximumFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Maximum flow detected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"highFlowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"highFlowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"highFlowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: High flow threshold`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorHighFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorHighFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorHighFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Flow above high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"lowFlowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"lowFlowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"lowFlowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Low flow threshold`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorLowFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorLowFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorLowFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Flow below high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"useRainSensor\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"useRainSensor\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"useRainSensor\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Use rain sensor`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"useMoistureSensor\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"useMoistureSensor\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"useMoistureSensor\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Use moisture sensor`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveRunDuration\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"duration\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"duration\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.UInt16,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(valveId)\n\t\t\t}: Run duration`,\n\t\t\tmin: 1,\n\t\t\tunit: \"s\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveRunStartStop\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"startStop\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"startStop\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${irrigationValveIdToMetadataPrefix(valveId)}: Start/Stop`,\n\t\t\tstates: {\n\t\t\t\ttrue: \"Start\",\n\t\t\t\tfalse: \"Stop\",\n\t\t\t},\n\t\t} as const),\n\t),\n});\n\nconst systemConfigProperties = [\n\t\"masterValveDelay\",\n\t\"highPressureThreshold\",\n\t\"lowPressureThreshold\",\n\t\"rainSensorPolarity\",\n\t\"moistureSensorPolarity\",\n] as const;\n\nconst valveConfigPropertyKeys = [\n\t\"nominalCurrentHighThreshold\",\n\t\"nominalCurrentLowThreshold\",\n\t\"maximumFlow\",\n\t\"highFlowThreshold\",\n\t\"lowFlowThreshold\",\n\t\"useRainSensor\",\n\t\"useMoistureSensor\",\n] as const;\n\n@API(CommandClasses.Irrigation)\nexport class IrrigationCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: IrrigationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase IrrigationCommand.SystemInfoGet:\n\t\t\tcase IrrigationCommand.SystemStatusGet:\n\t\t\tcase IrrigationCommand.SystemConfigSet:\n\t\t\tcase IrrigationCommand.SystemConfigGet:\n\t\t\tcase IrrigationCommand.ValveInfoGet:\n\t\t\tcase IrrigationCommand.ValveConfigSet:\n\t\t\tcase IrrigationCommand.ValveConfigGet:\n\t\t\tcase IrrigationCommand.ValveRun:\n\t\t\tcase IrrigationCommand.ValveTableSet:\n\t\t\tcase IrrigationCommand.ValveTableGet:\n\t\t\tcase IrrigationCommand.ValveTableRun:\n\t\t\tcase IrrigationCommand.SystemShutoff:\n\t\t\t\t// These are all mandatory in V1\n\t\t\t\treturn true;\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 getSystemInfo() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemInfoGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemInfoGet({\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\tIrrigationCCSystemInfoReport\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\"numValves\",\n\t\t\t\t\"numValveTables\",\n\t\t\t\t\"supportsMasterValve\",\n\t\t\t\t\"maxValveTableSize\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSystemStatus() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemStatusGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemStatusGet({\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\tIrrigationCCSystemStatusReport\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\"systemVoltage\",\n\t\t\t\t\"flowSensorActive\",\n\t\t\t\t\"pressureSensorActive\",\n\t\t\t\t\"rainSensorActive\",\n\t\t\t\t\"moistureSensorActive\",\n\t\t\t\t\"flow\",\n\t\t\t\t\"pressure\",\n\t\t\t\t\"shutoffDuration\",\n\t\t\t\t\"errorNotProgrammed\",\n\t\t\t\t\"errorEmergencyShutdown\",\n\t\t\t\t\"errorHighPressure\",\n\t\t\t\t\"errorLowPressure\",\n\t\t\t\t\"errorValve\",\n\t\t\t\t\"masterValveOpen\",\n\t\t\t\t\"firstOpenZoneId\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSystemConfig() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemConfigGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemConfigGet({\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\tIrrigationCCSystemConfigReport\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\"masterValveDelay\",\n\t\t\t\t\"highPressureThreshold\",\n\t\t\t\t\"lowPressureThreshold\",\n\t\t\t\t\"rainSensorPolarity\",\n\t\t\t\t\"moistureSensorPolarity\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async setSystemConfig(\n\t\tconfig: IrrigationCCSystemConfigSetOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemConfigSet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemConfigSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...config,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getValveInfo(valveId: ValveId) {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveInfoGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveInfoGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveInfoReport\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\"connected\",\n\t\t\t\t\"nominalCurrent\",\n\t\t\t\t\"errorShortCircuit\",\n\t\t\t\t\"errorHighCurrent\",\n\t\t\t\t\"errorLowCurrent\",\n\t\t\t\t\"errorMaximumFlow\",\n\t\t\t\t\"errorHighFlow\",\n\t\t\t\t\"errorLowFlow\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setValveConfig(\n\t\toptions: IrrigationCCValveConfigSetOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveConfigSet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveConfigSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getValveConfig(valveId: ValveId) {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveConfigGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveConfigGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveConfigReport\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\"nominalCurrentHighThreshold\",\n\t\t\t\t\"nominalCurrentLowThreshold\",\n\t\t\t\t\"maximumFlow\",\n\t\t\t\t\"highFlowThreshold\",\n\t\t\t\t\"lowFlowThreshold\",\n\t\t\t\t\"useRainSensor\",\n\t\t\t\t\"useMoistureSensor\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async runValve(\n\t\tvalveId: ValveId,\n\t\tduration: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveRun,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveRun({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic shutoffValve(\n\t\tvalveId: ValveId,\n\t): Promise<SupervisionResult | undefined> {\n\t\treturn this.runValve(valveId, 0);\n\t}\n\n\t@validateArgs()\n\tpublic async setValveTable(\n\t\ttableId: number,\n\t\tentries: ValveTableEntry[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableSet,\n\t\t);\n\n\t\tif (!this.endpoint.virtual) {\n\t\t\tconst maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\t\t\tif (\n\t\t\t\tmaxValveTableSize != undefined\n\t\t\t\t&& entries.length > maxValveTableSize\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The number of valve table entries must not exceed ${maxValveTableSize}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new IrrigationCCValveTableSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableId,\n\t\t\tentries,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async getValveTable(\n\t\ttableId: number,\n\t): Promise<MaybeNotKnown<ValveTableEntry[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveTableGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveTableReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn response?.entries;\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async runTables(\n\t\ttableIDs: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableRun,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveTableRun({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableIDs,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Shuts off the entire system for the given duration.\n\t * @param duration Shutoff duration in hours. A value of 255 will shut off the entire system permanently and prevents schedules from running.\n\t */\n\t@validateArgs()\n\tpublic async shutoffSystem(\n\t\tduration: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemShutoff,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemShutoff({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/** Shuts off the entire system permanently and prevents schedules from running */\n\tpublic shutoffSystemPermanently(): Promise<SupervisionResult | undefined> {\n\t\treturn this.shutoffSystem(255);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: IrrigationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tconst valueDB = this.getValueDB();\n\n\t\t\tif (systemConfigProperties.includes(property as any)) {\n\t\t\t\tconst options = {} as IrrigationCCSystemConfigSetOptions;\n\t\t\t\tfor (const prop of systemConfigProperties) {\n\t\t\t\t\tif (prop === property) continue;\n\t\t\t\t\tconst valueId: ValueID = {\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty: prop as any,\n\t\t\t\t\t};\n\t\t\t\t\tconst cachedVal = valueDB.getValue<any>(valueId);\n\t\t\t\t\tif (cachedVal == undefined) {\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`The \"${property}\" property cannot be changed before ${prop} is known!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\toptions[prop] = cachedVal;\n\t\t\t\t}\n\t\t\t\toptions[property as keyof IrrigationCCSystemConfigSetOptions] =\n\t\t\t\t\tvalue as any;\n\n\t\t\t\treturn this.setSystemConfig(options);\n\t\t\t} else if (property === \"shutoff\") {\n\t\t\t\treturn this.shutoffSystem(0);\n\t\t\t} else if (\n\t\t\t\tproperty === \"master\"\n\t\t\t\t|| (typeof property === \"number\" && property >= 1)\n\t\t\t) {\n\t\t\t\t// This is a value of a valve\n\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t}\n\n\t\t\t\tif (valveConfigPropertyKeys.includes(propertyKey as any)) {\n\t\t\t\t\tconst options = {\n\t\t\t\t\t\tvalveId: property,\n\t\t\t\t\t} as IrrigationCCValveConfigSetOptions;\n\n\t\t\t\t\tfor (const prop of valveConfigPropertyKeys) {\n\t\t\t\t\t\tif (prop === propertyKey) continue;\n\t\t\t\t\t\tconst valueId: ValueID = {\n\t\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey: prop as any,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst cachedVal = valueDB.getValue<any>(valueId);\n\t\t\t\t\t\tif (cachedVal == undefined) {\n\t\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t\t`The \"${property}_${propertyKey}\" property cannot be changed before ${property}_${prop} is known!`,\n\t\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t(options as any)[prop] = cachedVal;\n\t\t\t\t\t}\n\t\t\t\t\t(options as any)[propertyKey] = value;\n\n\t\t\t\t\treturn this.setValveConfig(options);\n\t\t\t\t} else if (propertyKey === \"duration\") {\n\t\t\t\t\t// The run duration needs to be set separately from triggering the run\n\t\t\t\t\t// So this is okay\n\t\t\t\t\treturn;\n\t\t\t\t} else if (propertyKey === \"startStop\") {\n\t\t\t\t\t// Trigger or stop a valve run, depending on the value\n\t\t\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\t// Start a valve run\n\t\t\t\t\t\tconst duration = valueDB.getValue<number>(\n\t\t\t\t\t\t\tIrrigationCCValues.valveRunDuration(\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (duration == undefined) {\n\t\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t\t`Cannot start a valve run without specifying a duration first!`,\n\t\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn this.runValve(property, duration);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Stop a valve run\n\t\t\t\t\t\treturn this.shutoffValve(property);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: IrrigationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"systemVoltage\":\n\t\t\t\tcase \"flowSensorActive\":\n\t\t\t\tcase \"pressureSensorActive\":\n\t\t\t\tcase \"rainSensorActive\":\n\t\t\t\tcase \"moistureSensorActive\":\n\t\t\t\tcase \"flow\":\n\t\t\t\tcase \"pressure\":\n\t\t\t\tcase \"shutoffDuration\":\n\t\t\t\tcase \"errorNotProgrammed\":\n\t\t\t\tcase \"errorEmergencyShutdown\":\n\t\t\t\tcase \"errorHighPressure\":\n\t\t\t\tcase \"errorLowPressure\":\n\t\t\t\tcase \"errorValve\":\n\t\t\t\tcase \"masterValveOpen\":\n\t\t\t\tcase \"firstOpenZoneId\":\n\t\t\t\t\treturn (await this.getSystemStatus())?.[property];\n\n\t\t\t\tcase \"masterValveDelay\":\n\t\t\t\tcase \"highPressureThreshold\":\n\t\t\t\tcase \"lowPressureThreshold\":\n\t\t\t\tcase \"rainSensorPolarity\":\n\t\t\t\tcase \"moistureSensorPolarity\":\n\t\t\t\t\treturn (await this.getSystemConfig())?.[property];\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tproperty === \"master\"\n\t\t\t\t|| (typeof property === \"number\" && property >= 1)\n\t\t\t) {\n\t\t\t\t// This is a value of a valve\n\t\t\t\tswitch (propertyKey) {\n\t\t\t\t\tcase \"connected\":\n\t\t\t\t\tcase \"nominalCurrent\":\n\t\t\t\t\tcase \"errorShortCircuit\":\n\t\t\t\t\tcase \"errorHighCurrent\":\n\t\t\t\t\tcase \"errorLowCurrent\":\n\t\t\t\t\tcase \"errorMaximumFlow\":\n\t\t\t\t\tcase \"errorHighFlow\":\n\t\t\t\t\tcase \"errorLowFlow\":\n\t\t\t\t\t\treturn (await this.getValveInfo(property))?.[\n\t\t\t\t\t\t\tpropertyKey\n\t\t\t\t\t\t];\n\n\t\t\t\t\tcase \"nominalCurrentHighThreshold\":\n\t\t\t\t\tcase \"nominalCurrentLowThreshold\":\n\t\t\t\t\tcase \"maximumFlow\":\n\t\t\t\t\tcase \"highFlowThreshold\":\n\t\t\t\t\tcase \"lowFlowThreshold\":\n\t\t\t\t\tcase \"useRainSensor\":\n\t\t\t\t\tcase \"useMoistureSensor\":\n\t\t\t\t\t\treturn (await this.getValveConfig(property))?.[\n\t\t\t\t\t\t\tpropertyKey\n\t\t\t\t\t\t];\n\n\t\t\t\t\tcase undefined:\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n}\n\n@commandClass(CommandClasses.Irrigation)\n@implementedVersion(1)\n@ccValues(IrrigationCCValues)\nexport class IrrigationCC extends CommandClass {\n\tdeclare ccCommand: IrrigationCommand;\n\n\t/**\n\t * Returns the maximum number of valve table entries reported by the node.\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static getMaxValveTableSizeCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<number> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tIrrigationCCValues.maxValveTableSize.endpoint(endpoint.index),\n\t\t\t);\n\t}\n\n\t/**\n\t * Returns the number of zone valves reported by the node.\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static getNumValvesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<number> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(IrrigationCCValues.numValves.endpoint(endpoint.index));\n\t}\n\n\t/**\n\t * Returns whether the node supports a master valve\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static supportsMasterValveCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): boolean {\n\t\treturn !!ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tIrrigationCCValues.supportsMasterValve.endpoint(endpoint.index),\n\t\t\t);\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.Irrigation,\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\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system info...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst systemInfo = await api.getSystemInfo();\n\t\tif (!systemInfo) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Time out while querying irrigation system info, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst logMessage = `received irrigation system info:\nsupports master valve: ${systemInfo.supportsMasterValve}\nno. of valves: ${systemInfo.numValves}\nno. of valve tables: ${systemInfo.numValveTables}\nmax. valve table size: ${systemInfo.maxValveTableSize}`;\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: logMessage,\n\t\t\tdirection: \"inbound\",\n\t\t});\n\n\t\t// For each valve, create the values to start/stop a run\n\t\tfor (let i = 1; i <= systemInfo.numValves; i++) {\n\t\t\tthis.ensureMetadata(\n\t\t\t\tctx,\n\t\t\t\tIrrigationCCValues.valveRunDuration(i),\n\t\t\t);\n\t\t\tthis.ensureMetadata(\n\t\t\t\tctx,\n\t\t\t\tIrrigationCCValues.valveRunStartStop(i),\n\t\t\t);\n\t\t}\n\t\t// And create a shutoff value\n\t\tthis.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);\n\n\t\t// Query current values\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.Irrigation,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\t// Query the current system config\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system configuration...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst systemConfig = await api.getSystemConfig();\n\t\tif (systemConfig) {\n\t\t\tlet logMessage = `received irrigation system configuration:\nmaster valve delay: ${systemConfig.masterValveDelay} seconds\nhigh pressure threshold: ${systemConfig.highPressureThreshold} kPa\nlow pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;\n\t\t\tif (systemConfig.rainSensorPolarity != undefined) {\n\t\t\t\tlogMessage += `\nrain sensor polarity: ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\t\t\tsystemConfig.rainSensorPolarity,\n\t\t\t\t\t)\n\t\t\t\t}`;\n\t\t\t}\n\t\t\tif (systemConfig.moistureSensorPolarity != undefined) {\n\t\t\t\tlogMessage += `\nmoisture sensor polarity: ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\t\t\tsystemConfig.moistureSensorPolarity,\n\t\t\t\t\t)\n\t\t\t\t}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\t// and status\n\t\t// Query the current system config\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system status...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tawait api.getSystemStatus();\n\n\t\t// for each valve, query the current status and configuration\n\t\tif (IrrigationCC.supportsMasterValveCached(ctx, endpoint)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Querying master valve configuration...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveConfig(\"master\");\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Querying master valve status...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveInfo(\"master\");\n\t\t}\n\n\t\tfor (\n\t\t\tlet i = 1;\n\t\t\ti <= (IrrigationCC.getNumValvesCached(ctx, endpoint) ?? 0);\n\t\t\ti++\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Querying configuration for valve ${\n\t\t\t\t\ti.toString().padStart(\n\t\t\t\t\t\t3,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveConfig(i);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Querying status for valve ${\n\t\t\t\t\ti.toString().padStart(\n\t\t\t\t\t\t3,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveInfo(i);\n\t\t}\n\t}\n\n\tpublic translateProperty(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey?: string | number,\n\t): string {\n\t\tif (property === \"master\") {\n\t\t\treturn \"Master valve\";\n\t\t} else if (typeof property === \"number\") {\n\t\t\treturn `Valve ${property.toString().padStart(3, \"0\")}`;\n\t\t}\n\t\treturn super.translateProperty(ctx, property, propertyKey);\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemInfoReportOptions {\n\tsupportsMasterValve: boolean;\n\tnumValves: number;\n\tnumValveTables: number;\n\tmaxValveTableSize: number;\n}\n\n@CCCommand(IrrigationCommand.SystemInfoReport)\n@ccValueProperty(\"numValves\", IrrigationCCValues.numValves)\n@ccValueProperty(\"numValveTables\", IrrigationCCValues.numValveTables)\n@ccValueProperty(\"supportsMasterValve\", IrrigationCCValues.supportsMasterValve)\n@ccValueProperty(\"maxValveTableSize\", IrrigationCCValues.maxValveTableSize)\nexport class IrrigationCCSystemInfoReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportsMasterValve = options.supportsMasterValve;\n\t\tthis.numValves = options.numValves;\n\t\tthis.numValveTables = options.numValveTables;\n\t\tthis.maxValveTableSize = options.maxValveTableSize;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst supportsMasterValve = !!(raw.payload[0] & 0x01);\n\t\tconst numValves = raw.payload[1];\n\t\tconst numValveTables = raw.payload[2];\n\t\tconst maxValveTableSize = raw.payload[3] & 0b1111;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsMasterValve,\n\t\t\tnumValves,\n\t\t\tnumValveTables,\n\t\t\tmaxValveTableSize,\n\t\t});\n\t}\n\n\tpublic readonly numValves: number;\n\n\tpublic readonly numValveTables: number;\n\n\tpublic readonly supportsMasterValve: boolean;\n\n\tpublic readonly maxValveTableSize: number;\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\"supports master valve\": this.supportsMasterValve,\n\t\t\t\t\"no. of valves\": this.numValves,\n\t\t\t\t\"no. of valve tables\": this.numValveTables,\n\t\t\t\t\"max. valve table size\": this.maxValveTableSize,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemInfoGet)\n@expectedCCResponse(IrrigationCCSystemInfoReport)\nexport class IrrigationCCSystemInfoGet extends IrrigationCC {}\n\n// @publicAPI\nexport interface IrrigationCCSystemStatusReportOptions {\n\tsystemVoltage: number;\n\tflowSensorActive: boolean;\n\tpressureSensorActive: boolean;\n\trainSensorActive: boolean;\n\tmoistureSensorActive: boolean;\n\tflow?: number;\n\tpressure?: number;\n\tshutoffDuration: number;\n\terrorNotProgrammed: boolean;\n\terrorEmergencyShutdown: boolean;\n\terrorHighPressure: boolean;\n\terrorLowPressure: boolean;\n\terrorValve: boolean;\n\tmasterValveOpen: boolean;\n\tfirstOpenZoneId?: number;\n}\n\n@CCCommand(IrrigationCommand.SystemStatusReport)\n@ccValueProperty(\"systemVoltage\", IrrigationCCValues.systemVoltage)\n@ccValueProperty(\"flowSensorActive\", IrrigationCCValues.flowSensorActive)\n@ccValueProperty(\n\t\"pressureSensorActive\",\n\tIrrigationCCValues.pressureSensorActive,\n)\n@ccValueProperty(\"rainSensorActive\", IrrigationCCValues.rainSensorActive)\n@ccValueProperty(\n\t\"moistureSensorActive\",\n\tIrrigationCCValues.moistureSensorActive,\n)\n@ccValueProperty(\"flow\", IrrigationCCValues.flow)\n@ccValueProperty(\"pressure\", IrrigationCCValues.pressure)\n@ccValueProperty(\"shutoffDuration\", IrrigationCCValues.shutoffDuration)\n@ccValueProperty(\"errorNotProgrammed\", IrrigationCCValues.errorNotProgrammed)\n@ccValueProperty(\n\t\"errorEmergencyShutdown\",\n\tIrrigationCCValues.errorEmergencyShutdown,\n)\n@ccValueProperty(\"errorHighPressure\", IrrigationCCValues.errorHighPressure)\n@ccValueProperty(\"errorLowPressure\", IrrigationCCValues.errorLowPressure)\n@ccValueProperty(\"errorValve\", IrrigationCCValues.errorValve)\n@ccValueProperty(\"masterValveOpen\", IrrigationCCValues.masterValveOpen)\n@ccValueProperty(\"firstOpenZoneId\", IrrigationCCValues.firstOpenZoneId)\nexport class IrrigationCCSystemStatusReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemStatusReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.systemVoltage = options.systemVoltage;\n\t\tthis.flowSensorActive = options.flowSensorActive;\n\t\tthis.pressureSensorActive = options.pressureSensorActive;\n\t\tthis.rainSensorActive = options.rainSensorActive;\n\t\tthis.moistureSensorActive = options.moistureSensorActive;\n\t\tthis.flow = options.flow;\n\t\tthis.pressure = options.pressure;\n\t\tthis.shutoffDuration = options.shutoffDuration;\n\t\tthis.errorNotProgrammed = options.errorNotProgrammed;\n\t\tthis.errorEmergencyShutdown = options.errorEmergencyShutdown;\n\t\tthis.errorHighPressure = options.errorHighPressure;\n\t\tthis.errorLowPressure = options.errorLowPressure;\n\t\tthis.errorValve = options.errorValve;\n\t\tthis.masterValveOpen = options.masterValveOpen;\n\t\tthis.firstOpenZoneId = options.firstOpenZoneId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemStatusReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst systemVoltage = raw.payload[0];\n\t\tconst flowSensorActive = !!(raw.payload[1] & 0x01);\n\t\tconst pressureSensorActive = !!(raw.payload[1] & 0x02);\n\t\tconst rainSensorActive = !!(raw.payload[1] & 0x04);\n\t\tconst moistureSensorActive = !!(raw.payload[1] & 0x08);\n\t\tlet offset = 2;\n\t\tlet flow: number | undefined;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0);\n\t\t\tif (flowSensorActive) flow = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet pressure: number | undefined;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0);\n\t\t\tif (pressureSensorActive) pressure = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 4);\n\t\tconst shutoffDuration = raw.payload[offset];\n\t\tconst errorNotProgrammed = !!(raw.payload[offset + 1] & 0x01);\n\t\tconst errorEmergencyShutdown = !!(raw.payload[offset + 1] & 0x02);\n\t\tconst errorHighPressure = !!(raw.payload[offset + 1] & 0x04);\n\t\tconst errorLowPressure = !!(raw.payload[offset + 1] & 0x08);\n\t\tconst errorValve = !!(raw.payload[offset + 1] & 0x10);\n\t\tconst masterValveOpen = !!(raw.payload[offset + 2] & 0x01);\n\t\tlet firstOpenZoneId: number | undefined;\n\t\tif (raw.payload[offset + 3]) {\n\t\t\tfirstOpenZoneId = raw.payload[offset + 3];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsystemVoltage,\n\t\t\tflowSensorActive,\n\t\t\tpressureSensorActive,\n\t\t\trainSensorActive,\n\t\t\tmoistureSensorActive,\n\t\t\tflow,\n\t\t\tpressure,\n\t\t\tshutoffDuration,\n\t\t\terrorNotProgrammed,\n\t\t\terrorEmergencyShutdown,\n\t\t\terrorHighPressure,\n\t\t\terrorLowPressure,\n\t\t\terrorValve,\n\t\t\tmasterValveOpen,\n\t\t\tfirstOpenZoneId,\n\t\t});\n\t}\n\n\tpublic systemVoltage: number;\n\n\tpublic flowSensorActive: boolean;\n\n\tpublic pressureSensorActive: boolean;\n\n\tpublic rainSensorActive: boolean;\n\n\tpublic moistureSensorActive: boolean;\n\n\tpublic flow?: number;\n\n\tpublic pressure?: number;\n\n\tpublic shutoffDuration: number;\n\n\tpublic errorNotProgrammed: boolean;\n\n\tpublic errorEmergencyShutdown: boolean;\n\n\tpublic errorHighPressure: boolean;\n\n\tpublic errorLowPressure: boolean;\n\n\tpublic errorValve: boolean;\n\n\tpublic masterValveOpen: boolean;\n\n\tpublic firstOpenZoneId?: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"system voltage\": `${this.systemVoltage} V`,\n\t\t\t\"active sensors\": [\n\t\t\t\tthis.flowSensorActive ? \"flow\" : undefined,\n\t\t\t\tthis.pressureSensorActive ? \"pressure\" : undefined,\n\t\t\t\tthis.rainSensorActive ? \"rain\" : undefined,\n\t\t\t\tthis.moistureSensorActive ? \"moisture\" : undefined,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\", \"),\n\t\t};\n\t\tif (this.flow != undefined) {\n\t\t\tmessage.flow = `${this.flow} l/h`;\n\t\t}\n\t\tif (this.pressure != undefined) {\n\t\t\tmessage.pressure = `${this.pressure} kPa`;\n\t\t}\n\t\tmessage[\"remaining shutoff duration\"] = `${this.shutoffDuration} hours`;\n\t\tmessage[\"master valve status\"] = this.masterValveOpen\n\t\t\t? \"open\"\n\t\t\t: \"closed\";\n\t\tmessage[\"first open zone valve\"] = this.firstOpenZoneId || \"none\";\n\t\tconst errors = [\n\t\t\tthis.errorNotProgrammed ? \"device not programmed\" : undefined,\n\t\t\tthis.errorEmergencyShutdown ? \"emergency shutdown\" : undefined,\n\t\t\tthis.errorHighPressure\n\t\t\t\t? \"high pressure threshold triggered\"\n\t\t\t\t: undefined,\n\t\t\tthis.errorLowPressure\n\t\t\t\t? \"low pressure threshold triggered\"\n\t\t\t\t: undefined,\n\t\t\tthis.errorValve\n\t\t\t\t? \"a valve or the master valve has an error\"\n\t\t\t\t: undefined,\n\t\t].filter(Boolean);\n\t\tif (errors.length > 0) {\n\t\t\tmessage.errors = errors.map((e) => `\\n\u00B7 ${e}`).join(\"\");\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemStatusGet)\n@expectedCCResponse(IrrigationCCSystemStatusReport)\nexport class IrrigationCCSystemStatusGet extends IrrigationCC {}\n\n// @publicAPI\nexport type IrrigationCCSystemConfigSetOptions = {\n\tmasterValveDelay: number;\n\thighPressureThreshold: number;\n\tlowPressureThreshold: number;\n\trainSensorPolarity?: IrrigationSensorPolarity;\n\tmoistureSensorPolarity?: IrrigationSensorPolarity;\n};\n\n@CCCommand(IrrigationCommand.SystemConfigSet)\n@useSupervision()\nexport class IrrigationCCSystemConfigSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemConfigSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.masterValveDelay = options.masterValveDelay;\n\t\tthis.highPressureThreshold = options.highPressureThreshold;\n\t\tthis.lowPressureThreshold = options.lowPressureThreshold;\n\t\tthis.rainSensorPolarity = options.rainSensorPolarity;\n\t\tthis.moistureSensorPolarity = options.moistureSensorPolarity;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCSystemConfigSet {\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 IrrigationCCSystemConfigSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic masterValveDelay: number;\n\tpublic highPressureThreshold: number;\n\tpublic lowPressureThreshold: number;\n\tpublic rainSensorPolarity?: IrrigationSensorPolarity;\n\tpublic moistureSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tlet polarity = 0;\n\t\tif (this.rainSensorPolarity != undefined) polarity |= 0b1;\n\t\tif (this.moistureSensorPolarity != undefined) polarity |= 0b10;\n\t\tif (\n\t\t\tthis.rainSensorPolarity == undefined\n\t\t\t&& this.moistureSensorPolarity == undefined\n\t\t) {\n\t\t\t// Valid bit\n\t\t\tpolarity |= 0b1000_0000;\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.masterValveDelay]),\n\t\t\tencodeFloatWithScale(this.highPressureThreshold, 0 /* kPa */),\n\t\t\tencodeFloatWithScale(this.lowPressureThreshold, 0 /* kPa */),\n\t\t\tBytes.from([polarity]),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"master valve delay\": `${this.masterValveDelay} s`,\n\t\t\t\"high pressure threshold\": `${this.highPressureThreshold} kPa`,\n\t\t\t\"low pressure threshold\": `${this.lowPressureThreshold} kPa`,\n\t\t};\n\t\tif (this.rainSensorPolarity != undefined) {\n\t\t\tmessage[\"rain sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.rainSensorPolarity,\n\t\t\t);\n\t\t}\n\t\tif (this.moistureSensorPolarity != undefined) {\n\t\t\tmessage[\"moisture sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.moistureSensorPolarity,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemConfigReportOptions {\n\tmasterValveDelay: number;\n\thighPressureThreshold: number;\n\tlowPressureThreshold: number;\n\trainSensorPolarity?: IrrigationSensorPolarity;\n\tmoistureSensorPolarity?: IrrigationSensorPolarity;\n}\n\n@CCCommand(IrrigationCommand.SystemConfigReport)\n@ccValueProperty(\"masterValveDelay\", IrrigationCCValues.masterValveDelay)\n@ccValueProperty(\n\t\"highPressureThreshold\",\n\tIrrigationCCValues.highPressureThreshold,\n)\n@ccValueProperty(\n\t\"lowPressureThreshold\",\n\tIrrigationCCValues.lowPressureThreshold,\n)\n@ccValueProperty(\"rainSensorPolarity\", IrrigationCCValues.rainSensorPolarity)\n@ccValueProperty(\n\t\"moistureSensorPolarity\",\n\tIrrigationCCValues.moistureSensorPolarity,\n)\nexport class IrrigationCCSystemConfigReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemConfigReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.masterValveDelay = options.masterValveDelay;\n\t\tthis.highPressureThreshold = options.highPressureThreshold;\n\t\tthis.lowPressureThreshold = options.lowPressureThreshold;\n\t\tthis.rainSensorPolarity = options.rainSensorPolarity;\n\t\tthis.moistureSensorPolarity = options.moistureSensorPolarity;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemConfigReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst masterValveDelay = raw.payload[0];\n\t\tlet offset = 1;\n\t\tlet highPressureThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* kPa */);\n\t\t\thighPressureThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet lowPressureThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* kPa */);\n\t\t\tlowPressureThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 1);\n\t\tconst polarity = raw.payload[offset];\n\t\tlet rainSensorPolarity: IrrigationSensorPolarity | undefined;\n\t\tlet moistureSensorPolarity: IrrigationSensorPolarity | undefined;\n\t\tif (!!(polarity & 0b1000_0000)) {\n\t\t\t// The valid bit is set\n\t\t\trainSensorPolarity = polarity & 0b1;\n\t\t\tmoistureSensorPolarity = (polarity & 0b10) >>> 1;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tmasterValveDelay,\n\t\t\thighPressureThreshold,\n\t\t\tlowPressureThreshold,\n\t\t\trainSensorPolarity,\n\t\t\tmoistureSensorPolarity,\n\t\t});\n\t}\n\n\tpublic readonly masterValveDelay: number;\n\n\tpublic readonly highPressureThreshold: number;\n\n\tpublic readonly lowPressureThreshold: number;\n\n\tpublic readonly rainSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic readonly moistureSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"master valve delay\": `${this.masterValveDelay} s`,\n\t\t\t\"high pressure threshold\": `${this.highPressureThreshold} kPa`,\n\t\t\t\"low pressure threshold\": `${this.lowPressureThreshold} kPa`,\n\t\t};\n\t\tif (this.rainSensorPolarity != undefined) {\n\t\t\tmessage[\"rain sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.rainSensorPolarity,\n\t\t\t);\n\t\t}\n\t\tif (this.moistureSensorPolarity != undefined) {\n\t\t\tmessage[\"moisture sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.moistureSensorPolarity,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemConfigGet)\n@expectedCCResponse(IrrigationCCSystemConfigReport)\nexport class IrrigationCCSystemConfigGet extends IrrigationCC {}\n\n// @publicAPI\nexport interface IrrigationCCValveInfoReportOptions {\n\tvalveId: ValveId;\n\tconnected: boolean;\n\tnominalCurrent: number;\n\terrorShortCircuit: boolean;\n\terrorHighCurrent: boolean;\n\terrorLowCurrent: boolean;\n\terrorMaximumFlow?: boolean;\n\terrorHighFlow?: boolean;\n\terrorLowFlow?: boolean;\n}\n\n@CCCommand(IrrigationCommand.ValveInfoReport)\nexport class IrrigationCCValveInfoReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.valveId = options.valveId;\n\t\tthis.connected = options.connected;\n\t\tthis.nominalCurrent = options.nominalCurrent;\n\t\tthis.errorShortCircuit = options.errorShortCircuit;\n\t\tthis.errorHighCurrent = options.errorHighCurrent;\n\t\tthis.errorLowCurrent = options.errorLowCurrent;\n\t\tthis.errorMaximumFlow = options.errorMaximumFlow;\n\t\tthis.errorHighFlow = options.errorHighFlow;\n\t\tthis.errorLowFlow = options.errorLowFlow;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tlet valveId: ValveId;\n\t\tif ((raw.payload[0] & 0b1) === ValveType.MasterValve) {\n\t\t\tvalveId = \"master\";\n\t\t} else {\n\t\t\tvalveId = raw.payload[1];\n\t\t}\n\n\t\tconst connected = !!(raw.payload[0] & 0b10);\n\t\tconst nominalCurrent = 10 * raw.payload[2];\n\t\tconst errorShortCircuit = !!(raw.payload[3] & 0b1);\n\t\tconst errorHighCurrent = !!(raw.payload[3] & 0b10);\n\t\tconst errorLowCurrent = !!(raw.payload[3] & 0b100);\n\t\tlet errorMaximumFlow: boolean | undefined;\n\t\tlet errorHighFlow: boolean | undefined;\n\t\tlet errorLowFlow: boolean | undefined;\n\t\tif (valveId === \"master\") {\n\t\t\terrorMaximumFlow = !!(raw.payload[3] & 0b1000);\n\t\t\terrorHighFlow = !!(raw.payload[3] & 0b1_0000);\n\t\t\terrorLowFlow = !!(raw.payload[3] & 0b10_0000);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tvalveId,\n\t\t\tconnected,\n\t\t\tnominalCurrent,\n\t\t\terrorShortCircuit,\n\t\t\terrorHighCurrent,\n\t\t\terrorLowCurrent,\n\t\t\terrorMaximumFlow,\n\t\t\terrorHighFlow,\n\t\t\terrorLowFlow,\n\t\t});\n\t}\n\n\tpublic readonly valveId: ValveId;\n\n\tpublic readonly connected: boolean;\n\tpublic readonly nominalCurrent: number;\n\tpublic readonly errorShortCircuit: boolean;\n\tpublic readonly errorHighCurrent: boolean;\n\tpublic readonly errorLowCurrent: boolean;\n\tpublic readonly errorMaximumFlow?: boolean;\n\tpublic readonly errorHighFlow?: boolean;\n\tpublic readonly errorLowFlow?: boolean;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// connected\n\t\tconst valveConnectedValue = IrrigationCCValues.valveConnected(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, valveConnectedValue);\n\t\tthis.setValue(ctx, valveConnectedValue, this.connected);\n\n\t\t// nominalCurrent\n\t\tconst nominalCurrentValue = IrrigationCCValues.nominalCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, nominalCurrentValue);\n\t\tthis.setValue(ctx, nominalCurrentValue, this.nominalCurrent);\n\n\t\t// errorShortCircuit\n\t\tconst errorShortCircuitValue = IrrigationCCValues.errorShortCircuit(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorShortCircuitValue);\n\t\tthis.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);\n\n\t\t// errorHighCurrent\n\t\tconst errorHighCurrentValue = IrrigationCCValues.errorHighCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorHighCurrentValue);\n\t\tthis.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);\n\n\t\t// errorLowCurrent\n\t\tconst errorLowCurrentValue = IrrigationCCValues.errorLowCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorLowCurrentValue);\n\t\tthis.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);\n\n\t\tif (this.errorMaximumFlow != undefined) {\n\t\t\tconst errorMaximumFlowValue = IrrigationCCValues.errorMaximumFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorMaximumFlowValue);\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\terrorMaximumFlowValue,\n\t\t\t\tthis.errorMaximumFlow,\n\t\t\t);\n\t\t}\n\n\t\tif (this.errorHighFlow != undefined) {\n\t\t\tconst errorHighFlowValue = IrrigationCCValues.errorHighFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorHighFlowValue);\n\t\t\tthis.setValue(ctx, errorHighFlowValue, this.errorHighFlow);\n\t\t}\n\n\t\tif (this.errorLowFlow != undefined) {\n\t\t\tconst errorLowFlowValue = IrrigationCCValues.errorLowFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorLowFlowValue);\n\t\t\tthis.setValue(ctx, errorLowFlowValue, this.errorLowFlow);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"valve ID\": this.valveId,\n\t\t\tconnected: this.connected,\n\t\t\t\"nominal current\": `${this.nominalCurrent} mA`,\n\t\t};\n\t\tconst errors = [\n\t\t\tthis.errorShortCircuit ? \"short circuit\" : undefined,\n\t\t\tthis.errorHighCurrent ? \"current above high threshold\" : undefined,\n\t\t\tthis.errorLowCurrent ? \"current below low threshold\" : undefined,\n\t\t\tthis.errorMaximumFlow ? \"maximum flow\" : undefined,\n\t\t\tthis.errorHighFlow ? \"flow above high threshold\" : undefined,\n\t\t\tthis.errorLowFlow ? \"flow below low threshold\" : undefined,\n\t\t].filter(Boolean);\n\t\tif (errors.length > 0) {\n\t\t\tmessage.errors = errors.map((e) => `\\n\u00B7 ${e}`).join(\"\");\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveInfoGetOptions {\n\tvalveId: ValveId;\n}\n\nfunction testResponseForIrrigationCommandWithValveId(\n\tsent: {\n\t\tvalveId: ValveId;\n\t},\n\treceived: {\n\t\tvalveId: ValveId;\n\t},\n) {\n\treturn received.valveId === sent.valveId;\n}\n\n@CCCommand(IrrigationCommand.ValveInfoGet)\n@expectedCCResponse(\n\tIrrigationCCValveInfoReport,\n\ttestResponseForIrrigationCommandWithValveId as any,\n)\nexport class IrrigationCCValveInfoGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveInfoGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveInfoGet {\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 IrrigationCCValveInfoGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type IrrigationCCValveConfigSetOptions = {\n\tvalveId: ValveId;\n\tnominalCurrentHighThreshold: number;\n\tnominalCurrentLowThreshold: number;\n\tmaximumFlow: number;\n\thighFlowThreshold: number;\n\tlowFlowThreshold: number;\n\tuseRainSensor: boolean;\n\tuseMoistureSensor: boolean;\n};\n\n@CCCommand(IrrigationCommand.ValveConfigSet)\n@useSupervision()\nexport class IrrigationCCValveConfigSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t\tthis.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;\n\t\tthis.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;\n\t\tthis.maximumFlow = options.maximumFlow;\n\t\tthis.highFlowThreshold = options.highFlowThreshold;\n\t\tthis.lowFlowThreshold = options.lowFlowThreshold;\n\t\tthis.useRainSensor = options.useRainSensor;\n\t\tthis.useMoistureSensor = options.useMoistureSensor;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveConfigSet {\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 IrrigationCCValveConfigSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic nominalCurrentHighThreshold: number;\n\tpublic nominalCurrentLowThreshold: number;\n\tpublic maximumFlow: number;\n\tpublic highFlowThreshold: number;\n\tpublic lowFlowThreshold: number;\n\tpublic useRainSensor: boolean;\n\tpublic useMoistureSensor: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\n\t\t\t\tMath.floor(this.nominalCurrentHighThreshold / 10),\n\t\t\t\tMath.floor(this.nominalCurrentLowThreshold / 10),\n\t\t\t]),\n\t\t\tencodeFloatWithScale(this.maximumFlow, 0 /* l/h */),\n\t\t\tencodeFloatWithScale(this.highFlowThreshold, 0 /* l/h */),\n\t\t\tencodeFloatWithScale(this.lowFlowThreshold, 0 /* l/h */),\n\t\t\tBytes.from([\n\t\t\t\t(this.useRainSensor ? 0b1 : 0)\n\t\t\t\t| (this.useMoistureSensor ? 0b10 : 0),\n\t\t\t]),\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t\t\"nominal current high threshold\":\n\t\t\t\t\t`${this.nominalCurrentHighThreshold} mA`,\n\t\t\t\t\"nominal current low threshold\":\n\t\t\t\t\t`${this.nominalCurrentLowThreshold} mA`,\n\t\t\t\t\"maximum flow\": `${this.maximumFlow} l/h`,\n\t\t\t\t\"high flow threshold\": `${this.highFlowThreshold} l/h`,\n\t\t\t\t\"low flow threshold\": `${this.lowFlowThreshold} l/h`,\n\t\t\t\t\"use rain sensor\": this.useRainSensor,\n\t\t\t\t\"use moisture sensor\": this.useMoistureSensor,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveConfigReportOptions {\n\tvalveId: ValveId;\n\tnominalCurrentHighThreshold: number;\n\tnominalCurrentLowThreshold: number;\n\tmaximumFlow: number;\n\thighFlowThreshold: number;\n\tlowFlowThreshold: number;\n\tuseRainSensor: boolean;\n\tuseMoistureSensor: boolean;\n}\n\n@CCCommand(IrrigationCommand.ValveConfigReport)\nexport class IrrigationCCValveConfigReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.valveId = options.valveId;\n\t\tthis.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;\n\t\tthis.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;\n\t\tthis.maximumFlow = options.maximumFlow;\n\t\tthis.highFlowThreshold = options.highFlowThreshold;\n\t\tthis.lowFlowThreshold = options.lowFlowThreshold;\n\t\tthis.useRainSensor = options.useRainSensor;\n\t\tthis.useMoistureSensor = options.useMoistureSensor;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveConfigReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tlet valveId: ValveId;\n\t\tif ((raw.payload[0] & 0b1) === ValveType.MasterValve) {\n\t\t\tvalveId = \"master\";\n\t\t} else {\n\t\t\tvalveId = raw.payload[1];\n\t\t}\n\n\t\tconst nominalCurrentHighThreshold = 10 * raw.payload[2];\n\t\tconst nominalCurrentLowThreshold = 10 * raw.payload[3];\n\t\tlet offset = 4;\n\t\tlet maximumFlow;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\tmaximumFlow = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet highFlowThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\thighFlowThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet lowFlowThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\tlowFlowThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 1);\n\t\tconst useRainSensor = !!(raw.payload[offset] & 0b1);\n\t\tconst useMoistureSensor = !!(raw.payload[offset] & 0b10);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tvalveId,\n\t\t\tnominalCurrentHighThreshold,\n\t\t\tnominalCurrentLowThreshold,\n\t\t\tmaximumFlow,\n\t\t\thighFlowThreshold,\n\t\t\tlowFlowThreshold,\n\t\t\tuseRainSensor,\n\t\t\tuseMoistureSensor,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// nominalCurrentHighThreshold\n\t\tconst nominalCurrentHighThresholdValue = IrrigationCCValues\n\t\t\t.nominalCurrentHighThreshold(this.valveId);\n\t\tthis.ensureMetadata(ctx, nominalCurrentHighThresholdValue);\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tnominalCurrentHighThresholdValue,\n\t\t\tthis.nominalCurrentHighThreshold,\n\t\t);\n\n\t\t// nominalCurrentLowThreshold\n\t\tconst nominalCurrentLowThresholdValue = IrrigationCCValues\n\t\t\t.nominalCurrentLowThreshold(this.valveId);\n\t\tthis.ensureMetadata(ctx, nominalCurrentLowThresholdValue);\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tnominalCurrentLowThresholdValue,\n\t\t\tthis.nominalCurrentLowThreshold,\n\t\t);\n\n\t\t// maximumFlow\n\t\tconst maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);\n\t\tthis.ensureMetadata(ctx, maximumFlowValue);\n\t\tthis.setValue(ctx, maximumFlowValue, this.maximumFlow);\n\n\t\t// highFlowThreshold\n\t\tconst highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, highFlowThresholdValue);\n\t\tthis.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);\n\n\t\t// lowFlowThreshold\n\t\tconst lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, lowFlowThresholdValue);\n\t\tthis.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);\n\n\t\t// useRainSensor\n\t\tconst useRainSensorValue = IrrigationCCValues.useRainSensor(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, useRainSensorValue);\n\t\tthis.setValue(ctx, useRainSensorValue, this.useRainSensor);\n\n\t\t// useMoistureSensor\n\t\tconst useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, useMoistureSensorValue);\n\t\tthis.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);\n\n\t\treturn true;\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic nominalCurrentHighThreshold: number;\n\tpublic nominalCurrentLowThreshold: number;\n\tpublic maximumFlow: number;\n\tpublic highFlowThreshold: number;\n\tpublic lowFlowThreshold: number;\n\tpublic useRainSensor: boolean;\n\tpublic useMoistureSensor: boolean;\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\"valve ID\": this.valveId,\n\t\t\t\t\"nominal current high threshold\":\n\t\t\t\t\t`${this.nominalCurrentHighThreshold} mA`,\n\t\t\t\t\"nominal current low threshold\":\n\t\t\t\t\t`${this.nominalCurrentLowThreshold} mA`,\n\t\t\t\t\"maximum flow\": `${this.maximumFlow} l/h`,\n\t\t\t\t\"high flow threshold\": `${this.highFlowThreshold} l/h`,\n\t\t\t\t\"low flow threshold\": `${this.lowFlowThreshold} l/h`,\n\t\t\t\t\"use rain sensor\": this.useRainSensor,\n\t\t\t\t\"use moisture sensor\": this.useMoistureSensor,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveConfigGetOptions {\n\tvalveId: ValveId;\n}\n\n@CCCommand(IrrigationCommand.ValveConfigGet)\n@expectedCCResponse(\n\tIrrigationCCValveConfigReport,\n\ttestResponseForIrrigationCommandWithValveId as any,\n)\nexport class IrrigationCCValveConfigGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveConfigGet {\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 IrrigationCCValveConfigGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveRunOptions {\n\tvalveId: ValveId;\n\tduration: number;\n}\n\n@CCCommand(IrrigationCommand.ValveRun)\n@useSupervision()\nexport class IrrigationCCValveRun extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveRunOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveRun {\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 IrrigationCCValveRun({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic duration: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\n\t\t\t0,\n\t\t\t0,\n\t\t]);\n\t\tthis.payload.writeUInt16BE(this.duration, 2);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"valve ID\": this.valveId,\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = `${this.duration} s`;\n\t\t} else {\n\t\t\tmessage.action = \"turn off\";\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableSetOptions {\n\ttableId: number;\n\tentries: ValveTableEntry[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableSet)\n@useSupervision()\nexport class IrrigationCCValveTableSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableId = options.tableId;\n\t\tthis.entries = options.entries;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableSet {\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 IrrigationCCValveTableSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableId: number;\n\tpublic entries: ValveTableEntry[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(1 + this.entries.length * 3);\n\t\tthis.payload[0] = this.tableId;\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst offset = 1 + i * 3;\n\t\t\tthis.payload[offset] = entry.valveId;\n\t\t\tthis.payload.writeUInt16BE(entry.duration, offset + 1);\n\t\t}\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"table ID\": this.tableId,\n\t\t};\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst valveLabel = entry.valveId.toString().padStart(3, \"0\");\n\t\t\tif (entry.duration) {\n\t\t\t\tmessage[`valve ${valveLabel} duration`] = `${entry.duration} s`;\n\t\t\t} else {\n\t\t\t\tmessage[`valve ${valveLabel} action`] = `turn off`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableReportOptions {\n\ttableId: number;\n\tentries: ValveTableEntry[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableReport)\nexport class IrrigationCCValveTableReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.tableId = options.tableId;\n\t\tthis.entries = options.entries;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveTableReport {\n\t\tvalidatePayload((raw.payload.length - 1) % 3 === 0);\n\t\tconst tableId = raw.payload[0];\n\t\tconst entries: ValveTableEntry[] = [];\n\t\tfor (let offset = 1; offset < raw.payload.length; offset += 3) {\n\t\t\tentries.push({\n\t\t\t\tvalveId: raw.payload[offset],\n\t\t\t\tduration: raw.payload.readUInt16BE(offset + 1),\n\t\t\t});\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttableId,\n\t\t\tentries,\n\t\t});\n\t}\n\n\tpublic readonly tableId: number;\n\tpublic readonly entries: ValveTableEntry[];\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"table ID\": this.tableId,\n\t\t};\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst valveLabel = entry.valveId.toString().padStart(3, \"0\");\n\t\t\tif (entry.duration) {\n\t\t\t\tmessage[`valve ${valveLabel} duration`] = `${entry.duration} s`;\n\t\t\t} else {\n\t\t\t\tmessage[`valve ${valveLabel} action`] = `turn off`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableGetOptions {\n\ttableId: number;\n}\n\nfunction testResponseForIrrigationValveTableGet(\n\tsent: IrrigationCCValveTableGet,\n\treceived: IrrigationCCValveTableReport,\n) {\n\treturn received.tableId === sent.tableId;\n}\n\n@CCCommand(IrrigationCommand.ValveTableGet)\n@expectedCCResponse(\n\tIrrigationCCValveTableReport,\n\ttestResponseForIrrigationValveTableGet,\n)\nexport class IrrigationCCValveTableGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableId = options.tableId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableGet {\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 IrrigationCCValveTableGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.tableId]);\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\"table ID\": this.tableId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableRunOptions {\n\ttableIDs: number[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableRun)\n@useSupervision()\nexport class IrrigationCCValveTableRun extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableRunOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableIDs = options.tableIDs;\n\t\tif (this.tableIDs.length < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${this.constructor.name}: At least one table ID must be specified.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableRun {\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 IrrigationCCValveTableRun({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableIDs: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from(this.tableIDs);\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\"table IDs\": this.tableIDs\n\t\t\t\t\t.map((id) => id.toString().padStart(3, \"0\"))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemShutoffOptions {\n\t/**\n\t * The duration in minutes the system must stay off.\n\t * 255 or `undefined` will prevent schedules from running.\n\t */\n\tduration?: number;\n}\n\n@CCCommand(IrrigationCommand.SystemShutoff)\n@useSupervision()\nexport class IrrigationCCSystemShutoff extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemShutoffOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCSystemShutoff {\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 IrrigationCCSystemShutoff({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic duration?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.duration ?? 255]);\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\tduration: this.duration === 0\n\t\t\t\t\t? \"temporarily\"\n\t\t\t\t\t: this.duration === 255 || this.duration === undefined\n\t\t\t\t\t? \"permanently\"\n\t\t\t\t\t: `${this.duration} hours`,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeFloatWithScale,\n\tenumValuesToMetadataStates,\n\tparseFloatWithScale,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport { irrigationValveIdToMetadataPrefix } from \"../lib/CCValueUtils.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\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 {\n\tIrrigationCommand,\n\tIrrigationSensorPolarity,\n\ttype ValveId,\n\ttype ValveTableEntry,\n\tValveType,\n} from \"../lib/_Types.js\";\n\nexport const IrrigationCCValues = V.defineCCValues(CommandClasses.Irrigation, {\n\t...V.staticProperty(\"numValves\", undefined, { internal: true }),\n\t...V.staticProperty(\"numValveTables\", undefined, { internal: true }),\n\t...V.staticProperty(\"supportsMasterValve\", undefined, {\n\t\tinternal: true,\n\t}),\n\t...V.staticProperty(\"maxValveTableSize\", undefined, { internal: true }),\n\t...V.staticProperty(\n\t\t\"systemVoltage\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"System voltage\",\n\t\t\tunit: \"V\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"masterValveDelay\",\n\t\t{\n\t\t\t...ValueMetadata.UInt8,\n\t\t\tlabel: \"Master valve delay\",\n\t\t\tdescription:\n\t\t\t\t\"The delay between turning on the master valve and turning on any zone valve\",\n\t\t\tunit: \"seconds\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"flowSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Flow sensor active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"pressureSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Pressure sensor active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"rainSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Rain sensor attached and active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"rainSensorPolarity\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Rain sensor polarity\",\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstates: enumValuesToMetadataStates(IrrigationSensorPolarity),\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"moistureSensorActive\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Moisture sensor attached and active\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"moistureSensorPolarity\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Moisture sensor polarity\",\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstates: enumValuesToMetadataStates(IrrigationSensorPolarity),\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"flow\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"Flow\",\n\t\t\tunit: \"l/h\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"pressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"Pressure\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"shutoffDuration\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"Remaining shutoff duration\",\n\t\t\tunit: \"hours\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorNotProgrammed\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: device not programmed\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorEmergencyShutdown\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: emergency shutdown\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorHighPressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: high pressure\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"highPressureThreshold\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"High pressure threshold\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorLowPressure\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: low pressure\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"lowPressureThreshold\",\n\t\t{\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: \"Low pressure threshold\",\n\t\t\tunit: \"kPa\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"errorValve\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Error: valve reporting error\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"masterValveOpen\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Master valve is open\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"firstOpenZoneId\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\tlabel: \"First open zone valve ID\",\n\t\t} as const,\n\t),\n\t...V.staticPropertyWithName(\n\t\t\"shutoffSystem\",\n\t\t\"shutoff\",\n\t\t{\n\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\tlabel: `Shutoff system`,\n\t\t\tstates: {\n\t\t\t\ttrue: \"Shutoff\",\n\t\t\t},\n\t\t} as const,\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveConnected\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"valveConnected\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"valveConnected\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${irrigationValveIdToMetadataPrefix(valveId)}: Connected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current`,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrentHighThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrentHighThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrentHighThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current - high threshold`,\n\t\t\tmin: 0,\n\t\t\tmax: 2550,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"nominalCurrentLowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"nominalCurrentLowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"nominalCurrentLowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Nominal current - low threshold`,\n\t\t\tmin: 0,\n\t\t\tmax: 2550,\n\t\t\tunit: \"mA\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorShortCircuit\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorShortCircuit\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorShortCircuit\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Short circuit detected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorHighCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorHighCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorHighCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Current above high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorLowCurrent\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorLowCurrent\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorLowCurrent\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Current below low threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"maximumFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"maximumFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"maximumFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(valveId)\n\t\t\t}: Maximum flow`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorMaximumFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorMaximumFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorMaximumFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Maximum flow detected`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"highFlowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"highFlowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"highFlowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: High flow threshold`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorHighFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorHighFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorHighFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Flow above high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"lowFlowThreshold\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"lowFlowThreshold\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"lowFlowThreshold\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Number,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Low flow threshold`,\n\t\t\tmin: 0,\n\t\t\tunit: \"l/h\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"errorLowFlow\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"errorLowFlow\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"errorLowFlow\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Error - Flow below high threshold`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"useRainSensor\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"useRainSensor\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"useRainSensor\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Use rain sensor`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"useMoistureSensor\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"useMoistureSensor\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"useMoistureSensor\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(\n\t\t\t\t\tvalveId,\n\t\t\t\t)\n\t\t\t}: Use moisture sensor`,\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveRunDuration\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"duration\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"duration\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.UInt16,\n\t\t\tlabel: `${\n\t\t\t\tirrigationValveIdToMetadataPrefix(valveId)\n\t\t\t}: Run duration`,\n\t\t\tmin: 1,\n\t\t\tunit: \"s\",\n\t\t} as const),\n\t),\n\t...V.dynamicPropertyAndKeyWithName(\n\t\t\"valveRunStartStop\",\n\t\t(valveId: ValveId) => valveId,\n\t\t\"startStop\",\n\t\t({ property, propertyKey }) =>\n\t\t\t(typeof property === \"number\" || property === \"master\")\n\t\t\t&& propertyKey === \"startStop\",\n\t\t(valveId: ValveId) => ({\n\t\t\t...ValueMetadata.Boolean,\n\t\t\tlabel: `${irrigationValveIdToMetadataPrefix(valveId)}: Start/Stop`,\n\t\t\tstates: {\n\t\t\t\ttrue: \"Start\",\n\t\t\t\tfalse: \"Stop\",\n\t\t\t},\n\t\t} as const),\n\t),\n});\n\nconst systemConfigProperties = [\n\t\"masterValveDelay\",\n\t\"highPressureThreshold\",\n\t\"lowPressureThreshold\",\n\t\"rainSensorPolarity\",\n\t\"moistureSensorPolarity\",\n] as const;\n\nconst valveConfigPropertyKeys = [\n\t\"nominalCurrentHighThreshold\",\n\t\"nominalCurrentLowThreshold\",\n\t\"maximumFlow\",\n\t\"highFlowThreshold\",\n\t\"lowFlowThreshold\",\n\t\"useRainSensor\",\n\t\"useMoistureSensor\",\n] as const;\n\n@API(CommandClasses.Irrigation)\nexport class IrrigationCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: IrrigationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase IrrigationCommand.SystemInfoGet:\n\t\t\tcase IrrigationCommand.SystemStatusGet:\n\t\t\tcase IrrigationCommand.SystemConfigSet:\n\t\t\tcase IrrigationCommand.SystemConfigGet:\n\t\t\tcase IrrigationCommand.ValveInfoGet:\n\t\t\tcase IrrigationCommand.ValveConfigSet:\n\t\t\tcase IrrigationCommand.ValveConfigGet:\n\t\t\tcase IrrigationCommand.ValveRun:\n\t\t\tcase IrrigationCommand.ValveTableSet:\n\t\t\tcase IrrigationCommand.ValveTableGet:\n\t\t\tcase IrrigationCommand.ValveTableRun:\n\t\t\tcase IrrigationCommand.SystemShutoff:\n\t\t\t\t// These are all mandatory in V1\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getSystemInfo() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemInfoGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemInfoGet({\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\tIrrigationCCSystemInfoReport\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\"numValves\",\n\t\t\t\t\"numValveTables\",\n\t\t\t\t\"supportsMasterValve\",\n\t\t\t\t\"maxValveTableSize\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getSystemStatus() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemStatusGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemStatusGet({\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\tIrrigationCCSystemStatusReport\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\"systemVoltage\",\n\t\t\t\t\"flowSensorActive\",\n\t\t\t\t\"pressureSensorActive\",\n\t\t\t\t\"rainSensorActive\",\n\t\t\t\t\"moistureSensorActive\",\n\t\t\t\t\"flow\",\n\t\t\t\t\"pressure\",\n\t\t\t\t\"shutoffDuration\",\n\t\t\t\t\"errorNotProgrammed\",\n\t\t\t\t\"errorEmergencyShutdown\",\n\t\t\t\t\"errorHighPressure\",\n\t\t\t\t\"errorLowPressure\",\n\t\t\t\t\"errorValve\",\n\t\t\t\t\"masterValveOpen\",\n\t\t\t\t\"firstOpenZoneId\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getSystemConfig() {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemConfigGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemConfigGet({\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\tIrrigationCCSystemConfigReport\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\"masterValveDelay\",\n\t\t\t\t\"highPressureThreshold\",\n\t\t\t\t\"lowPressureThreshold\",\n\t\t\t\t\"rainSensorPolarity\",\n\t\t\t\t\"moistureSensorPolarity\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async setSystemConfig(\n\t\tconfig: IrrigationCCSystemConfigSetOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemConfigSet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemConfigSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...config,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getValveInfo(valveId: ValveId) {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveInfoGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveInfoGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveInfoReport\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\"connected\",\n\t\t\t\t\"nominalCurrent\",\n\t\t\t\t\"errorShortCircuit\",\n\t\t\t\t\"errorHighCurrent\",\n\t\t\t\t\"errorLowCurrent\",\n\t\t\t\t\"errorMaximumFlow\",\n\t\t\t\t\"errorHighFlow\",\n\t\t\t\t\"errorLowFlow\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setValveConfig(\n\t\toptions: IrrigationCCValveConfigSetOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveConfigSet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveConfigSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getValveConfig(valveId: ValveId) {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveConfigGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveConfigGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveConfigReport\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\"nominalCurrentHighThreshold\",\n\t\t\t\t\"nominalCurrentLowThreshold\",\n\t\t\t\t\"maximumFlow\",\n\t\t\t\t\"highFlowThreshold\",\n\t\t\t\t\"lowFlowThreshold\",\n\t\t\t\t\"useRainSensor\",\n\t\t\t\t\"useMoistureSensor\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async runValve(\n\t\tvalveId: ValveId,\n\t\tduration: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveRun,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveRun({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalveId,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic shutoffValve(\n\t\tvalveId: ValveId,\n\t): Promise<SupervisionResult | undefined> {\n\t\treturn this.runValve(valveId, 0);\n\t}\n\n\t@validateArgs()\n\tpublic async setValveTable(\n\t\ttableId: number,\n\t\tentries: ValveTableEntry[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableSet,\n\t\t);\n\n\t\tif (!this.endpoint.virtual) {\n\t\t\tconst maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\t\t\tif (\n\t\t\t\tmaxValveTableSize != undefined\n\t\t\t\t&& entries.length > maxValveTableSize\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The number of valve table entries must not exceed ${maxValveTableSize}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new IrrigationCCValveTableSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableId,\n\t\t\tentries,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async getValveTable(\n\t\ttableId: number,\n\t): Promise<MaybeNotKnown<ValveTableEntry[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableGet,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveTableGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableId,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tIrrigationCCValveTableReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn response?.entries;\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async runTables(\n\t\ttableIDs: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.ValveTableRun,\n\t\t);\n\n\t\tconst cc = new IrrigationCCValveTableRun({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttableIDs,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Shuts off the entire system for the given duration.\n\t * @param duration Shutoff duration in hours. A value of 255 will shut off the entire system permanently and prevents schedules from running.\n\t */\n\t@validateArgs()\n\tpublic async shutoffSystem(\n\t\tduration: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tIrrigationCommand,\n\t\t\tIrrigationCommand.SystemShutoff,\n\t\t);\n\n\t\tconst cc = new IrrigationCCSystemShutoff({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/** Shuts off the entire system permanently and prevents schedules from running */\n\tpublic shutoffSystemPermanently(): Promise<SupervisionResult | undefined> {\n\t\treturn this.shutoffSystem(255);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: IrrigationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tconst valueDB = this.getValueDB();\n\n\t\t\tif (systemConfigProperties.includes(property as any)) {\n\t\t\t\tconst options = {} as IrrigationCCSystemConfigSetOptions;\n\t\t\t\tfor (const prop of systemConfigProperties) {\n\t\t\t\t\tif (prop === property) continue;\n\t\t\t\t\tconst valueId: ValueID = {\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty: prop as any,\n\t\t\t\t\t};\n\t\t\t\t\tconst cachedVal = valueDB.getValue<any>(valueId);\n\t\t\t\t\tif (cachedVal == undefined) {\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`The \"${property}\" property cannot be changed before ${prop} is known!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\toptions[prop] = cachedVal;\n\t\t\t\t}\n\t\t\t\toptions[property as keyof IrrigationCCSystemConfigSetOptions] =\n\t\t\t\t\tvalue as any;\n\n\t\t\t\treturn this.setSystemConfig(options);\n\t\t\t} else if (property === \"shutoff\") {\n\t\t\t\treturn this.shutoffSystem(0);\n\t\t\t} else if (\n\t\t\t\tproperty === \"master\"\n\t\t\t\t|| (typeof property === \"number\" && property >= 1)\n\t\t\t) {\n\t\t\t\t// This is a value of a valve\n\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t}\n\n\t\t\t\tif (valveConfigPropertyKeys.includes(propertyKey as any)) {\n\t\t\t\t\tconst options = {\n\t\t\t\t\t\tvalveId: property,\n\t\t\t\t\t} as IrrigationCCValveConfigSetOptions;\n\n\t\t\t\t\tfor (const prop of valveConfigPropertyKeys) {\n\t\t\t\t\t\tif (prop === propertyKey) continue;\n\t\t\t\t\t\tconst valueId: ValueID = {\n\t\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey: prop as any,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst cachedVal = valueDB.getValue<any>(valueId);\n\t\t\t\t\t\tif (cachedVal == undefined) {\n\t\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t\t`The \"${property}_${propertyKey}\" property cannot be changed before ${property}_${prop} is known!`,\n\t\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t(options as any)[prop] = cachedVal;\n\t\t\t\t\t}\n\t\t\t\t\t(options as any)[propertyKey] = value;\n\n\t\t\t\t\treturn this.setValveConfig(options);\n\t\t\t\t} else if (propertyKey === \"duration\") {\n\t\t\t\t\t// The run duration needs to be set separately from triggering the run\n\t\t\t\t\t// So this is okay\n\t\t\t\t\treturn;\n\t\t\t\t} else if (propertyKey === \"startStop\") {\n\t\t\t\t\t// Trigger or stop a valve run, depending on the value\n\t\t\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\t// Start a valve run\n\t\t\t\t\t\tconst duration = valueDB.getValue<number>(\n\t\t\t\t\t\t\tIrrigationCCValues.valveRunDuration(\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t).endpoint(this.endpoint.index),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (duration == undefined) {\n\t\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t\t`Cannot start a valve run without specifying a duration first!`,\n\t\t\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn this.runValve(property, duration);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Stop a valve run\n\t\t\t\t\t\treturn this.shutoffValve(property);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: IrrigationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"systemVoltage\":\n\t\t\t\tcase \"flowSensorActive\":\n\t\t\t\tcase \"pressureSensorActive\":\n\t\t\t\tcase \"rainSensorActive\":\n\t\t\t\tcase \"moistureSensorActive\":\n\t\t\t\tcase \"flow\":\n\t\t\t\tcase \"pressure\":\n\t\t\t\tcase \"shutoffDuration\":\n\t\t\t\tcase \"errorNotProgrammed\":\n\t\t\t\tcase \"errorEmergencyShutdown\":\n\t\t\t\tcase \"errorHighPressure\":\n\t\t\t\tcase \"errorLowPressure\":\n\t\t\t\tcase \"errorValve\":\n\t\t\t\tcase \"masterValveOpen\":\n\t\t\t\tcase \"firstOpenZoneId\":\n\t\t\t\t\treturn (await this.getSystemStatus())?.[property];\n\n\t\t\t\tcase \"masterValveDelay\":\n\t\t\t\tcase \"highPressureThreshold\":\n\t\t\t\tcase \"lowPressureThreshold\":\n\t\t\t\tcase \"rainSensorPolarity\":\n\t\t\t\tcase \"moistureSensorPolarity\":\n\t\t\t\t\treturn (await this.getSystemConfig())?.[property];\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tproperty === \"master\"\n\t\t\t\t|| (typeof property === \"number\" && property >= 1)\n\t\t\t) {\n\t\t\t\t// This is a value of a valve\n\t\t\t\tswitch (propertyKey) {\n\t\t\t\t\tcase \"connected\":\n\t\t\t\t\tcase \"nominalCurrent\":\n\t\t\t\t\tcase \"errorShortCircuit\":\n\t\t\t\t\tcase \"errorHighCurrent\":\n\t\t\t\t\tcase \"errorLowCurrent\":\n\t\t\t\t\tcase \"errorMaximumFlow\":\n\t\t\t\t\tcase \"errorHighFlow\":\n\t\t\t\t\tcase \"errorLowFlow\":\n\t\t\t\t\t\treturn (await this.getValveInfo(property))?.[\n\t\t\t\t\t\t\tpropertyKey\n\t\t\t\t\t\t];\n\n\t\t\t\t\tcase \"nominalCurrentHighThreshold\":\n\t\t\t\t\tcase \"nominalCurrentLowThreshold\":\n\t\t\t\t\tcase \"maximumFlow\":\n\t\t\t\t\tcase \"highFlowThreshold\":\n\t\t\t\t\tcase \"lowFlowThreshold\":\n\t\t\t\t\tcase \"useRainSensor\":\n\t\t\t\t\tcase \"useMoistureSensor\":\n\t\t\t\t\t\treturn (await this.getValveConfig(property))?.[\n\t\t\t\t\t\t\tpropertyKey\n\t\t\t\t\t\t];\n\n\t\t\t\t\tcase undefined:\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n}\n\n@commandClass(CommandClasses.Irrigation)\n@implementedVersion(1)\n@ccValues(IrrigationCCValues)\nexport class IrrigationCC extends CommandClass {\n\tdeclare ccCommand: IrrigationCommand;\n\n\t/**\n\t * Returns the maximum number of valve table entries reported by the node.\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static getMaxValveTableSizeCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<number> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tIrrigationCCValues.maxValveTableSize.endpoint(endpoint.index),\n\t\t\t);\n\t}\n\n\t/**\n\t * Returns the number of zone valves reported by the node.\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static getNumValvesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<number> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(IrrigationCCValues.numValves.endpoint(endpoint.index));\n\t}\n\n\t/**\n\t * Returns whether the node supports a master valve\n\t * This only works AFTER the node has been interviewed.\n\t */\n\tpublic static supportsMasterValveCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): boolean {\n\t\treturn !!ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tIrrigationCCValues.supportsMasterValve.endpoint(endpoint.index),\n\t\t\t);\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.Irrigation,\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\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system info...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst systemInfo = await api.getSystemInfo();\n\t\tif (!systemInfo) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Time out while querying irrigation system info, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst logMessage = `received irrigation system info:\nsupports master valve: ${systemInfo.supportsMasterValve}\nno. of valves: ${systemInfo.numValves}\nno. of valve tables: ${systemInfo.numValveTables}\nmax. valve table size: ${systemInfo.maxValveTableSize}`;\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: logMessage,\n\t\t\tdirection: \"inbound\",\n\t\t});\n\n\t\t// For each valve, create the values to start/stop a run\n\t\tfor (let i = 1; i <= systemInfo.numValves; i++) {\n\t\t\tthis.ensureMetadata(\n\t\t\t\tctx,\n\t\t\t\tIrrigationCCValues.valveRunDuration(i),\n\t\t\t);\n\t\t\tthis.ensureMetadata(\n\t\t\t\tctx,\n\t\t\t\tIrrigationCCValues.valveRunStartStop(i),\n\t\t\t);\n\t\t}\n\t\t// And create a shutoff value\n\t\tthis.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);\n\n\t\t// Query current values\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.Irrigation,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\t// Query the current system config\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system configuration...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst systemConfig = await api.getSystemConfig();\n\t\tif (systemConfig) {\n\t\t\tlet logMessage = `received irrigation system configuration:\nmaster valve delay: ${systemConfig.masterValveDelay} seconds\nhigh pressure threshold: ${systemConfig.highPressureThreshold} kPa\nlow pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;\n\t\t\tif (systemConfig.rainSensorPolarity != undefined) {\n\t\t\t\tlogMessage += `\nrain sensor polarity: ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\t\t\tsystemConfig.rainSensorPolarity,\n\t\t\t\t\t)\n\t\t\t\t}`;\n\t\t\t}\n\t\t\tif (systemConfig.moistureSensorPolarity != undefined) {\n\t\t\t\tlogMessage += `\nmoisture sensor polarity: ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\t\t\tsystemConfig.moistureSensorPolarity,\n\t\t\t\t\t)\n\t\t\t\t}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\t// and status\n\t\t// Query the current system config\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying irrigation system status...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tawait api.getSystemStatus();\n\n\t\t// for each valve, query the current status and configuration\n\t\tif (IrrigationCC.supportsMasterValveCached(ctx, endpoint)) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Querying master valve configuration...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveConfig(\"master\");\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Querying master valve status...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveInfo(\"master\");\n\t\t}\n\n\t\tfor (\n\t\t\tlet i = 1;\n\t\t\ti <= (IrrigationCC.getNumValvesCached(ctx, endpoint) ?? 0);\n\t\t\ti++\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Querying configuration for valve ${\n\t\t\t\t\ti.toString().padStart(\n\t\t\t\t\t\t3,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveConfig(i);\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `Querying status for valve ${\n\t\t\t\t\ti.toString().padStart(\n\t\t\t\t\t\t3,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.getValveInfo(i);\n\t\t}\n\t}\n\n\tpublic translateProperty(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey?: string | number,\n\t): string {\n\t\tif (property === \"master\") {\n\t\t\treturn \"Master valve\";\n\t\t} else if (typeof property === \"number\") {\n\t\t\treturn `Valve ${property.toString().padStart(3, \"0\")}`;\n\t\t}\n\t\treturn super.translateProperty(ctx, property, propertyKey);\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemInfoReportOptions {\n\tsupportsMasterValve: boolean;\n\tnumValves: number;\n\tnumValveTables: number;\n\tmaxValveTableSize: number;\n}\n\n@CCCommand(IrrigationCommand.SystemInfoReport)\n@ccValueProperty(\"numValves\", IrrigationCCValues.numValves)\n@ccValueProperty(\"numValveTables\", IrrigationCCValues.numValveTables)\n@ccValueProperty(\"supportsMasterValve\", IrrigationCCValues.supportsMasterValve)\n@ccValueProperty(\"maxValveTableSize\", IrrigationCCValues.maxValveTableSize)\nexport class IrrigationCCSystemInfoReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.supportsMasterValve = options.supportsMasterValve;\n\t\tthis.numValves = options.numValves;\n\t\tthis.numValveTables = options.numValveTables;\n\t\tthis.maxValveTableSize = options.maxValveTableSize;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst supportsMasterValve = !!(raw.payload[0] & 0x01);\n\t\tconst numValves = raw.payload[1];\n\t\tconst numValveTables = raw.payload[2];\n\t\tconst maxValveTableSize = raw.payload[3] & 0b1111;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsMasterValve,\n\t\t\tnumValves,\n\t\t\tnumValveTables,\n\t\t\tmaxValveTableSize,\n\t\t});\n\t}\n\n\tpublic readonly numValves: number;\n\n\tpublic readonly numValveTables: number;\n\n\tpublic readonly supportsMasterValve: boolean;\n\n\tpublic readonly maxValveTableSize: number;\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\"supports master valve\": this.supportsMasterValve,\n\t\t\t\t\"no. of valves\": this.numValves,\n\t\t\t\t\"no. of valve tables\": this.numValveTables,\n\t\t\t\t\"max. valve table size\": this.maxValveTableSize,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemInfoGet)\n@expectedCCResponse(IrrigationCCSystemInfoReport)\nexport class IrrigationCCSystemInfoGet extends IrrigationCC {}\n\n// @publicAPI\nexport interface IrrigationCCSystemStatusReportOptions {\n\tsystemVoltage: number;\n\tflowSensorActive: boolean;\n\tpressureSensorActive: boolean;\n\trainSensorActive: boolean;\n\tmoistureSensorActive: boolean;\n\tflow?: number;\n\tpressure?: number;\n\tshutoffDuration: number;\n\terrorNotProgrammed: boolean;\n\terrorEmergencyShutdown: boolean;\n\terrorHighPressure: boolean;\n\terrorLowPressure: boolean;\n\terrorValve: boolean;\n\tmasterValveOpen: boolean;\n\tfirstOpenZoneId?: number;\n}\n\n@CCCommand(IrrigationCommand.SystemStatusReport)\n@ccValueProperty(\"systemVoltage\", IrrigationCCValues.systemVoltage)\n@ccValueProperty(\"flowSensorActive\", IrrigationCCValues.flowSensorActive)\n@ccValueProperty(\n\t\"pressureSensorActive\",\n\tIrrigationCCValues.pressureSensorActive,\n)\n@ccValueProperty(\"rainSensorActive\", IrrigationCCValues.rainSensorActive)\n@ccValueProperty(\n\t\"moistureSensorActive\",\n\tIrrigationCCValues.moistureSensorActive,\n)\n@ccValueProperty(\"flow\", IrrigationCCValues.flow)\n@ccValueProperty(\"pressure\", IrrigationCCValues.pressure)\n@ccValueProperty(\"shutoffDuration\", IrrigationCCValues.shutoffDuration)\n@ccValueProperty(\"errorNotProgrammed\", IrrigationCCValues.errorNotProgrammed)\n@ccValueProperty(\n\t\"errorEmergencyShutdown\",\n\tIrrigationCCValues.errorEmergencyShutdown,\n)\n@ccValueProperty(\"errorHighPressure\", IrrigationCCValues.errorHighPressure)\n@ccValueProperty(\"errorLowPressure\", IrrigationCCValues.errorLowPressure)\n@ccValueProperty(\"errorValve\", IrrigationCCValues.errorValve)\n@ccValueProperty(\"masterValveOpen\", IrrigationCCValues.masterValveOpen)\n@ccValueProperty(\"firstOpenZoneId\", IrrigationCCValues.firstOpenZoneId)\nexport class IrrigationCCSystemStatusReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemStatusReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.systemVoltage = options.systemVoltage;\n\t\tthis.flowSensorActive = options.flowSensorActive;\n\t\tthis.pressureSensorActive = options.pressureSensorActive;\n\t\tthis.rainSensorActive = options.rainSensorActive;\n\t\tthis.moistureSensorActive = options.moistureSensorActive;\n\t\tthis.flow = options.flow;\n\t\tthis.pressure = options.pressure;\n\t\tthis.shutoffDuration = options.shutoffDuration;\n\t\tthis.errorNotProgrammed = options.errorNotProgrammed;\n\t\tthis.errorEmergencyShutdown = options.errorEmergencyShutdown;\n\t\tthis.errorHighPressure = options.errorHighPressure;\n\t\tthis.errorLowPressure = options.errorLowPressure;\n\t\tthis.errorValve = options.errorValve;\n\t\tthis.masterValveOpen = options.masterValveOpen;\n\t\tthis.firstOpenZoneId = options.firstOpenZoneId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemStatusReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst systemVoltage = raw.payload[0];\n\t\tconst flowSensorActive = !!(raw.payload[1] & 0x01);\n\t\tconst pressureSensorActive = !!(raw.payload[1] & 0x02);\n\t\tconst rainSensorActive = !!(raw.payload[1] & 0x04);\n\t\tconst moistureSensorActive = !!(raw.payload[1] & 0x08);\n\t\tlet offset = 2;\n\t\tlet flow: number | undefined;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0);\n\t\t\tif (flowSensorActive) flow = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet pressure: number | undefined;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0);\n\t\t\tif (pressureSensorActive) pressure = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 4);\n\t\tconst shutoffDuration = raw.payload[offset];\n\t\tconst errorNotProgrammed = !!(raw.payload[offset + 1] & 0x01);\n\t\tconst errorEmergencyShutdown = !!(raw.payload[offset + 1] & 0x02);\n\t\tconst errorHighPressure = !!(raw.payload[offset + 1] & 0x04);\n\t\tconst errorLowPressure = !!(raw.payload[offset + 1] & 0x08);\n\t\tconst errorValve = !!(raw.payload[offset + 1] & 0x10);\n\t\tconst masterValveOpen = !!(raw.payload[offset + 2] & 0x01);\n\t\tlet firstOpenZoneId: number | undefined;\n\t\tif (raw.payload[offset + 3]) {\n\t\t\tfirstOpenZoneId = raw.payload[offset + 3];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsystemVoltage,\n\t\t\tflowSensorActive,\n\t\t\tpressureSensorActive,\n\t\t\trainSensorActive,\n\t\t\tmoistureSensorActive,\n\t\t\tflow,\n\t\t\tpressure,\n\t\t\tshutoffDuration,\n\t\t\terrorNotProgrammed,\n\t\t\terrorEmergencyShutdown,\n\t\t\terrorHighPressure,\n\t\t\terrorLowPressure,\n\t\t\terrorValve,\n\t\t\tmasterValveOpen,\n\t\t\tfirstOpenZoneId,\n\t\t});\n\t}\n\n\tpublic systemVoltage: number;\n\n\tpublic flowSensorActive: boolean;\n\n\tpublic pressureSensorActive: boolean;\n\n\tpublic rainSensorActive: boolean;\n\n\tpublic moistureSensorActive: boolean;\n\n\tpublic flow?: number;\n\n\tpublic pressure?: number;\n\n\tpublic shutoffDuration: number;\n\n\tpublic errorNotProgrammed: boolean;\n\n\tpublic errorEmergencyShutdown: boolean;\n\n\tpublic errorHighPressure: boolean;\n\n\tpublic errorLowPressure: boolean;\n\n\tpublic errorValve: boolean;\n\n\tpublic masterValveOpen: boolean;\n\n\tpublic firstOpenZoneId?: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"system voltage\": `${this.systemVoltage} V`,\n\t\t\t\"active sensors\": [\n\t\t\t\tthis.flowSensorActive ? \"flow\" : undefined,\n\t\t\t\tthis.pressureSensorActive ? \"pressure\" : undefined,\n\t\t\t\tthis.rainSensorActive ? \"rain\" : undefined,\n\t\t\t\tthis.moistureSensorActive ? \"moisture\" : undefined,\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(\", \"),\n\t\t};\n\t\tif (this.flow != undefined) {\n\t\t\tmessage.flow = `${this.flow} l/h`;\n\t\t}\n\t\tif (this.pressure != undefined) {\n\t\t\tmessage.pressure = `${this.pressure} kPa`;\n\t\t}\n\t\tmessage[\"remaining shutoff duration\"] = `${this.shutoffDuration} hours`;\n\t\tmessage[\"master valve status\"] = this.masterValveOpen\n\t\t\t? \"open\"\n\t\t\t: \"closed\";\n\t\tmessage[\"first open zone valve\"] = this.firstOpenZoneId || \"none\";\n\t\tconst errors = [\n\t\t\tthis.errorNotProgrammed ? \"device not programmed\" : undefined,\n\t\t\tthis.errorEmergencyShutdown ? \"emergency shutdown\" : undefined,\n\t\t\tthis.errorHighPressure\n\t\t\t\t? \"high pressure threshold triggered\"\n\t\t\t\t: undefined,\n\t\t\tthis.errorLowPressure\n\t\t\t\t? \"low pressure threshold triggered\"\n\t\t\t\t: undefined,\n\t\t\tthis.errorValve\n\t\t\t\t? \"a valve or the master valve has an error\"\n\t\t\t\t: undefined,\n\t\t].filter(Boolean);\n\t\tif (errors.length > 0) {\n\t\t\tmessage.errors = errors.map((e) => `\\n\u00B7 ${e}`).join(\"\");\n\t\t}\n\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemStatusGet)\n@expectedCCResponse(IrrigationCCSystemStatusReport)\nexport class IrrigationCCSystemStatusGet extends IrrigationCC {}\n\n// @publicAPI\nexport type IrrigationCCSystemConfigSetOptions = {\n\tmasterValveDelay: number;\n\thighPressureThreshold: number;\n\tlowPressureThreshold: number;\n\trainSensorPolarity?: IrrigationSensorPolarity;\n\tmoistureSensorPolarity?: IrrigationSensorPolarity;\n};\n\n@CCCommand(IrrigationCommand.SystemConfigSet)\n@useSupervision()\nexport class IrrigationCCSystemConfigSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemConfigSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.masterValveDelay = options.masterValveDelay;\n\t\tthis.highPressureThreshold = options.highPressureThreshold;\n\t\tthis.lowPressureThreshold = options.lowPressureThreshold;\n\t\tthis.rainSensorPolarity = options.rainSensorPolarity;\n\t\tthis.moistureSensorPolarity = options.moistureSensorPolarity;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCSystemConfigSet {\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 IrrigationCCSystemConfigSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic masterValveDelay: number;\n\tpublic highPressureThreshold: number;\n\tpublic lowPressureThreshold: number;\n\tpublic rainSensorPolarity?: IrrigationSensorPolarity;\n\tpublic moistureSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tlet polarity = 0;\n\t\tif (this.rainSensorPolarity != undefined) polarity |= 0b1;\n\t\tif (this.moistureSensorPolarity != undefined) polarity |= 0b10;\n\t\tif (\n\t\t\tthis.rainSensorPolarity == undefined\n\t\t\t&& this.moistureSensorPolarity == undefined\n\t\t) {\n\t\t\t// Valid bit\n\t\t\tpolarity |= 0b1000_0000;\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.masterValveDelay]),\n\t\t\tencodeFloatWithScale(this.highPressureThreshold, 0 /* kPa */),\n\t\t\tencodeFloatWithScale(this.lowPressureThreshold, 0 /* kPa */),\n\t\t\tBytes.from([polarity]),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"master valve delay\": `${this.masterValveDelay} s`,\n\t\t\t\"high pressure threshold\": `${this.highPressureThreshold} kPa`,\n\t\t\t\"low pressure threshold\": `${this.lowPressureThreshold} kPa`,\n\t\t};\n\t\tif (this.rainSensorPolarity != undefined) {\n\t\t\tmessage[\"rain sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.rainSensorPolarity,\n\t\t\t);\n\t\t}\n\t\tif (this.moistureSensorPolarity != undefined) {\n\t\t\tmessage[\"moisture sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.moistureSensorPolarity,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemConfigReportOptions {\n\tmasterValveDelay: number;\n\thighPressureThreshold: number;\n\tlowPressureThreshold: number;\n\trainSensorPolarity?: IrrigationSensorPolarity;\n\tmoistureSensorPolarity?: IrrigationSensorPolarity;\n}\n\n@CCCommand(IrrigationCommand.SystemConfigReport)\n@ccValueProperty(\"masterValveDelay\", IrrigationCCValues.masterValveDelay)\n@ccValueProperty(\n\t\"highPressureThreshold\",\n\tIrrigationCCValues.highPressureThreshold,\n)\n@ccValueProperty(\n\t\"lowPressureThreshold\",\n\tIrrigationCCValues.lowPressureThreshold,\n)\n@ccValueProperty(\"rainSensorPolarity\", IrrigationCCValues.rainSensorPolarity)\n@ccValueProperty(\n\t\"moistureSensorPolarity\",\n\tIrrigationCCValues.moistureSensorPolarity,\n)\nexport class IrrigationCCSystemConfigReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemConfigReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.masterValveDelay = options.masterValveDelay;\n\t\tthis.highPressureThreshold = options.highPressureThreshold;\n\t\tthis.lowPressureThreshold = options.lowPressureThreshold;\n\t\tthis.rainSensorPolarity = options.rainSensorPolarity;\n\t\tthis.moistureSensorPolarity = options.moistureSensorPolarity;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCSystemConfigReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst masterValveDelay = raw.payload[0];\n\t\tlet offset = 1;\n\t\tlet highPressureThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* kPa */);\n\t\t\thighPressureThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet lowPressureThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* kPa */);\n\t\t\tlowPressureThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 1);\n\t\tconst polarity = raw.payload[offset];\n\t\tlet rainSensorPolarity: IrrigationSensorPolarity | undefined;\n\t\tlet moistureSensorPolarity: IrrigationSensorPolarity | undefined;\n\t\tif (!!(polarity & 0b1000_0000)) {\n\t\t\t// The valid bit is set\n\t\t\trainSensorPolarity = polarity & 0b1;\n\t\t\tmoistureSensorPolarity = (polarity & 0b10) >>> 1;\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tmasterValveDelay,\n\t\t\thighPressureThreshold,\n\t\t\tlowPressureThreshold,\n\t\t\trainSensorPolarity,\n\t\t\tmoistureSensorPolarity,\n\t\t});\n\t}\n\n\tpublic readonly masterValveDelay: number;\n\n\tpublic readonly highPressureThreshold: number;\n\n\tpublic readonly lowPressureThreshold: number;\n\n\tpublic readonly rainSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic readonly moistureSensorPolarity?: IrrigationSensorPolarity;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"master valve delay\": `${this.masterValveDelay} s`,\n\t\t\t\"high pressure threshold\": `${this.highPressureThreshold} kPa`,\n\t\t\t\"low pressure threshold\": `${this.lowPressureThreshold} kPa`,\n\t\t};\n\t\tif (this.rainSensorPolarity != undefined) {\n\t\t\tmessage[\"rain sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.rainSensorPolarity,\n\t\t\t);\n\t\t}\n\t\tif (this.moistureSensorPolarity != undefined) {\n\t\t\tmessage[\"moisture sensor polarity\"] = getEnumMemberName(\n\t\t\t\tIrrigationSensorPolarity,\n\t\t\t\tthis.moistureSensorPolarity,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(IrrigationCommand.SystemConfigGet)\n@expectedCCResponse(IrrigationCCSystemConfigReport)\nexport class IrrigationCCSystemConfigGet extends IrrigationCC {}\n\n// @publicAPI\nexport interface IrrigationCCValveInfoReportOptions {\n\tvalveId: ValveId;\n\tconnected: boolean;\n\tnominalCurrent: number;\n\terrorShortCircuit: boolean;\n\terrorHighCurrent: boolean;\n\terrorLowCurrent: boolean;\n\terrorMaximumFlow?: boolean;\n\terrorHighFlow?: boolean;\n\terrorLowFlow?: boolean;\n}\n\n@CCCommand(IrrigationCommand.ValveInfoReport)\nexport class IrrigationCCValveInfoReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.valveId = options.valveId;\n\t\tthis.connected = options.connected;\n\t\tthis.nominalCurrent = options.nominalCurrent;\n\t\tthis.errorShortCircuit = options.errorShortCircuit;\n\t\tthis.errorHighCurrent = options.errorHighCurrent;\n\t\tthis.errorLowCurrent = options.errorLowCurrent;\n\t\tthis.errorMaximumFlow = options.errorMaximumFlow;\n\t\tthis.errorHighFlow = options.errorHighFlow;\n\t\tthis.errorLowFlow = options.errorLowFlow;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveInfoReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tlet valveId: ValveId;\n\t\tif ((raw.payload[0] & 0b1) === ValveType.MasterValve) {\n\t\t\tvalveId = \"master\";\n\t\t} else {\n\t\t\tvalveId = raw.payload[1];\n\t\t}\n\n\t\tconst connected = !!(raw.payload[0] & 0b10);\n\t\tconst nominalCurrent = 10 * raw.payload[2];\n\t\tconst errorShortCircuit = !!(raw.payload[3] & 0b1);\n\t\tconst errorHighCurrent = !!(raw.payload[3] & 0b10);\n\t\tconst errorLowCurrent = !!(raw.payload[3] & 0b100);\n\t\tlet errorMaximumFlow: boolean | undefined;\n\t\tlet errorHighFlow: boolean | undefined;\n\t\tlet errorLowFlow: boolean | undefined;\n\t\tif (valveId === \"master\") {\n\t\t\terrorMaximumFlow = !!(raw.payload[3] & 0b1000);\n\t\t\terrorHighFlow = !!(raw.payload[3] & 0b1_0000);\n\t\t\terrorLowFlow = !!(raw.payload[3] & 0b10_0000);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tvalveId,\n\t\t\tconnected,\n\t\t\tnominalCurrent,\n\t\t\terrorShortCircuit,\n\t\t\terrorHighCurrent,\n\t\t\terrorLowCurrent,\n\t\t\terrorMaximumFlow,\n\t\t\terrorHighFlow,\n\t\t\terrorLowFlow,\n\t\t});\n\t}\n\n\tpublic readonly valveId: ValveId;\n\n\tpublic readonly connected: boolean;\n\tpublic readonly nominalCurrent: number;\n\tpublic readonly errorShortCircuit: boolean;\n\tpublic readonly errorHighCurrent: boolean;\n\tpublic readonly errorLowCurrent: boolean;\n\tpublic readonly errorMaximumFlow?: boolean;\n\tpublic readonly errorHighFlow?: boolean;\n\tpublic readonly errorLowFlow?: boolean;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// connected\n\t\tconst valveConnectedValue = IrrigationCCValues.valveConnected(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, valveConnectedValue);\n\t\tthis.setValue(ctx, valveConnectedValue, this.connected);\n\n\t\t// nominalCurrent\n\t\tconst nominalCurrentValue = IrrigationCCValues.nominalCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, nominalCurrentValue);\n\t\tthis.setValue(ctx, nominalCurrentValue, this.nominalCurrent);\n\n\t\t// errorShortCircuit\n\t\tconst errorShortCircuitValue = IrrigationCCValues.errorShortCircuit(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorShortCircuitValue);\n\t\tthis.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);\n\n\t\t// errorHighCurrent\n\t\tconst errorHighCurrentValue = IrrigationCCValues.errorHighCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorHighCurrentValue);\n\t\tthis.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);\n\n\t\t// errorLowCurrent\n\t\tconst errorLowCurrentValue = IrrigationCCValues.errorLowCurrent(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, errorLowCurrentValue);\n\t\tthis.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);\n\n\t\tif (this.errorMaximumFlow != undefined) {\n\t\t\tconst errorMaximumFlowValue = IrrigationCCValues.errorMaximumFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorMaximumFlowValue);\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\terrorMaximumFlowValue,\n\t\t\t\tthis.errorMaximumFlow,\n\t\t\t);\n\t\t}\n\n\t\tif (this.errorHighFlow != undefined) {\n\t\t\tconst errorHighFlowValue = IrrigationCCValues.errorHighFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorHighFlowValue);\n\t\t\tthis.setValue(ctx, errorHighFlowValue, this.errorHighFlow);\n\t\t}\n\n\t\tif (this.errorLowFlow != undefined) {\n\t\t\tconst errorLowFlowValue = IrrigationCCValues.errorLowFlow(\n\t\t\t\tthis.valveId,\n\t\t\t);\n\t\t\tthis.ensureMetadata(ctx, errorLowFlowValue);\n\t\t\tthis.setValue(ctx, errorLowFlowValue, this.errorLowFlow);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"valve ID\": this.valveId,\n\t\t\tconnected: this.connected,\n\t\t\t\"nominal current\": `${this.nominalCurrent} mA`,\n\t\t};\n\t\tconst errors = [\n\t\t\tthis.errorShortCircuit ? \"short circuit\" : undefined,\n\t\t\tthis.errorHighCurrent ? \"current above high threshold\" : undefined,\n\t\t\tthis.errorLowCurrent ? \"current below low threshold\" : undefined,\n\t\t\tthis.errorMaximumFlow ? \"maximum flow\" : undefined,\n\t\t\tthis.errorHighFlow ? \"flow above high threshold\" : undefined,\n\t\t\tthis.errorLowFlow ? \"flow below low threshold\" : undefined,\n\t\t].filter(Boolean);\n\t\tif (errors.length > 0) {\n\t\t\tmessage.errors = errors.map((e) => `\\n\u00B7 ${e}`).join(\"\");\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveInfoGetOptions {\n\tvalveId: ValveId;\n}\n\nfunction testResponseForIrrigationCommandWithValveId(\n\tsent: {\n\t\tvalveId: ValveId;\n\t},\n\treceived: {\n\t\tvalveId: ValveId;\n\t},\n) {\n\treturn received.valveId === sent.valveId;\n}\n\n@CCCommand(IrrigationCommand.ValveInfoGet)\n@expectedCCResponse(\n\tIrrigationCCValveInfoReport,\n\ttestResponseForIrrigationCommandWithValveId as any,\n)\nexport class IrrigationCCValveInfoGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveInfoGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveInfoGet {\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 IrrigationCCValveInfoGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type IrrigationCCValveConfigSetOptions = {\n\tvalveId: ValveId;\n\tnominalCurrentHighThreshold: number;\n\tnominalCurrentLowThreshold: number;\n\tmaximumFlow: number;\n\thighFlowThreshold: number;\n\tlowFlowThreshold: number;\n\tuseRainSensor: boolean;\n\tuseMoistureSensor: boolean;\n};\n\n@CCCommand(IrrigationCommand.ValveConfigSet)\n@useSupervision()\nexport class IrrigationCCValveConfigSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t\tthis.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;\n\t\tthis.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;\n\t\tthis.maximumFlow = options.maximumFlow;\n\t\tthis.highFlowThreshold = options.highFlowThreshold;\n\t\tthis.lowFlowThreshold = options.lowFlowThreshold;\n\t\tthis.useRainSensor = options.useRainSensor;\n\t\tthis.useMoistureSensor = options.useMoistureSensor;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveConfigSet {\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 IrrigationCCValveConfigSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic nominalCurrentHighThreshold: number;\n\tpublic nominalCurrentLowThreshold: number;\n\tpublic maximumFlow: number;\n\tpublic highFlowThreshold: number;\n\tpublic lowFlowThreshold: number;\n\tpublic useRainSensor: boolean;\n\tpublic useMoistureSensor: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\n\t\t\t\tMath.floor(this.nominalCurrentHighThreshold / 10),\n\t\t\t\tMath.floor(this.nominalCurrentLowThreshold / 10),\n\t\t\t]),\n\t\t\tencodeFloatWithScale(this.maximumFlow, 0 /* l/h */),\n\t\t\tencodeFloatWithScale(this.highFlowThreshold, 0 /* l/h */),\n\t\t\tencodeFloatWithScale(this.lowFlowThreshold, 0 /* l/h */),\n\t\t\tBytes.from([\n\t\t\t\t(this.useRainSensor ? 0b1 : 0)\n\t\t\t\t| (this.useMoistureSensor ? 0b10 : 0),\n\t\t\t]),\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t\t\"nominal current high threshold\":\n\t\t\t\t\t`${this.nominalCurrentHighThreshold} mA`,\n\t\t\t\t\"nominal current low threshold\":\n\t\t\t\t\t`${this.nominalCurrentLowThreshold} mA`,\n\t\t\t\t\"maximum flow\": `${this.maximumFlow} l/h`,\n\t\t\t\t\"high flow threshold\": `${this.highFlowThreshold} l/h`,\n\t\t\t\t\"low flow threshold\": `${this.lowFlowThreshold} l/h`,\n\t\t\t\t\"use rain sensor\": this.useRainSensor,\n\t\t\t\t\"use moisture sensor\": this.useMoistureSensor,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveConfigReportOptions {\n\tvalveId: ValveId;\n\tnominalCurrentHighThreshold: number;\n\tnominalCurrentLowThreshold: number;\n\tmaximumFlow: number;\n\thighFlowThreshold: number;\n\tlowFlowThreshold: number;\n\tuseRainSensor: boolean;\n\tuseMoistureSensor: boolean;\n}\n\n@CCCommand(IrrigationCommand.ValveConfigReport)\nexport class IrrigationCCValveConfigReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.valveId = options.valveId;\n\t\tthis.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;\n\t\tthis.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;\n\t\tthis.maximumFlow = options.maximumFlow;\n\t\tthis.highFlowThreshold = options.highFlowThreshold;\n\t\tthis.lowFlowThreshold = options.lowFlowThreshold;\n\t\tthis.useRainSensor = options.useRainSensor;\n\t\tthis.useMoistureSensor = options.useMoistureSensor;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveConfigReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tlet valveId: ValveId;\n\t\tif ((raw.payload[0] & 0b1) === ValveType.MasterValve) {\n\t\t\tvalveId = \"master\";\n\t\t} else {\n\t\t\tvalveId = raw.payload[1];\n\t\t}\n\n\t\tconst nominalCurrentHighThreshold = 10 * raw.payload[2];\n\t\tconst nominalCurrentLowThreshold = 10 * raw.payload[3];\n\t\tlet offset = 4;\n\t\tlet maximumFlow;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\tmaximumFlow = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet highFlowThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\thighFlowThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tlet lowFlowThreshold;\n\t\t{\n\t\t\tconst { value, scale, bytesRead } = parseFloatWithScale(\n\t\t\t\traw.payload.subarray(offset),\n\t\t\t);\n\t\t\tvalidatePayload(scale === 0 /* l/h */);\n\t\t\tlowFlowThreshold = value;\n\t\t\toffset += bytesRead;\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= offset + 1);\n\t\tconst useRainSensor = !!(raw.payload[offset] & 0b1);\n\t\tconst useMoistureSensor = !!(raw.payload[offset] & 0b10);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tvalveId,\n\t\t\tnominalCurrentHighThreshold,\n\t\t\tnominalCurrentLowThreshold,\n\t\t\tmaximumFlow,\n\t\t\thighFlowThreshold,\n\t\t\tlowFlowThreshold,\n\t\t\tuseRainSensor,\n\t\t\tuseMoistureSensor,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// nominalCurrentHighThreshold\n\t\tconst nominalCurrentHighThresholdValue = IrrigationCCValues\n\t\t\t.nominalCurrentHighThreshold(this.valveId);\n\t\tthis.ensureMetadata(ctx, nominalCurrentHighThresholdValue);\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tnominalCurrentHighThresholdValue,\n\t\t\tthis.nominalCurrentHighThreshold,\n\t\t);\n\n\t\t// nominalCurrentLowThreshold\n\t\tconst nominalCurrentLowThresholdValue = IrrigationCCValues\n\t\t\t.nominalCurrentLowThreshold(this.valveId);\n\t\tthis.ensureMetadata(ctx, nominalCurrentLowThresholdValue);\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tnominalCurrentLowThresholdValue,\n\t\t\tthis.nominalCurrentLowThreshold,\n\t\t);\n\n\t\t// maximumFlow\n\t\tconst maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);\n\t\tthis.ensureMetadata(ctx, maximumFlowValue);\n\t\tthis.setValue(ctx, maximumFlowValue, this.maximumFlow);\n\n\t\t// highFlowThreshold\n\t\tconst highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, highFlowThresholdValue);\n\t\tthis.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);\n\n\t\t// lowFlowThreshold\n\t\tconst lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, lowFlowThresholdValue);\n\t\tthis.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);\n\n\t\t// useRainSensor\n\t\tconst useRainSensorValue = IrrigationCCValues.useRainSensor(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, useRainSensorValue);\n\t\tthis.setValue(ctx, useRainSensorValue, this.useRainSensor);\n\n\t\t// useMoistureSensor\n\t\tconst useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(\n\t\t\tthis.valveId,\n\t\t);\n\t\tthis.ensureMetadata(ctx, useMoistureSensorValue);\n\t\tthis.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);\n\n\t\treturn true;\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic nominalCurrentHighThreshold: number;\n\tpublic nominalCurrentLowThreshold: number;\n\tpublic maximumFlow: number;\n\tpublic highFlowThreshold: number;\n\tpublic lowFlowThreshold: number;\n\tpublic useRainSensor: boolean;\n\tpublic useMoistureSensor: boolean;\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\"valve ID\": this.valveId,\n\t\t\t\t\"nominal current high threshold\":\n\t\t\t\t\t`${this.nominalCurrentHighThreshold} mA`,\n\t\t\t\t\"nominal current low threshold\":\n\t\t\t\t\t`${this.nominalCurrentLowThreshold} mA`,\n\t\t\t\t\"maximum flow\": `${this.maximumFlow} l/h`,\n\t\t\t\t\"high flow threshold\": `${this.highFlowThreshold} l/h`,\n\t\t\t\t\"low flow threshold\": `${this.lowFlowThreshold} l/h`,\n\t\t\t\t\"use rain sensor\": this.useRainSensor,\n\t\t\t\t\"use moisture sensor\": this.useMoistureSensor,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveConfigGetOptions {\n\tvalveId: ValveId;\n}\n\n@CCCommand(IrrigationCommand.ValveConfigGet)\n@expectedCCResponse(\n\tIrrigationCCValveConfigReport,\n\ttestResponseForIrrigationCommandWithValveId as any,\n)\nexport class IrrigationCCValveConfigGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveConfigGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveConfigGet {\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 IrrigationCCValveConfigGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\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: {\n\t\t\t\t\"valve ID\": this.valveId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveRunOptions {\n\tvalveId: ValveId;\n\tduration: number;\n}\n\n@CCCommand(IrrigationCommand.ValveRun)\n@useSupervision()\nexport class IrrigationCCValveRun extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveRunOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.valveId = options.valveId;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveRun {\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 IrrigationCCValveRun({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic valveId: ValveId;\n\tpublic duration: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.valveId === \"master\" ? 1 : 0,\n\t\t\tthis.valveId === \"master\" ? 1 : this.valveId || 1,\n\t\t\t0,\n\t\t\t0,\n\t\t]);\n\t\tthis.payload.writeUInt16BE(this.duration, 2);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"valve ID\": this.valveId,\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = `${this.duration} s`;\n\t\t} else {\n\t\t\tmessage.action = \"turn off\";\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableSetOptions {\n\ttableId: number;\n\tentries: ValveTableEntry[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableSet)\n@useSupervision()\nexport class IrrigationCCValveTableSet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableId = options.tableId;\n\t\tthis.entries = options.entries;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableSet {\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 IrrigationCCValveTableSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableId: number;\n\tpublic entries: ValveTableEntry[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(1 + this.entries.length * 3);\n\t\tthis.payload[0] = this.tableId;\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst offset = 1 + i * 3;\n\t\t\tthis.payload[offset] = entry.valveId;\n\t\t\tthis.payload.writeUInt16BE(entry.duration, offset + 1);\n\t\t}\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"table ID\": this.tableId,\n\t\t};\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst valveLabel = entry.valveId.toString().padStart(3, \"0\");\n\t\t\tif (entry.duration) {\n\t\t\t\tmessage[`valve ${valveLabel} duration`] = `${entry.duration} s`;\n\t\t\t} else {\n\t\t\t\tmessage[`valve ${valveLabel} action`] = `turn off`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableReportOptions {\n\ttableId: number;\n\tentries: ValveTableEntry[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableReport)\nexport class IrrigationCCValveTableReport extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.tableId = options.tableId;\n\t\tthis.entries = options.entries;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): IrrigationCCValveTableReport {\n\t\tvalidatePayload((raw.payload.length - 1) % 3 === 0);\n\t\tconst tableId = raw.payload[0];\n\t\tconst entries: ValveTableEntry[] = [];\n\t\tfor (let offset = 1; offset < raw.payload.length; offset += 3) {\n\t\t\tentries.push({\n\t\t\t\tvalveId: raw.payload[offset],\n\t\t\t\tduration: raw.payload.readUInt16BE(offset + 1),\n\t\t\t});\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttableId,\n\t\t\tentries,\n\t\t});\n\t}\n\n\tpublic readonly tableId: number;\n\tpublic readonly entries: ValveTableEntry[];\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"table ID\": this.tableId,\n\t\t};\n\t\tfor (let i = 0; i < this.entries.length; i++) {\n\t\t\tconst entry = this.entries[i];\n\t\t\tconst valveLabel = entry.valveId.toString().padStart(3, \"0\");\n\t\t\tif (entry.duration) {\n\t\t\t\tmessage[`valve ${valveLabel} duration`] = `${entry.duration} s`;\n\t\t\t} else {\n\t\t\t\tmessage[`valve ${valveLabel} action`] = `turn off`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableGetOptions {\n\ttableId: number;\n}\n\nfunction testResponseForIrrigationValveTableGet(\n\tsent: IrrigationCCValveTableGet,\n\treceived: IrrigationCCValveTableReport,\n) {\n\treturn received.tableId === sent.tableId;\n}\n\n@CCCommand(IrrigationCommand.ValveTableGet)\n@expectedCCResponse(\n\tIrrigationCCValveTableReport,\n\ttestResponseForIrrigationValveTableGet,\n)\nexport class IrrigationCCValveTableGet extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableId = options.tableId;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableGet {\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 IrrigationCCValveTableGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.tableId]);\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\"table ID\": this.tableId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCValveTableRunOptions {\n\ttableIDs: number[];\n}\n\n@CCCommand(IrrigationCommand.ValveTableRun)\n@useSupervision()\nexport class IrrigationCCValveTableRun extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCValveTableRunOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.tableIDs = options.tableIDs;\n\t\tif (this.tableIDs.length < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${this.constructor.name}: At least one table ID must be specified.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCValveTableRun {\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 IrrigationCCValveTableRun({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic tableIDs: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from(this.tableIDs);\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\"table IDs\": this.tableIDs\n\t\t\t\t\t.map((id) => id.toString().padStart(3, \"0\"))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface IrrigationCCSystemShutoffOptions {\n\t/**\n\t * The duration in minutes the system must stay off.\n\t * 255 or `undefined` will prevent schedules from running.\n\t */\n\tduration?: number;\n}\n\n@CCCommand(IrrigationCommand.SystemShutoff)\n@useSupervision()\nexport class IrrigationCCSystemShutoff extends IrrigationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<IrrigationCCSystemShutoffOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): IrrigationCCSystemShutoff {\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 IrrigationCCSystemShutoff({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic duration?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.duration ?? 255]);\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\tduration: this.duration === 0\n\t\t\t\t\t? \"temporarily\"\n\t\t\t\t\t: this.duration === 255 || this.duration === undefined\n\t\t\t\t\t? \"permanently\"\n\t\t\t\t\t: `${this.duration} hours`,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAkBO;AACP,oBAA+C;AAE/C,iBAUO;AACP,0BAAkD;AAClD,0BAMO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAMO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwcP,MAAM,yBAAyB;EAC9B;EACA;EACA;EACA;EACA;;AAGD,MAAM,0BAA0B;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;;IAIY,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;;;;;;;;uCAAA,YAAK;WAAA;;;;;;;;AAmHzC,mBAAA,MAAA,MAAA,6BAAA,EAAA,MAAA,UAAA,MAAA,mBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,qBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,iBAAb,OAA4B,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAmB5B,mBAAA,MAAA,MAAA,0BAAA,EAAA,MAAA,UAAA,MAAA,gBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,kBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,cAAb,OAAyB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA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;;;;;;;AAA3D,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAAsD;AAEtD,YAAM,OAAO;AACb,WAAK,WAAW,QAAQ;IACzB;IAEO,OAAO,KACb,MACA,MAAsB;AAGtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,YAAY,GAAG,CAAC;AAChD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,UAAU,KAAK,aAAa,IACzB,gBACA,KAAK,aAAa,OAAO,KAAK,aAAa,SAC3C,gBACA,GAAG,KAAK,QAAQ;;;IAGtB;;;;",
|
|
6
6
|
"names": ["IrrigationCC"]
|
|
7
7
|
}
|
|
@@ -120,7 +120,7 @@ let LanguageCCAPI = (() => {
|
|
|
120
120
|
}
|
|
121
121
|
return super.supportsCommand(cmd);
|
|
122
122
|
}
|
|
123
|
-
//
|
|
123
|
+
// oxlint-disable-next-line typescript/explicit-module-boundary-types
|
|
124
124
|
async get() {
|
|
125
125
|
this.assertSupportsCommand(import_Types.LanguageCommand, import_Types.LanguageCommand.Get);
|
|
126
126
|
const cc = new LanguageCCGet({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/LanguageCC.ts"],
|
|
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 MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } 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 { LanguageCommand } from \"../lib/_Types.js\";\n\nexport const LanguageCCValues = V.defineCCValues(CommandClasses.Language, {\n\t...V.staticProperty(\n\t\t\"language\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\tlabel: \"Language code\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"country\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\tlabel: \"Country code\",\n\t\t} as const,\n\t),\n});\n\n// @noSetValueAPI It doesn't make sense\n\n@API(CommandClasses.Language)\nexport class LanguageCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: LanguageCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase LanguageCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase LanguageCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t//
|
|
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 MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } 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 { LanguageCommand } from \"../lib/_Types.js\";\n\nexport const LanguageCCValues = V.defineCCValues(CommandClasses.Language, {\n\t...V.staticProperty(\n\t\t\"language\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\tlabel: \"Language code\",\n\t\t} as const,\n\t),\n\t...V.staticProperty(\n\t\t\"country\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyString,\n\t\t\tlabel: \"Country code\",\n\t\t} as const,\n\t),\n});\n\n// @noSetValueAPI It doesn't make sense\n\n@API(CommandClasses.Language)\nexport class LanguageCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: LanguageCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase LanguageCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase LanguageCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(LanguageCommand, LanguageCommand.Get);\n\n\t\tconst cc = new LanguageCCGet({\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<LanguageCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"language\", \"country\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tlanguage: string,\n\t\tcountry?: string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(LanguageCommand, LanguageCommand.Set);\n\n\t\tconst cc = new LanguageCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tlanguage,\n\t\t\tcountry,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Language)\n@implementedVersion(1)\n@ccValues(LanguageCCValues)\nexport class LanguageCC extends CommandClass {\n\tdeclare ccCommand: LanguageCommand;\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.Language,\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: \"requesting language setting...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst resp = await api.get();\n\t\tif (resp) {\n\t\t\tconst { language, country } = resp;\n\t\t\tconst logMessage = `received current language setting: ${language}${\n\t\t\t\tcountry != undefined ? `-${country}` : \"\"\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface LanguageCCSetOptions {\n\tlanguage: string;\n\tcountry?: string;\n}\n\n@CCCommand(LanguageCommand.Set)\n@useSupervision()\nexport class LanguageCCSet extends LanguageCC {\n\tpublic constructor(\n\t\toptions: WithAddress<LanguageCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\t// Populate properties from options object\n\t\tthis._language = options.language;\n\t\tthis._country = options.country;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): LanguageCCSet {\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 LanguageCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tprivate _language: string;\n\tpublic get language(): string {\n\t\treturn this._language;\n\t}\n\tpublic set language(value: string) {\n\t\tif (value.length !== 3 || value.toLowerCase() !== value) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"language must be a 3 digit (lowercase) code according to ISO 639-2\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis._language = value;\n\t}\n\n\tprivate _country: MaybeNotKnown<string>;\n\tpublic get country(): MaybeNotKnown<string> {\n\t\treturn this._country;\n\t}\n\tpublic set country(value: MaybeNotKnown<string>) {\n\t\tif (\n\t\t\ttypeof value === \"string\"\n\t\t\t&& (value.length !== 2 || value.toUpperCase() !== value)\n\t\t) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"country must be a 2 digit (uppercase) code according to ISO 3166-1\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis._country = value;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from(this._language, \"ascii\");\n\t\tif (this._country) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from(this._country, \"ascii\"),\n\t\t\t]);\n\t\t}\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = { language: this.language };\n\t\tif (this._country != undefined) {\n\t\t\tmessage.country = this._country;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface LanguageCCReportOptions {\n\tlanguage: string;\n\tcountry: MaybeNotKnown<string>;\n}\n\n@CCCommand(LanguageCommand.Report)\n@ccValueProperty(\"language\", LanguageCCValues.language)\n@ccValueProperty(\"country\", LanguageCCValues.country)\nexport class LanguageCCReport extends LanguageCC {\n\tpublic constructor(\n\t\toptions: WithAddress<LanguageCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.language = options.language;\n\t\tthis.country = options.country;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): LanguageCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst language = raw.payload.subarray(0, 3).toString(\"ascii\");\n\t\tlet country: MaybeNotKnown<string>;\n\t\tif (raw.payload.length >= 5) {\n\t\t\tcountry = raw.payload.subarray(3, 5).toString(\"ascii\");\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tlanguage,\n\t\t\tcountry,\n\t\t});\n\t}\n\n\tpublic readonly language: string;\n\n\tpublic readonly country: MaybeNotKnown<string>;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = { language: this.language };\n\t\tif (this.country != undefined) {\n\t\t\tmessage.country = this.country;\n\t\t}\n\t\treturn {\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A,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
2
|
import { type WithAddress } from "@zwave-js/core";
|
|
3
|
-
import { Bytes } from "@zwave-js/shared";
|
|
3
|
+
import { Bytes, type BytesView } from "@zwave-js/shared";
|
|
4
4
|
import { CCAPI, type CCAPIEndpoint, type CCAPIHost } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
6
6
|
export type ManufacturerProprietaryCCConstructor<T extends typeof ManufacturerProprietaryCC = typeof ManufacturerProprietaryCC> = T & {
|
|
@@ -8,8 +8,8 @@ export type ManufacturerProprietaryCCConstructor<T extends typeof ManufacturerPr
|
|
|
8
8
|
};
|
|
9
9
|
export declare class ManufacturerProprietaryCCAPI extends CCAPI {
|
|
10
10
|
constructor(host: CCAPIHost, endpoint: CCAPIEndpoint);
|
|
11
|
-
sendData(manufacturerId: number, data?:
|
|
12
|
-
sendAndReceiveData(manufacturerId: number, data?:
|
|
11
|
+
sendData(manufacturerId: number, data?: BytesView): Promise<void>;
|
|
12
|
+
sendAndReceiveData(manufacturerId: number, data?: BytesView): Promise<{
|
|
13
13
|
manufacturerId: number | undefined;
|
|
14
14
|
data: Bytes;
|
|
15
15
|
} | undefined>;
|
|
@@ -17,7 +17,7 @@ export declare class ManufacturerProprietaryCCAPI extends CCAPI {
|
|
|
17
17
|
export interface ManufacturerProprietaryCCOptions {
|
|
18
18
|
manufacturerId?: number;
|
|
19
19
|
unspecifiedExpectsResponse?: boolean;
|
|
20
|
-
payload?:
|
|
20
|
+
payload?: BytesView;
|
|
21
21
|
}
|
|
22
22
|
export declare class ManufacturerProprietaryCC extends CommandClass {
|
|
23
23
|
ccCommand: undefined;
|
|
@@ -148,7 +148,7 @@ let ManufacturerProprietaryCCAPI = (() => {
|
|
|
148
148
|
};
|
|
149
149
|
return ManufacturerProprietaryCCAPI2 = _classThis;
|
|
150
150
|
})();
|
|
151
|
-
function getReponseForManufacturerProprietary(cc) {
|
|
151
|
+
function getReponseForManufacturerProprietary(ctx, cc) {
|
|
152
152
|
return cc.unspecifiedExpectsResponse ? ManufacturerProprietaryCC : void 0;
|
|
153
153
|
}
|
|
154
154
|
__name(getReponseForManufacturerProprietary, "getReponseForManufacturerProprietary");
|