"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 illuminance_measurement_exports = {};
__export(illuminance_measurement_exports, {
  IlluminanceMeasurement: () => IlluminanceMeasurement,
  IlluminanceMeasurementCluster: () => IlluminanceMeasurementCluster
});
module.exports = __toCommonJS(illuminance_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_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var IlluminanceMeasurement;
((IlluminanceMeasurement2) => {
  let LightSensorType;
  ((LightSensorType2) => {
    LightSensorType2[LightSensorType2["Photodiode"] = 0] = "Photodiode";
    LightSensorType2[LightSensorType2["Cmos"] = 1] = "Cmos";
  })(LightSensorType = IlluminanceMeasurement2.LightSensorType || (IlluminanceMeasurement2.LightSensorType = {}));
  IlluminanceMeasurement2.ClusterInstance = (0, import_MutableCluster.MutableCluster)({
    id: 1024,
    name: "IlluminanceMeasurement",
    revision: 3,
    attributes: {
      /**
       * Indicates the illuminance in Lux (symbol lx) as follows:
       *
       *   • MeasuredValue = 10,000 x log10(illuminance) + 1,
       *
       * where 1 lx <= illuminance <= 3.576 Mlx, corresponding to a MeasuredValue in the range 1 to 0xFFFE. The
       * MeasuredValue attribute can take the following values:
       *
       *   • 0 indicates a value of illuminance that is too low to be measured,
       *
       *   • MinMeasuredValue <= MeasuredValue <= MaxMeasuredValue under normal circumstances,
       *
       *   • null indicates that the illuminance measurement is invalid.
       *
       * The MeasuredValue attribute is updated continuously as new measurements are made.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.2.5.1
       */
      measuredValue: (0, import_Cluster.Attribute)(0, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16)),
      /**
       * Indicates the minimum value of MeasuredValue that can be measured. A value of null indicates that this
       * attribute is not defined. See Measured Value for more details.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.2.5.2
       */
      minMeasuredValue: (0, import_Cluster.Attribute)(1, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16.bound({ min: 1, max: 65533 }))),
      /**
       * Indicates the maximum value of MeasuredValue that can be measured. A value of null indicates that this
       * attribute is not defined. See Measured Value for more details.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.2.5.3
       */
      maxMeasuredValue: (0, import_Cluster.Attribute)(2, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16)),
      /**
       * See Measured Value.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.2.5.4
       */
      tolerance: (0, import_Cluster.OptionalAttribute)(3, import_TlvNumber.TlvUInt16.bound({ max: 2048 })),
      /**
       * Indicates the electronic type of the light sensor. This attribute shall be set to one of the non-reserved
       * values listed in LightSensorTypeEnum or null in case the sensor type is unknown.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 2.2.5.5
       */
      lightSensorType: (0, import_Cluster.OptionalAttribute)(4, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8), { default: null })
    }
  });
  IlluminanceMeasurement2.Cluster = IlluminanceMeasurement2.ClusterInstance;
  IlluminanceMeasurement2.Complete = IlluminanceMeasurement2.Cluster;
})(IlluminanceMeasurement || (IlluminanceMeasurement = {}));
const IlluminanceMeasurementCluster = IlluminanceMeasurement.Cluster;
import_ClusterRegistry.ClusterRegistry.register(IlluminanceMeasurement.Complete);
//# sourceMappingURL=illuminance-measurement.js.map
