"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 BallastConfiguration_exports = {};
__export(BallastConfiguration_exports, {
  BallastConfiguration: () => BallastConfiguration
});
module.exports = __toCommonJS(BallastConfiguration_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const BallastConfiguration = (0, import_elements.ClusterElement)(
  {
    name: "BallastConfiguration",
    id: 769,
    classification: "application",
    pics: "BC",
    details: "This cluster is used for configuring a lighting ballast.\nNOTE Support for Ballast Configuration cluster is provisional.",
    xref: { document: "cluster", section: "3.3" }
  },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 4 }),
  (0, import_elements.AttributeElement)({
    name: "PhysicalMinLevel",
    id: 0,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "1 to 254",
    default: 1,
    details: "This attribute shall specify the minimum light output the ballast can achieve according to the dimming light curve (see Dimming Curve).",
    xref: { document: "cluster", section: "3.3.6.1" }
  }),
  (0, import_elements.AttributeElement)({
    name: "PhysicalMaxLevel",
    id: 1,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "1 to 254",
    default: 254,
    details: "This attribute shall specify the maximum light output the ballast can achieve according to the dimming light curve (see Dimming Curve).",
    xref: { document: "cluster", section: "3.3.6.2" }
  }),
  (0, import_elements.AttributeElement)({
    name: "BallastStatus",
    id: 2,
    type: "BallastStatusBitmap",
    access: "R V",
    conformance: "O",
    default: 0,
    details: "This attribute shall specify the status of various aspects of the ballast or the connected lights, see BallastStatusBitmap.",
    xref: { document: "cluster", section: "3.3.6.3" }
  }),
  (0, import_elements.AttributeElement)({
    name: "MinLevel",
    id: 16,
    type: "uint8",
    access: "RW VM",
    conformance: "M",
    constraint: "physicalMinLevel to maxLevel",
    default: { type: "reference", name: "PhysicalMinLevel" },
    details: "This attribute shall specify the light output of the ballast according to the dimming light curve (see Dimming Curve) when the Level Control Cluster\u2019s CurrentLevel attribute equals to 1 (and the On/Off Cluster\u2019s OnOff attribute equals to TRUE).\nThe 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.",
    xref: { document: "cluster", section: "3.3.6.4" }
  }),
  (0, import_elements.AttributeElement)({
    name: "MaxLevel",
    id: 17,
    type: "uint8",
    access: "RW VM",
    conformance: "M",
    constraint: "minLevel to physicalMaxLevel",
    default: { type: "reference", name: "PhysicalMaxLevel" },
    details: "This attribute shall specify the light output of the ballast according to the dimming light curve\n(see Dimming Curve) when the Level Control Cluster\u2019s CurrentLevel attribute equals to 254 (and the On/Off Cluster\u2019s OnOff attribute equals to TRUE).\nThe 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.",
    xref: { document: "cluster", section: "3.3.6.5" }
  }),
  (0, import_elements.AttributeElement)({ name: "PowerOnLevel", id: 18, conformance: "D", xref: { document: "cluster", section: "3.3.6" } }),
  (0, import_elements.AttributeElement)({ name: "PowerOnFadeTime", id: 19, conformance: "D", xref: { document: "cluster", section: "3.3.6" } }),
  (0, import_elements.AttributeElement)({
    name: "IntrinsicBallastFactor",
    id: 20,
    type: "uint8",
    access: "RW VM",
    conformance: "O",
    quality: "X",
    details: "This attribute shall specify the ballast factor, as a percentage, of the ballast/lamp combination, prior to any adjustment.\nA value of null indicates in invalid value.",
    xref: { document: "cluster", section: "3.3.6.6" }
  }),
  (0, import_elements.AttributeElement)(
    {
      name: "BallastFactorAdjustment",
      id: 21,
      type: "uint8",
      access: "RW VM",
      conformance: "O",
      constraint: "100 to ms",
      default: null,
      quality: "X",
      details: "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.\nThe light output is given by\nactual light output = configured light output x BallastFactorAdjustment / 100%\nThe 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.",
      xref: { document: "cluster", section: "3.3.6.7" }
    }
  ),
  (0, import_elements.AttributeElement)({
    name: "LampQuantity",
    id: 32,
    type: "uint8",
    access: "R V",
    conformance: "M",
    details: "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).",
    xref: { document: "cluster", section: "3.3.6.8" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampType",
    id: 48,
    type: "string",
    access: "RW VM",
    conformance: "O",
    constraint: "max 16",
    default: "",
    details: "This attribute shall specify the type of lamps (including their wattage) connected to the ballast.",
    xref: { document: "cluster", section: "3.3.6.9" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampManufacturer",
    id: 49,
    type: "string",
    access: "RW VM",
    conformance: "O",
    constraint: "max 16",
    default: "",
    details: "This attribute shall specify the name of the manufacturer of the currently connected lamps.",
    xref: { document: "cluster", section: "3.3.6.10" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampRatedHours",
    id: 50,
    type: "uint24",
    access: "RW VM",
    conformance: "O",
    default: null,
    quality: "X",
    details: "This attribute shall specify the number of hours of use the lamps are rated for by the manufacturer.\nA value of null indicates an invalid or unknown time.",
    xref: { document: "cluster", section: "3.3.6.11" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampBurnHours",
    id: 51,
    type: "uint24",
    access: "RW VM",
    conformance: "O",
    default: 0,
    quality: "X",
    details: "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.\nThis 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.\nA value of null indicates an invalid or unknown time.",
    xref: { document: "cluster", section: "3.3.6.12" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampAlarmMode",
    id: 52,
    type: "LampAlarmModeBitmap",
    access: "RW VM",
    conformance: "O",
    default: 0,
    details: "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.\nNOTE All alarms are also logged in the alarm table \u2013 see Alarms cluster.",
    xref: { document: "cluster", section: "3.3.6.13" }
  }),
  (0, import_elements.AttributeElement)({
    name: "LampBurnHoursTripPoint",
    id: 53,
    type: "uint24",
    access: "RW VM",
    conformance: "O",
    default: null,
    quality: "X",
    details: "This attribute shall specify the number of hours the LampBurnHours attribute may reach before an alarm is generated.\nIf the Alarms cluster is not present on the same device this attribute is not used and thus may be omitted (see Dependencies).\nThe Alarm Code field included in the generated alarm shall be 0x01.\nIf this attribute has the value of null, then this alarm shall NOT be generated.",
    xref: { document: "cluster", section: "3.3.6.14" }
  }),
  (0, import_elements.DatatypeElement)(
    { name: "BallastStatusBitmap", type: "map8", xref: { document: "cluster", section: "3.3.5.1" } },
    (0, import_elements.FieldElement)(
      {
        name: "BallastNonOperational",
        constraint: "0",
        description: "Operational state of the ballast.",
        details: "This bit shall indicate whether the ballast is operational.\n  \u2022 0 = The ballast is fully operational\n  \u2022 1 = The ballast is not fully operational",
        xref: { document: "cluster", section: "3.3.5.1.1" }
      }
    ),
    (0, import_elements.FieldElement)(
      {
        name: "LampFailure",
        constraint: "1",
        description: "Operational state of the lamps.",
        details: "This bit shall indicate whether all lamps is operational.\n  \u2022 0 = All lamps are operational\n  \u2022 1 = One or more lamp is not in its socket or is faulty",
        xref: { document: "cluster", section: "3.3.5.1.2" }
      }
    )
  ),
  (0, import_elements.DatatypeElement)(
    { name: "LampAlarmModeBitmap", type: "map8", xref: { document: "cluster", section: "3.3.5.2" } },
    (0, import_elements.FieldElement)({
      name: "LampBurnHours",
      constraint: "0",
      description: "State of LampBurnHours alarm generation",
      details: "This bit shall indicate that the LampBurnHours attribute may generate an alarm.",
      xref: { document: "cluster", section: "3.3.5.2.1" }
    })
  )
);
import_MatterDefinition.MatterDefinition.children.push(BallastConfiguration);
//# sourceMappingURL=BallastConfiguration.js.map
