"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 ballast_configuration_exports = {};
__export(ballast_configuration_exports, {
  BallastConfiguration: () => BallastConfiguration,
  BallastConfigurationCluster: () => BallastConfigurationCluster
});
module.exports = __toCommonJS(ballast_configuration_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_BitmapSchema = require("../schema/BitmapSchema.js");
var import_model = require("#model");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var BallastConfiguration;
((BallastConfiguration2) => {
  BallastConfiguration2.BallastStatus = {
    /**
     * Operational state of the ballast.
     *
     * This bit shall indicate whether the ballast is operational.
     *
     *   • 0 = The ballast is fully operational
     *
     *   • 1 = The ballast is not fully operational
     *
     * @see {@link MatterSpecification.v13.Cluster} § 3.3.5.1.1
     */
    ballastNonOperational: (0, import_BitmapSchema.BitFlag)(0),
    /**
     * Operational state of the lamps.
     *
     * This bit shall indicate whether all lamps is operational.
     *
     *   • 0 = All lamps are operational
     *
     *   • 1 = One or more lamp is not in its socket or is faulty
     *
     * @see {@link MatterSpecification.v13.Cluster} § 3.3.5.1.2
     */
    lampFailure: (0, import_BitmapSchema.BitFlag)(1)
  };
  BallastConfiguration2.LampAlarmMode = {
    /**
     * State of LampBurnHours alarm generation
     *
     * This bit shall indicate that the LampBurnHours attribute may generate an alarm.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 3.3.5.2.1
     */
    lampBurnHours: (0, import_BitmapSchema.BitFlag)(0)
  };
  BallastConfiguration2.ClusterInstance = (0, import_MutableCluster.MutableCluster)({
    id: 769,
    name: "BallastConfiguration",
    revision: 4,
    attributes: {
      /**
       * This attribute shall specify the minimum light output the ballast can achieve according to the dimming
       * light curve (see Dimming Curve).
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.1
       */
      physicalMinLevel: (0, import_Cluster.Attribute)(0, import_TlvNumber.TlvUInt8.bound({ min: 1, max: 254 }), { default: 1 }),
      /**
       * This attribute shall specify the maximum light output the ballast can achieve according to the dimming
       * light curve (see Dimming Curve).
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.2
       */
      physicalMaxLevel: (0, import_Cluster.Attribute)(1, import_TlvNumber.TlvUInt8.bound({ min: 1, max: 254 }), { default: 254 }),
      /**
       * This attribute shall specify the status of various aspects of the ballast or the connected lights, see
       * BallastStatusBitmap.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.3
       */
      ballastStatus: (0, import_Cluster.OptionalAttribute)(2, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, BallastConfiguration2.BallastStatus)),
      /**
       * This attribute shall specify the light output of the ballast according to the dimming light curve (see
       * Dimming Curve) when the Level Control Cluster’s CurrentLevel attribute equals to 1 (and the On/Off
       * Cluster’s OnOff attribute equals to TRUE).
       *
       * The value of this attribute shall be both greater than or equal to PhysicalMinLevel and less than or
       * equal to MaxLevel. If an attempt is made to set this attribute to a level where these conditions are not
       * met, a response shall be returned with status code set to CONSTRAINT_ERROR, and the level shall NOT be
       * set.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.4
       */
      minLevel: (0, import_Cluster.WritableAttribute)(16, import_TlvNumber.TlvUInt8, { writeAcl: import_model.AccessLevel.Manage }),
      /**
       * This attribute shall specify the light output of the ballast according to the dimming light curve
       *
       * (see Dimming Curve) when the Level Control Cluster’s CurrentLevel attribute equals to 254 (and the
       * On/Off Cluster’s OnOff attribute equals to TRUE).
       *
       * The value of this attribute shall be both less than or equal to PhysicalMaxLevel and greater than or
       * equal to MinLevel. If an attempt is made to set this attribute to a level where these conditions are not
       * met, a response shall be returned with status code set to CONSTRAINT_ERROR, and the level shall NOT be
       * set.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.5
       */
      maxLevel: (0, import_Cluster.WritableAttribute)(17, import_TlvNumber.TlvUInt8, { writeAcl: import_model.AccessLevel.Manage }),
      /**
       * This attribute shall specify the ballast factor, as a percentage, of the ballast/lamp combination, prior
       * to any adjustment.
       *
       * A value of null indicates in invalid value.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.6
       */
      intrinsicBallastFactor: (0, import_Cluster.OptionalWritableAttribute)(
        20,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8),
        { writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the multiplication factor, as a percentage, to be applied to the configured
       * light output of the lamps. A typical use for this attribute is to compensate for reduction in efficiency
       * over the lifetime of a lamp.
       *
       * The light output is given by
       *
       * actual light output = configured light output x BallastFactorAdjustment / 100%
       *
       * The range for this attribute is manufacturer dependent. If an attempt is made to set this attribute to a
       * level that cannot be supported, a response shall be returned with status code set to CONSTRAINT_ERROR,
       * and the level shall NOT be changed. The value of null indicates that ballast factor scaling is not in
       * use.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.7
       */
      ballastFactorAdjustment: (0, import_Cluster.OptionalWritableAttribute)(
        21,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8.bound({ min: 100 })),
        { default: null, writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the number of lamps connected to this ballast. (Note 1: this number does
       * not take into account whether lamps are actually in their sockets or not).
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.8
       */
      lampQuantity: (0, import_Cluster.Attribute)(32, import_TlvNumber.TlvUInt8),
      /**
       * This attribute shall specify the type of lamps (including their wattage) connected to the ballast.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.9
       */
      lampType: (0, import_Cluster.OptionalWritableAttribute)(
        48,
        import_TlvString.TlvString.bound({ maxLength: 16 }),
        { default: "", writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the name of the manufacturer of the currently connected lamps.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.10
       */
      lampManufacturer: (0, import_Cluster.OptionalWritableAttribute)(
        49,
        import_TlvString.TlvString.bound({ maxLength: 16 }),
        { default: "", writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the number of hours of use the lamps are rated for by the manufacturer.
       *
       * A value of null indicates an invalid or unknown time.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.11
       */
      lampRatedHours: (0, import_Cluster.OptionalWritableAttribute)(
        50,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt24),
        { default: null, writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the length of time, in hours, the currently connected lamps have been
       * operated, cumulative since the last re-lamping. Burn hours shall NOT be accumulated if the lamps are off.
       *
       * This attribute SHOULD be reset to zero (e.g., remotely) when the lamps are changed. If partially used
       * lamps are connected, LampBurnHours SHOULD be updated to reflect the burn hours of the lamps.
       *
       * A value of null indicates an invalid or unknown time.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.12
       */
      lampBurnHours: (0, import_Cluster.OptionalWritableAttribute)(
        51,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt24),
        { default: 0, writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify which attributes may cause an alarm notification to be generated. Ain each
       * bit position means that its associated attribute is able to generate an alarm.
       *
       * NOTE All alarms are also logged in the alarm table – see Alarms cluster.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.13
       */
      lampAlarmMode: (0, import_Cluster.OptionalWritableAttribute)(
        52,
        (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, BallastConfiguration2.LampAlarmMode),
        { writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * This attribute shall specify the number of hours the LampBurnHours attribute may reach before an alarm
       * is generated.
       *
       * If the Alarms cluster is not present on the same device this attribute is not used and thus may be
       * omitted (see Dependencies).
       *
       * The Alarm Code field included in the generated alarm shall be 0x01.
       *
       * If this attribute has the value of null, then this alarm shall NOT be generated.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 3.3.6.14
       */
      lampBurnHoursTripPoint: (0, import_Cluster.OptionalWritableAttribute)(
        53,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt24),
        { default: null, writeAcl: import_model.AccessLevel.Manage }
      )
    }
  });
  BallastConfiguration2.Cluster = BallastConfiguration2.ClusterInstance;
  BallastConfiguration2.Complete = BallastConfiguration2.Cluster;
})(BallastConfiguration || (BallastConfiguration = {}));
const BallastConfigurationCluster = BallastConfiguration.Cluster;
import_ClusterRegistry.ClusterRegistry.register(BallastConfiguration.Complete);
//# sourceMappingURL=ballast-configuration.js.map
