/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MutableCluster } from "../cluster/mutation/MutableCluster.js";
import {
  FixedAttribute,
  OptionalFixedAttribute,
  OptionalAttribute,
  Attribute,
  OptionalWritableAttribute,
  WritableAttribute,
  OptionalEvent
} from "../cluster/Cluster.js";
import { TlvInt16, TlvUInt16, TlvBitmap, TlvEnum, TlvUInt24, TlvUInt32 } from "../tlv/TlvNumber.js";
import { TlvNullable } from "../tlv/TlvNullable.js";
import { BitFlag } from "../schema/BitmapSchema.js";
import { AccessLevel } from "@matter/model";
import { Priority } from "../globals/Priority.js";
import { TlvNoArguments } from "../tlv/TlvNoArguments.js";
import { ClusterRegistry } from "../cluster/ClusterRegistry.js";
var PumpConfigurationAndControl;
((PumpConfigurationAndControl2) => {
  let Feature;
  ((Feature2) => {
    Feature2["ConstantPressure"] = "ConstantPressure";
    Feature2["CompensatedPressure"] = "CompensatedPressure";
    Feature2["ConstantFlow"] = "ConstantFlow";
    Feature2["ConstantSpeed"] = "ConstantSpeed";
    Feature2["ConstantTemperature"] = "ConstantTemperature";
    Feature2["Automatic"] = "Automatic";
    Feature2["LocalOperation"] = "LocalOperation";
  })(Feature = PumpConfigurationAndControl2.Feature || (PumpConfigurationAndControl2.Feature = {}));
  PumpConfigurationAndControl2.PumpStatus = {
    /**
     * A fault related to the system or pump device is detected.
     *
     * If this bit is set, it may correspond to an event in the range 2-16, see Events.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.1
     */
    deviceFault: BitFlag(0),
    /**
     * A fault related to the supply to the pump is detected.
     *
     * If this bit is set, it may correspond to an event in the range 0-1 or 13, see Events.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.2
     */
    supplyFault: BitFlag(1),
    /**
     * Setpoint is too low to achieve.
     */
    speedLow: BitFlag(2),
    /**
     * Setpoint is too high to achieve.
     */
    speedHigh: BitFlag(3),
    /**
     * Device control is overridden by hardware, such as an external STOP button or via a local HMI.
     *
     * While this bit is set, the EffectiveOperationMode is adjusted to Local. Any request changing OperationMode
     * shall generate a FAILURE error status until LocalOverride is cleared on the physical device. When
     * LocalOverride is cleared, the device shall return to the operation mode set in OperationMode.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.3
     */
    localOverride: BitFlag(4),
    /**
     * Pump is currently running
     */
    running: BitFlag(5),
    /**
     * A remote pressure sensor is used as the sensor for the regulation of the pump.
     *
     * If this bit is set, EffectiveControlMode is ConstantPressure and the setpoint for the pump is interpreted as
     * a percentage of the range of the remote sensor ([MinMeasuredValue – MaxMeasuredValue]).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.4
     */
    remotePressure: BitFlag(6),
    /**
     * A remote flow sensor is used as the sensor for the regulation of the pump.
     *
     * If this bit is set, EffectiveControlMode is ConstantFlow, and the setpoint for the pump is interpreted as a
     * percentage of the range of the remote sensor ([MinMeasuredValue – MaxMeasuredValue]).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.5
     */
    remoteFlow: BitFlag(7),
    /**
     * A remote temperature sensor is used as the sensor for the regulation of the pump.
     *
     * If this bit is set, EffectiveControlMode is ConstantTemperature, and the setpoint for the pump is interpreted
     * as a percentage of the range of the remote sensor ([MinMeasuredValue – MaxMeasuredValue])
     *
     * @see {@link MatterSpecification.v142.Cluster} § 4.2.6.1.6
     */
    remoteTemperature: BitFlag(8)
  };
  let OperationMode;
  ((OperationMode2) => {
    OperationMode2[OperationMode2["Normal"] = 0] = "Normal";
    OperationMode2[OperationMode2["Minimum"] = 1] = "Minimum";
    OperationMode2[OperationMode2["Maximum"] = 2] = "Maximum";
    OperationMode2[OperationMode2["Local"] = 3] = "Local";
  })(OperationMode = PumpConfigurationAndControl2.OperationMode || (PumpConfigurationAndControl2.OperationMode = {}));
  let ControlMode;
  ((ControlMode2) => {
    ControlMode2[ControlMode2["ConstantSpeed"] = 0] = "ConstantSpeed";
    ControlMode2[ControlMode2["ConstantPressure"] = 1] = "ConstantPressure";
    ControlMode2[ControlMode2["ProportionalPressure"] = 2] = "ProportionalPressure";
    ControlMode2[ControlMode2["ConstantFlow"] = 3] = "ConstantFlow";
    ControlMode2[ControlMode2["ConstantTemperature"] = 5] = "ConstantTemperature";
    ControlMode2[ControlMode2["Automatic"] = 7] = "Automatic";
  })(ControlMode = PumpConfigurationAndControl2.ControlMode || (PumpConfigurationAndControl2.ControlMode = {}));
  PumpConfigurationAndControl2.ConstantPressureComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum pressure the pump can achieve when it is working with the
       * ControlMode attribute set to ConstantPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.4
       */
      minConstPressure: FixedAttribute(3, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the maximum pressure the pump can achieve when it is working with the
       * ControlMode attribute set to ConstantPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.5
       */
      maxConstPressure: FixedAttribute(4, TlvNullable(TlvInt16), { default: null })
    }
  });
  PumpConfigurationAndControl2.AutomaticComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum pressure the pump can achieve when it is working with the
       * ControlMode attribute set to ConstantPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.4
       */
      minConstPressure: OptionalFixedAttribute(3, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the maximum pressure the pump can achieve when it is working with the
       * ControlMode attribute set to ConstantPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.5
       */
      maxConstPressure: OptionalFixedAttribute(4, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the minimum compensated pressure the pump can achieve when it is working with
       * the ControlMode attribute set to ProportionalPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.6
       */
      minCompPressure: OptionalFixedAttribute(5, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the maximum compensated pressure the pump can achieve when it is working with
       * the ControlMode attribute set to ProportionalPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.7
       */
      maxCompPressure: OptionalFixedAttribute(6, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the minimum speed the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantSpeed.
       *
       * Valid range is 0 to 65,534 RPM (steps of 1 RPM). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.8
       */
      minConstSpeed: OptionalFixedAttribute(7, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the maximum speed the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantSpeed.
       *
       * Valid range is 0 to 65,534 RPM (steps of 1 RPM). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.9
       */
      maxConstSpeed: OptionalFixedAttribute(8, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the minimum flow the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantFlow.
       *
       * Valid range is 0 m^3/h to 6,553.4 m^3/h (steps of 0.1 m^3/h). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.10
       */
      minConstFlow: OptionalFixedAttribute(9, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the maximum flow the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantFlow.
       *
       * Valid range is 0 m^3/h to 6,553.4 m^3/h (steps of 0.1 m^3/h). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.11
       */
      maxConstFlow: OptionalFixedAttribute(10, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the minimum temperature the pump can maintain in the system when it is working
       * with the ControlMode attribute set to ConstantTemperature.
       *
       * Valid range is –273.15 °C to 327.67 °C (steps of 0.01 °C). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.12
       */
      minConstTemp: OptionalFixedAttribute(11, TlvNullable(TlvInt16.bound({ min: -27315 })), { default: null }),
      /**
       * This attribute specifies the maximum temperature the pump can maintain in the system when it is working
       * with the ControlMode attribute set to ConstantTemperature.
       *
       * MaxConstTemp shall be greater than or equal to MinConstTemp Valid range is –273.15 °C to 327.67 °C (steps
       * of 0.01 °C). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.13
       */
      maxConstTemp: OptionalFixedAttribute(12, TlvNullable(TlvInt16.bound({ min: -27315 })), { default: null })
    }
  });
  PumpConfigurationAndControl2.CompensatedPressureComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum compensated pressure the pump can achieve when it is working with
       * the ControlMode attribute set to ProportionalPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.6
       */
      minCompPressure: FixedAttribute(5, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the maximum compensated pressure the pump can achieve when it is working with
       * the ControlMode attribute set to ProportionalPressure.
       *
       * Valid range is –3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.7
       */
      maxCompPressure: FixedAttribute(6, TlvNullable(TlvInt16), { default: null })
    }
  });
  PumpConfigurationAndControl2.ConstantSpeedComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum speed the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantSpeed.
       *
       * Valid range is 0 to 65,534 RPM (steps of 1 RPM). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.8
       */
      minConstSpeed: FixedAttribute(7, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the maximum speed the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantSpeed.
       *
       * Valid range is 0 to 65,534 RPM (steps of 1 RPM). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.9
       */
      maxConstSpeed: FixedAttribute(8, TlvNullable(TlvUInt16), { default: null })
    }
  });
  PumpConfigurationAndControl2.ConstantFlowComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum flow the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantFlow.
       *
       * Valid range is 0 m^3/h to 6,553.4 m^3/h (steps of 0.1 m^3/h). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.10
       */
      minConstFlow: FixedAttribute(9, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the maximum flow the pump can achieve when it is working with the ControlMode
       * attribute set to ConstantFlow.
       *
       * Valid range is 0 m^3/h to 6,553.4 m^3/h (steps of 0.1 m^3/h). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.11
       */
      maxConstFlow: FixedAttribute(10, TlvNullable(TlvUInt16), { default: null })
    }
  });
  PumpConfigurationAndControl2.ConstantTemperatureComponent = MutableCluster.Component({
    attributes: {
      /**
       * This attribute specifies the minimum temperature the pump can maintain in the system when it is working
       * with the ControlMode attribute set to ConstantTemperature.
       *
       * Valid range is –273.15 °C to 327.67 °C (steps of 0.01 °C). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.12
       */
      minConstTemp: FixedAttribute(11, TlvNullable(TlvInt16.bound({ min: -27315 })), { default: null }),
      /**
       * This attribute specifies the maximum temperature the pump can maintain in the system when it is working
       * with the ControlMode attribute set to ConstantTemperature.
       *
       * MaxConstTemp shall be greater than or equal to MinConstTemp Valid range is –273.15 °C to 327.67 °C (steps
       * of 0.01 °C). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.13
       */
      maxConstTemp: FixedAttribute(12, TlvNullable(TlvInt16.bound({ min: -27315 })), { default: null })
    }
  });
  PumpConfigurationAndControl2.Base = MutableCluster.Component({
    id: 512,
    name: "PumpConfigurationAndControl",
    revision: 4,
    features: {
      /**
       * Supports operating in constant pressure mode
       */
      constantPressure: BitFlag(0),
      /**
       * Supports operating in compensated pressure mode
       */
      compensatedPressure: BitFlag(1),
      /**
       * Supports operating in constant flow mode
       */
      constantFlow: BitFlag(2),
      /**
       * Supports operating in constant speed mode
       */
      constantSpeed: BitFlag(3),
      /**
       * Supports operating in constant temperature mode
       */
      constantTemperature: BitFlag(4),
      /**
       * Supports operating in automatic mode
       */
      automatic: BitFlag(5),
      /**
       * Supports operating using local settings
       */
      localOperation: BitFlag(6)
    },
    attributes: {
      /**
       * This attribute specifies the maximum pressure the pump can achieve. It is a physical limit, and does not
       * apply to any specific control mode or operation mode.
       *
       * Valid range is -3,276.7 kPa to 3,276.7 kPa (steps of 0.1 kPa). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.1
       */
      maxPressure: FixedAttribute(0, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the maximum speed the pump can achieve. It is a physical limit, and does not
       * apply to any specific control mode or operation mode.
       *
       * Valid range is 0 to 65,534 RPM (steps of 1 RPM). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.2
       */
      maxSpeed: FixedAttribute(1, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the maximum flow the pump can achieve. It is a physical limit, and does not
       * apply to any specific control mode or operation mode.
       *
       * Valid range is 0 m^3/h to 6,553.4 m^3/h (steps of 0.1 m^3/h). Null if the value is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.3
       */
      maxFlow: FixedAttribute(2, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the activity status of the pump functions as listed in PumpStatusBitmap. Where a
       * pump controller function is active, the corresponding bit shall be set to 1. Where a pump controller
       * function is not active, the corresponding bit shall be set to 0.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.14
       */
      pumpStatus: OptionalAttribute(16, TlvBitmap(TlvUInt16, PumpConfigurationAndControl2.PumpStatus)),
      /**
       * This attribute specifies current effective operation mode of the pump as defined in OperationModeEnum.
       *
       * The value of the EffectiveOperationMode attribute is the same as the OperationMode attribute, unless one
       * of the following points are true:
       *
       *   - The pump is physically set to run with the local settings
       *
       *   - The LocalOverride bit in the PumpStatus attribute is set,
       *
       * See OperationMode Attribute and ControlMode Attribute for a detailed description of the operation and
       * control of the pump.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.15
       */
      effectiveOperationMode: Attribute(17, TlvEnum(), { persistent: true }),
      /**
       * This attribute specifies the current effective control mode of the pump as defined in ControlModeEnum.
       *
       * This attribute contains the control mode that currently applies to the pump. It will have the value of
       * the ControlMode attribute, unless one of the following points are true:
       *
       *   - The ControlMode attribute is set to Automatic. In this case, the value of the EffectiveControlMode
       *     shall match the behavior of the pump.
       *
       *   - A remote sensor is used as the sensor for regulation of the pump. In this case, EffectiveControlMode
       *     will display ConstantPressure, ConstantFlow or ConstantTemperature if the remote sensor is a pressure
       *     sensor, a flow sensor or a temperature sensor respectively, regardless of the value of the
       *     ControlMode attribute.
       *
       * In case the ControlMode attribute is not included on the device and no remote sensors are connected, the
       * value of the EffectiveControlMode shall match the vendor-specific behavior of the pump.
       *
       * See OperationMode Attribute and ControlMode Attribute for detailed a description of the operation and
       * control of the pump.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.16
       */
      effectiveControlMode: Attribute(18, TlvEnum(), { persistent: true }),
      /**
       * This attribute specifies the actual capacity of the pump as a percentage of the effective maximum
       * setpoint value. It is updated dynamically as the speed of the pump changes.
       *
       * If the value is not available (the measurement or estimation of the speed is done in the pump), this
       * attribute will indicate the null value.
       *
       * Valid range is 0 % to 163.835% (0.005 % granularity). Although this attribute is a signed value, values
       * of capacity less than zero have no physical meaning.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.17
       */
      capacity: Attribute(19, TlvNullable(TlvInt16), { default: null }),
      /**
       * This attribute specifies the actual speed of the pump measured in RPM. It is updated dynamically as the
       * speed of the pump changes.
       *
       * If the value is not available (the measurement or estimation of the speed is done in the pump), this
       * attribute will indicate the null value.
       *
       * Valid range is 0 to 65,534 RPM.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.18
       */
      speed: OptionalAttribute(20, TlvNullable(TlvUInt16), { default: null }),
      /**
       * This attribute specifies the accumulated number of hours that the pump has been powered and the motor has
       * been running. It is updated dynamically as it increases. It is preserved over power cycles of the pump.
       * If LifeTimeRunningHours rises above maximum value it “rolls over” and starts at 0 (zero).
       *
       * This attribute is writeable, in order to allow setting to an appropriate value after maintenance. If the
       * value is not available, this attribute will indicate the null value.
       *
       * Valid range is 0 to 16,777,214 hrs.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.19
       */
      lifetimeRunningHours: OptionalWritableAttribute(
        21,
        TlvNullable(TlvUInt24),
        { persistent: true, default: 0, writeAcl: AccessLevel.Manage }
      ),
      /**
       * This attribute specifies the actual power consumption of the pump in Watts. The value of this attribute
       * is updated dynamically as the power consumption of the pump changes.
       *
       * This attribute is read only. If the value is not available (the measurement of power consumption is not
       * done in the pump), this attribute will indicate the null value.
       *
       * Valid range is 0 to 16,777,214 Watts.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.20
       */
      power: OptionalAttribute(22, TlvNullable(TlvUInt24), { default: null }),
      /**
       * This attribute specifies the accumulated energy consumption of the pump through the entire lifetime of
       * the pump in kWh. The value of the LifetimeEnergyConsumed attribute is updated dynamically as the energy
       * consumption of the pump increases. If LifetimeEnergyConsumed rises above maximum value it “rolls over”
       * and starts at 0 (zero).
       *
       * This attribute is writeable, in order to allow setting to an appropriate value after maintenance.
       *
       * Valid range is 0 kWh to 4,294,967,294 kWh. Null if the value is unknown.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.21
       */
      lifetimeEnergyConsumed: OptionalWritableAttribute(
        23,
        TlvNullable(TlvUInt32),
        { persistent: true, default: 0, writeAcl: AccessLevel.Manage }
      ),
      /**
       * This attribute specifies the operation mode of the pump as defined in OperationModeEnum.
       *
       * The actual operating mode of the pump is a result of the setting of the attributes OperationMode,
       * ControlMode and the optional connection of a remote sensor. The operation and control is prioritized as
       * shown in the scheme below:
       *
       * If this attribute is Maximum, Minimum or Local, the OperationMode attribute decides how the pump is
       * operated.
       *
       * If this attribute is Normal and a remote sensor is connected to the pump, the type of the remote sensor
       * decides the control mode of the pump. A connected remote pressure sensor will make the pump run in
       * control mode Constant pressure and vice versa for flow and temperature type sensors. This is regardless
       * of the setting of the ControlMode attribute.
       *
       * If this attribute is Normal and no remote sensor is connected, the control mode of the pump is decided by
       * the ControlMode attribute.
       *
       * OperationMode may be changed at any time, even when the pump is running. The behavior of the pump at the
       * point of changing the value of this attribute is vendor-specific.
       *
       * In the case a device does not support a specific operation mode, the write interaction to this attribute
       * with an unsupported operation mode value shall be ignored and a response containing the status of
       * CONSTRAINT_ERROR shall be returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.22
       */
      operationMode: WritableAttribute(
        32,
        TlvEnum(),
        { persistent: true, default: 0 /* Normal */, writeAcl: AccessLevel.Manage }
      ),
      /**
       * This attribute specifies the control mode of the pump as defined in ControlModeEnum.
       *
       * See OperationMode Attribute for a detailed description of the operation and control of the pump.
       *
       * ControlMode may be changed at any time, even when the pump is running. The behavior of the pump at the
       * point of changing is vendor-specific.
       *
       * In the case a device does not support a specific control mode, the write interaction to this attribute
       * with an unsupported control mode value shall be ignored and a response containing the status of
       * CONSTRAINT_ERROR shall be returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7.23
       */
      controlMode: OptionalWritableAttribute(
        33,
        TlvEnum(),
        { persistent: true, default: 0 /* ConstantSpeed */, writeAcl: AccessLevel.Manage }
      ),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.7
       * @deprecated
       */
      alarmMask: OptionalWritableAttribute(34, TlvUInt16)
    },
    events: {
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      supplyVoltageLow: OptionalEvent(0, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      supplyVoltageHigh: OptionalEvent(1, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      powerMissingPhase: OptionalEvent(2, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      systemPressureLow: OptionalEvent(3, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      systemPressureHigh: OptionalEvent(4, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      dryRunning: OptionalEvent(5, Priority.Critical, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      motorTemperatureHigh: OptionalEvent(6, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      pumpMotorFatalFailure: OptionalEvent(7, Priority.Critical, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      electronicTemperatureHigh: OptionalEvent(8, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      pumpBlocked: OptionalEvent(9, Priority.Critical, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      sensorFailure: OptionalEvent(10, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      electronicNonFatalFailure: OptionalEvent(11, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      electronicFatalFailure: OptionalEvent(12, Priority.Critical, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      generalFault: OptionalEvent(13, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      leakage: OptionalEvent(14, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      airDetection: OptionalEvent(15, Priority.Info, TlvNoArguments),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 4.2.8
       */
      turbineOperation: OptionalEvent(16, Priority.Info, TlvNoArguments)
    },
    /**
     * This metadata controls which PumpConfigurationAndControlCluster elements matter.js activates for specific
     * feature combinations.
     */
    extensions: MutableCluster.Extensions(
      { flags: { constantPressure: true }, component: PumpConfigurationAndControl2.ConstantPressureComponent },
      { flags: { automatic: true }, component: PumpConfigurationAndControl2.AutomaticComponent },
      { flags: { compensatedPressure: true }, component: PumpConfigurationAndControl2.CompensatedPressureComponent },
      { flags: { constantSpeed: true }, component: PumpConfigurationAndControl2.ConstantSpeedComponent },
      { flags: { constantFlow: true }, component: PumpConfigurationAndControl2.ConstantFlowComponent },
      { flags: { constantTemperature: true }, component: PumpConfigurationAndControl2.ConstantTemperatureComponent },
      {
        flags: {
          constantPressure: false,
          compensatedPressure: false,
          constantFlow: false,
          constantSpeed: false,
          constantTemperature: false
        },
        component: false
      }
    )
  });
  PumpConfigurationAndControl2.ClusterInstance = MutableCluster.ExtensibleOnly(PumpConfigurationAndControl2.Base);
  PumpConfigurationAndControl2.Cluster = PumpConfigurationAndControl2.ClusterInstance;
  const PRSCONST = { constantPressure: true };
  const AUTO = { automatic: true };
  const PRSCOMP = { compensatedPressure: true };
  const SPD = { constantSpeed: true };
  const FLW = { constantFlow: true };
  const TEMP = { constantTemperature: true };
  PumpConfigurationAndControl2.CompleteInstance = MutableCluster({
    id: PumpConfigurationAndControl2.Base.id,
    name: PumpConfigurationAndControl2.Base.name,
    revision: PumpConfigurationAndControl2.Base.revision,
    features: PumpConfigurationAndControl2.Base.features,
    attributes: {
      ...PumpConfigurationAndControl2.Base.attributes,
      minConstPressure: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.ConstantPressureComponent.attributes.minConstPressure,
        { mandatoryIf: [PRSCONST], optionalIf: [AUTO] }
      ),
      maxConstPressure: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.ConstantPressureComponent.attributes.maxConstPressure,
        { mandatoryIf: [PRSCONST], optionalIf: [AUTO] }
      ),
      minCompPressure: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.minCompPressure,
        { optionalIf: [AUTO], mandatoryIf: [PRSCOMP] }
      ),
      maxCompPressure: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.maxCompPressure,
        { optionalIf: [AUTO], mandatoryIf: [PRSCOMP] }
      ),
      minConstSpeed: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.minConstSpeed,
        { optionalIf: [AUTO], mandatoryIf: [SPD] }
      ),
      maxConstSpeed: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.maxConstSpeed,
        { optionalIf: [AUTO], mandatoryIf: [SPD] }
      ),
      minConstFlow: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.minConstFlow,
        { optionalIf: [AUTO], mandatoryIf: [FLW] }
      ),
      maxConstFlow: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.maxConstFlow,
        { optionalIf: [AUTO], mandatoryIf: [FLW] }
      ),
      minConstTemp: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.minConstTemp,
        { optionalIf: [AUTO], mandatoryIf: [TEMP] }
      ),
      maxConstTemp: MutableCluster.AsConditional(
        PumpConfigurationAndControl2.AutomaticComponent.attributes.maxConstTemp,
        { optionalIf: [AUTO], mandatoryIf: [TEMP] }
      )
    },
    events: PumpConfigurationAndControl2.Base.events
  });
  PumpConfigurationAndControl2.Complete = PumpConfigurationAndControl2.CompleteInstance;
})(PumpConfigurationAndControl || (PumpConfigurationAndControl = {}));
const PumpConfigurationAndControlCluster = PumpConfigurationAndControl.Cluster;
ClusterRegistry.register(PumpConfigurationAndControl.Complete);
export {
  PumpConfigurationAndControl,
  PumpConfigurationAndControlCluster
};
//# sourceMappingURL=pump-configuration-and-control.js.map
