"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var pressure_measurement_exports = {};
__export(pressure_measurement_exports, {
  PressureMeasurement: () => PressureMeasurement,
  PressureMeasurementCluster: () => PressureMeasurementCluster
});
module.exports = __toCommonJS(pressure_measurement_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var PressureMeasurement;
((PressureMeasurement2) => {
  let Feature;
  ((Feature2) => {
    Feature2["Extended"] = "Extended";
  })(Feature = PressureMeasurement2.Feature || (PressureMeasurement2.Feature = {}));
  PressureMeasurement2.ExtendedComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the pressure in Pascals as follows:
       *
       * ScaledValue = 10Scale x Pressure [Pa]
       *
       * The null value indicates that the value is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.5
       */
      scaledValue: (0, import_Cluster.Attribute)(16, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16)),
      /**
       * Indicates the minimum value of ScaledValue that can be measured. The null value indicates that the value
       * is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.6
       */
      minScaledValue: (0, import_Cluster.Attribute)(17, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16.bound({ max: 32766 }))),
      /**
       * Indicates the maximum value of ScaledValue that can be measured. The null value indicates that the value
       * is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.7
       */
      maxScaledValue: (0, import_Cluster.Attribute)(18, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16)),
      /**
       * Indicates the magnitude of the possible error that is associated with Scaled
       *
       * ### Value. The true value is located in the range
       *
       * (ScaledValue – ScaledTolerance) to (ScaledValue + ScaledTolerance).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.8
       */
      scaledTolerance: (0, import_Cluster.OptionalAttribute)(19, import_TlvNumber.TlvUInt16.bound({ max: 2048 }), { default: 0 }),
      /**
       * Indicates the base 10 exponent used to obtain ScaledValue (see ScaledValue).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.9
       */
      scale: (0, import_Cluster.Attribute)(20, import_TlvNumber.TlvInt8.bound({ min: -127 }))
    }
  });
  PressureMeasurement2.Base = import_MutableCluster.MutableCluster.Component({
    id: 1027,
    name: "PressureMeasurement",
    revision: 3,
    features: {
      /**
       * Extended range and resolution
       */
      extended: (0, import_BitmapSchema.BitFlag)(0)
    },
    attributes: {
      /**
       * Indicates the pressure in kPa as follows:
       *
       * MeasuredValue = 10 x Pressure [kPa]
       *
       * The null value indicates that the value is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.1
       */
      measuredValue: (0, import_Cluster.Attribute)(0, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16)),
      /**
       * Indicates the minimum value of MeasuredValue that can be measured. See Measured Value for more details.
       *
       * The null value indicates that the value is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.2
       */
      minMeasuredValue: (0, import_Cluster.Attribute)(1, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16.bound({ max: 32766 }))),
      /**
       * Indicates the maximum value of MeasuredValue that can be measured. See Measured Value for more details.
       *
       * The null value indicates that the value is not available.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.3
       */
      maxMeasuredValue: (0, import_Cluster.Attribute)(2, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvInt16)),
      /**
       * See Measured Value.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.4.5.4
       */
      tolerance: (0, import_Cluster.OptionalAttribute)(3, import_TlvNumber.TlvUInt16.bound({ max: 2048 }), { default: 0 })
    },
    /**
     * This metadata controls which PressureMeasurementCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions({ flags: { extended: true }, component: PressureMeasurement2.ExtendedComponent })
  });
  PressureMeasurement2.ClusterInstance = (0, import_MutableCluster.MutableCluster)(PressureMeasurement2.Base);
  PressureMeasurement2.Cluster = PressureMeasurement2.ClusterInstance;
  const EXT = { extended: true };
  PressureMeasurement2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: PressureMeasurement2.Cluster.id,
    name: PressureMeasurement2.Cluster.name,
    revision: PressureMeasurement2.Cluster.revision,
    features: PressureMeasurement2.Cluster.features,
    attributes: {
      ...PressureMeasurement2.Cluster.attributes,
      scaledValue: import_MutableCluster.MutableCluster.AsConditional(PressureMeasurement2.ExtendedComponent.attributes.scaledValue, { mandatoryIf: [EXT] }),
      minScaledValue: import_MutableCluster.MutableCluster.AsConditional(
        PressureMeasurement2.ExtendedComponent.attributes.minScaledValue,
        { mandatoryIf: [EXT] }
      ),
      maxScaledValue: import_MutableCluster.MutableCluster.AsConditional(
        PressureMeasurement2.ExtendedComponent.attributes.maxScaledValue,
        { mandatoryIf: [EXT] }
      ),
      scaledTolerance: import_MutableCluster.MutableCluster.AsConditional(
        PressureMeasurement2.ExtendedComponent.attributes.scaledTolerance,
        { optionalIf: [EXT] }
      ),
      scale: import_MutableCluster.MutableCluster.AsConditional(PressureMeasurement2.ExtendedComponent.attributes.scale, { mandatoryIf: [EXT] })
    }
  });
  PressureMeasurement2.Complete = PressureMeasurement2.CompleteInstance;
})(PressureMeasurement || (PressureMeasurement = {}));
const PressureMeasurementCluster = PressureMeasurement.Cluster;
import_ClusterRegistry.ClusterRegistry.register(PressureMeasurement.Complete);
//# sourceMappingURL=pressure-measurement.js.map
