"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 power_source_exports = {};
__export(power_source_exports, {
  PowerSource: () => PowerSource,
  PowerSourceCluster: () => PowerSourceCluster
});
module.exports = __toCommonJS(power_source_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_TlvBoolean = require("../tlv/TlvBoolean.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_Priority = require("../globals/Priority.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_EndpointNumber = require("../datatype/EndpointNumber.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var PowerSource;
((PowerSource2) => {
  let Feature;
  ((Feature2) => {
    Feature2["Wired"] = "Wired";
    Feature2["Battery"] = "Battery";
    Feature2["Rechargeable"] = "Rechargeable";
    Feature2["Replaceable"] = "Replaceable";
  })(Feature = PowerSource2.Feature || (PowerSource2.Feature = {}));
  let WiredCurrentType;
  ((WiredCurrentType2) => {
    WiredCurrentType2[WiredCurrentType2["Ac"] = 0] = "Ac";
    WiredCurrentType2[WiredCurrentType2["Dc"] = 1] = "Dc";
  })(WiredCurrentType = PowerSource2.WiredCurrentType || (PowerSource2.WiredCurrentType = {}));
  let WiredFault;
  ((WiredFault2) => {
    WiredFault2[WiredFault2["Unspecified"] = 0] = "Unspecified";
    WiredFault2[WiredFault2["OverVoltage"] = 1] = "OverVoltage";
    WiredFault2[WiredFault2["UnderVoltage"] = 2] = "UnderVoltage";
  })(WiredFault = PowerSource2.WiredFault || (PowerSource2.WiredFault = {}));
  PowerSource2.TlvWiredFaultChangeEvent = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the set of faults currently detected, as per ActiveWiredFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.1.1
     */
    current: (0, import_TlvObject.TlvField)(0, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 })),
    /**
     * This field shall represent the set of faults detected prior to this change event, as per ActiveWiredFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.1.2
     */
    previous: (0, import_TlvObject.TlvField)(1, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 }))
  });
  let BatChargeLevel;
  ((BatChargeLevel2) => {
    BatChargeLevel2[BatChargeLevel2["Ok"] = 0] = "Ok";
    BatChargeLevel2[BatChargeLevel2["Warning"] = 1] = "Warning";
    BatChargeLevel2[BatChargeLevel2["Critical"] = 2] = "Critical";
  })(BatChargeLevel = PowerSource2.BatChargeLevel || (PowerSource2.BatChargeLevel = {}));
  let BatReplaceability;
  ((BatReplaceability2) => {
    BatReplaceability2[BatReplaceability2["Unspecified"] = 0] = "Unspecified";
    BatReplaceability2[BatReplaceability2["NotReplaceable"] = 1] = "NotReplaceable";
    BatReplaceability2[BatReplaceability2["UserReplaceable"] = 2] = "UserReplaceable";
    BatReplaceability2[BatReplaceability2["FactoryReplaceable"] = 3] = "FactoryReplaceable";
  })(BatReplaceability = PowerSource2.BatReplaceability || (PowerSource2.BatReplaceability = {}));
  let BatFault;
  ((BatFault2) => {
    BatFault2[BatFault2["Unspecified"] = 0] = "Unspecified";
    BatFault2[BatFault2["OverTemp"] = 1] = "OverTemp";
    BatFault2[BatFault2["UnderTemp"] = 2] = "UnderTemp";
  })(BatFault = PowerSource2.BatFault || (PowerSource2.BatFault = {}));
  PowerSource2.TlvBatFaultChangeEvent = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the set of faults currently detected, as per ActiveBatFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.2.1
     */
    current: (0, import_TlvObject.TlvField)(0, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 })),
    /**
     * This field shall represent the set of faults detected prior to this change event, as per ActiveBatFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.2.2
     */
    previous: (0, import_TlvObject.TlvField)(1, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 }))
  });
  let BatCommonDesignation;
  ((BatCommonDesignation2) => {
    BatCommonDesignation2[BatCommonDesignation2["Unspecified"] = 0] = "Unspecified";
    BatCommonDesignation2[BatCommonDesignation2["Aaa"] = 1] = "Aaa";
    BatCommonDesignation2[BatCommonDesignation2["Aa"] = 2] = "Aa";
    BatCommonDesignation2[BatCommonDesignation2["C"] = 3] = "C";
    BatCommonDesignation2[BatCommonDesignation2["D"] = 4] = "D";
    BatCommonDesignation2[BatCommonDesignation2["4V5"] = 5] = "4V5";
    BatCommonDesignation2[BatCommonDesignation2["6V0"] = 6] = "6V0";
    BatCommonDesignation2[BatCommonDesignation2["9V0"] = 7] = "9V0";
    BatCommonDesignation2[BatCommonDesignation2["12Aa"] = 8] = "12Aa";
    BatCommonDesignation2[BatCommonDesignation2["Aaaa"] = 9] = "Aaaa";
    BatCommonDesignation2[BatCommonDesignation2["A"] = 10] = "A";
    BatCommonDesignation2[BatCommonDesignation2["B"] = 11] = "B";
    BatCommonDesignation2[BatCommonDesignation2["F"] = 12] = "F";
    BatCommonDesignation2[BatCommonDesignation2["N"] = 13] = "N";
    BatCommonDesignation2[BatCommonDesignation2["No6"] = 14] = "No6";
    BatCommonDesignation2[BatCommonDesignation2["SubC"] = 15] = "SubC";
    BatCommonDesignation2[BatCommonDesignation2["A23"] = 16] = "A23";
    BatCommonDesignation2[BatCommonDesignation2["A27"] = 17] = "A27";
    BatCommonDesignation2[BatCommonDesignation2["Ba5800"] = 18] = "Ba5800";
    BatCommonDesignation2[BatCommonDesignation2["Duplex"] = 19] = "Duplex";
    BatCommonDesignation2[BatCommonDesignation2["4Sr44"] = 20] = "4Sr44";
    BatCommonDesignation2[BatCommonDesignation2["E523"] = 21] = "E523";
    BatCommonDesignation2[BatCommonDesignation2["E531"] = 22] = "E531";
    BatCommonDesignation2[BatCommonDesignation2["15V0"] = 23] = "15V0";
    BatCommonDesignation2[BatCommonDesignation2["22V5"] = 24] = "22V5";
    BatCommonDesignation2[BatCommonDesignation2["30V0"] = 25] = "30V0";
    BatCommonDesignation2[BatCommonDesignation2["45V0"] = 26] = "45V0";
    BatCommonDesignation2[BatCommonDesignation2["67V5"] = 27] = "67V5";
    BatCommonDesignation2[BatCommonDesignation2["J"] = 28] = "J";
    BatCommonDesignation2[BatCommonDesignation2["Cr123A"] = 29] = "Cr123A";
    BatCommonDesignation2[BatCommonDesignation2["Cr2"] = 30] = "Cr2";
    BatCommonDesignation2[BatCommonDesignation2["2Cr5"] = 31] = "2Cr5";
    BatCommonDesignation2[BatCommonDesignation2["CrP2"] = 32] = "CrP2";
    BatCommonDesignation2[BatCommonDesignation2["CrV3"] = 33] = "CrV3";
    BatCommonDesignation2[BatCommonDesignation2["Sr41"] = 34] = "Sr41";
    BatCommonDesignation2[BatCommonDesignation2["Sr43"] = 35] = "Sr43";
    BatCommonDesignation2[BatCommonDesignation2["Sr44"] = 36] = "Sr44";
    BatCommonDesignation2[BatCommonDesignation2["Sr45"] = 37] = "Sr45";
    BatCommonDesignation2[BatCommonDesignation2["Sr48"] = 38] = "Sr48";
    BatCommonDesignation2[BatCommonDesignation2["Sr54"] = 39] = "Sr54";
    BatCommonDesignation2[BatCommonDesignation2["Sr55"] = 40] = "Sr55";
    BatCommonDesignation2[BatCommonDesignation2["Sr57"] = 41] = "Sr57";
    BatCommonDesignation2[BatCommonDesignation2["Sr58"] = 42] = "Sr58";
    BatCommonDesignation2[BatCommonDesignation2["Sr59"] = 43] = "Sr59";
    BatCommonDesignation2[BatCommonDesignation2["Sr60"] = 44] = "Sr60";
    BatCommonDesignation2[BatCommonDesignation2["Sr63"] = 45] = "Sr63";
    BatCommonDesignation2[BatCommonDesignation2["Sr64"] = 46] = "Sr64";
    BatCommonDesignation2[BatCommonDesignation2["Sr65"] = 47] = "Sr65";
    BatCommonDesignation2[BatCommonDesignation2["Sr66"] = 48] = "Sr66";
    BatCommonDesignation2[BatCommonDesignation2["Sr67"] = 49] = "Sr67";
    BatCommonDesignation2[BatCommonDesignation2["Sr68"] = 50] = "Sr68";
    BatCommonDesignation2[BatCommonDesignation2["Sr69"] = 51] = "Sr69";
    BatCommonDesignation2[BatCommonDesignation2["Sr516"] = 52] = "Sr516";
    BatCommonDesignation2[BatCommonDesignation2["Sr731"] = 53] = "Sr731";
    BatCommonDesignation2[BatCommonDesignation2["Sr712"] = 54] = "Sr712";
    BatCommonDesignation2[BatCommonDesignation2["Lr932"] = 55] = "Lr932";
    BatCommonDesignation2[BatCommonDesignation2["A5"] = 56] = "A5";
    BatCommonDesignation2[BatCommonDesignation2["A10"] = 57] = "A10";
    BatCommonDesignation2[BatCommonDesignation2["A13"] = 58] = "A13";
    BatCommonDesignation2[BatCommonDesignation2["A312"] = 59] = "A312";
    BatCommonDesignation2[BatCommonDesignation2["A675"] = 60] = "A675";
    BatCommonDesignation2[BatCommonDesignation2["Ac41E"] = 61] = "Ac41E";
    BatCommonDesignation2[BatCommonDesignation2["E10180"] = 62] = "E10180";
    BatCommonDesignation2[BatCommonDesignation2["E10280"] = 63] = "E10280";
    BatCommonDesignation2[BatCommonDesignation2["E10440"] = 64] = "E10440";
    BatCommonDesignation2[BatCommonDesignation2["E14250"] = 65] = "E14250";
    BatCommonDesignation2[BatCommonDesignation2["E14430"] = 66] = "E14430";
    BatCommonDesignation2[BatCommonDesignation2["E14500"] = 67] = "E14500";
    BatCommonDesignation2[BatCommonDesignation2["E14650"] = 68] = "E14650";
    BatCommonDesignation2[BatCommonDesignation2["E15270"] = 69] = "E15270";
    BatCommonDesignation2[BatCommonDesignation2["E16340"] = 70] = "E16340";
    BatCommonDesignation2[BatCommonDesignation2["Rcr123A"] = 71] = "Rcr123A";
    BatCommonDesignation2[BatCommonDesignation2["E17500"] = 72] = "E17500";
    BatCommonDesignation2[BatCommonDesignation2["E17670"] = 73] = "E17670";
    BatCommonDesignation2[BatCommonDesignation2["E18350"] = 74] = "E18350";
    BatCommonDesignation2[BatCommonDesignation2["E18500"] = 75] = "E18500";
    BatCommonDesignation2[BatCommonDesignation2["E18650"] = 76] = "E18650";
    BatCommonDesignation2[BatCommonDesignation2["E19670"] = 77] = "E19670";
    BatCommonDesignation2[BatCommonDesignation2["E25500"] = 78] = "E25500";
    BatCommonDesignation2[BatCommonDesignation2["E26650"] = 79] = "E26650";
    BatCommonDesignation2[BatCommonDesignation2["E32600"] = 80] = "E32600";
  })(BatCommonDesignation = PowerSource2.BatCommonDesignation || (PowerSource2.BatCommonDesignation = {}));
  let BatApprovedChemistry;
  ((BatApprovedChemistry2) => {
    BatApprovedChemistry2[BatApprovedChemistry2["Unspecified"] = 0] = "Unspecified";
    BatApprovedChemistry2[BatApprovedChemistry2["Alkaline"] = 1] = "Alkaline";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumCarbonFluoride"] = 2] = "LithiumCarbonFluoride";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumChromiumOxide"] = 3] = "LithiumChromiumOxide";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumCopperOxide"] = 4] = "LithiumCopperOxide";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumIronDisulfide"] = 5] = "LithiumIronDisulfide";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumManganeseDioxide"] = 6] = "LithiumManganeseDioxide";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumThionylChloride"] = 7] = "LithiumThionylChloride";
    BatApprovedChemistry2[BatApprovedChemistry2["Magnesium"] = 8] = "Magnesium";
    BatApprovedChemistry2[BatApprovedChemistry2["MercuryOxide"] = 9] = "MercuryOxide";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelOxyhydride"] = 10] = "NickelOxyhydride";
    BatApprovedChemistry2[BatApprovedChemistry2["SilverOxide"] = 11] = "SilverOxide";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincAir"] = 12] = "ZincAir";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincCarbon"] = 13] = "ZincCarbon";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincChloride"] = 14] = "ZincChloride";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincManganeseDioxide"] = 15] = "ZincManganeseDioxide";
    BatApprovedChemistry2[BatApprovedChemistry2["LeadAcid"] = 16] = "LeadAcid";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumCobaltOxide"] = 17] = "LithiumCobaltOxide";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumIon"] = 18] = "LithiumIon";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumIonPolymer"] = 19] = "LithiumIonPolymer";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumIronPhosphate"] = 20] = "LithiumIronPhosphate";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumSulfur"] = 21] = "LithiumSulfur";
    BatApprovedChemistry2[BatApprovedChemistry2["LithiumTitanate"] = 22] = "LithiumTitanate";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelCadmium"] = 23] = "NickelCadmium";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelHydrogen"] = 24] = "NickelHydrogen";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelIron"] = 25] = "NickelIron";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelMetalHydride"] = 26] = "NickelMetalHydride";
    BatApprovedChemistry2[BatApprovedChemistry2["NickelZinc"] = 27] = "NickelZinc";
    BatApprovedChemistry2[BatApprovedChemistry2["SilverZinc"] = 28] = "SilverZinc";
    BatApprovedChemistry2[BatApprovedChemistry2["SodiumIon"] = 29] = "SodiumIon";
    BatApprovedChemistry2[BatApprovedChemistry2["SodiumSulfur"] = 30] = "SodiumSulfur";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincBromide"] = 31] = "ZincBromide";
    BatApprovedChemistry2[BatApprovedChemistry2["ZincCerium"] = 32] = "ZincCerium";
  })(BatApprovedChemistry = PowerSource2.BatApprovedChemistry || (PowerSource2.BatApprovedChemistry = {}));
  let BatChargeState;
  ((BatChargeState2) => {
    BatChargeState2[BatChargeState2["Unknown"] = 0] = "Unknown";
    BatChargeState2[BatChargeState2["IsCharging"] = 1] = "IsCharging";
    BatChargeState2[BatChargeState2["IsAtFullCharge"] = 2] = "IsAtFullCharge";
    BatChargeState2[BatChargeState2["IsNotCharging"] = 3] = "IsNotCharging";
  })(BatChargeState = PowerSource2.BatChargeState || (PowerSource2.BatChargeState = {}));
  let BatChargeFault;
  ((BatChargeFault2) => {
    BatChargeFault2[BatChargeFault2["Unspecified"] = 0] = "Unspecified";
    BatChargeFault2[BatChargeFault2["AmbientTooHot"] = 1] = "AmbientTooHot";
    BatChargeFault2[BatChargeFault2["AmbientTooCold"] = 2] = "AmbientTooCold";
    BatChargeFault2[BatChargeFault2["BatteryTooHot"] = 3] = "BatteryTooHot";
    BatChargeFault2[BatChargeFault2["BatteryTooCold"] = 4] = "BatteryTooCold";
    BatChargeFault2[BatChargeFault2["BatteryAbsent"] = 5] = "BatteryAbsent";
    BatChargeFault2[BatChargeFault2["BatteryOverVoltage"] = 6] = "BatteryOverVoltage";
    BatChargeFault2[BatChargeFault2["BatteryUnderVoltage"] = 7] = "BatteryUnderVoltage";
    BatChargeFault2[BatChargeFault2["ChargerOverVoltage"] = 8] = "ChargerOverVoltage";
    BatChargeFault2[BatChargeFault2["ChargerUnderVoltage"] = 9] = "ChargerUnderVoltage";
    BatChargeFault2[BatChargeFault2["SafetyTimeout"] = 10] = "SafetyTimeout";
  })(BatChargeFault = PowerSource2.BatChargeFault || (PowerSource2.BatChargeFault = {}));
  PowerSource2.TlvBatChargeFaultChangeEvent = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the set of faults currently detected, as per ActiveBatChargeFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.3.1
     */
    current: (0, import_TlvObject.TlvField)(0, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 16 })),
    /**
     * This field shall represent the set of faults detected prior to this change event, as per
     * ActiveBatChargeFaults.
     *
     * @see {@link MatterSpecification.v142.Core} § 11.7.8.3.2
     */
    previous: (0, import_TlvObject.TlvField)(1, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 16 }))
  });
  let PowerSourceStatus;
  ((PowerSourceStatus2) => {
    PowerSourceStatus2[PowerSourceStatus2["Unspecified"] = 0] = "Unspecified";
    PowerSourceStatus2[PowerSourceStatus2["Active"] = 1] = "Active";
    PowerSourceStatus2[PowerSourceStatus2["Standby"] = 2] = "Standby";
    PowerSourceStatus2[PowerSourceStatus2["Unavailable"] = 3] = "Unavailable";
  })(PowerSourceStatus = PowerSource2.PowerSourceStatus || (PowerSource2.PowerSourceStatus = {}));
  PowerSource2.WiredComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the assessed RMS or DC voltage currently provided by the hard-wired source, in mV (millivolts).
       * A value of NULL shall indicate the Node is currently unable to assess the value. If the wired source is
       * not connected, but the Node is still able to assess a value, then the assessed value may be reported.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.4
       */
      wiredAssessedInputVoltage: (0, import_Cluster.OptionalAttribute)(3, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32), { omitChanges: true }),
      /**
       * Indicates the assessed frequency of the voltage, currently provided by the hard-wired source, in Hz. A
       * value of NULL shall indicate the Node is currently unable to assess the value. If the wired source is not
       * connected, but the Node is still able to assess a value, then the assessed value may be reported.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.5
       */
      wiredAssessedInputFrequency: (0, import_Cluster.OptionalAttribute)(4, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16), { omitChanges: true }),
      /**
       * Indicates the type of current the Node expects to be provided by the hard-wired source as specified in
       * WiredCurrentTypeEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.6
       */
      wiredCurrentType: (0, import_Cluster.FixedAttribute)(5, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the assessed instantaneous current draw of the Node on the hard-wired source, in mA
       * (milliamps). A value of NULL shall indicate the Node is currently unable to assess the value. If the
       * wired source is not connected, but the Node is still able to assess a value, then the assessed value may
       * be reported.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.7
       */
      wiredAssessedCurrent: (0, import_Cluster.OptionalAttribute)(6, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32), { omitChanges: true }),
      /**
       * Indicates the nominal voltage, printed as part of the Node’s regulatory compliance label in mV
       * (millivolts), expected to be provided by the hard-wired source.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.8
       */
      wiredNominalVoltage: (0, import_Cluster.OptionalFixedAttribute)(7, import_TlvNumber.TlvUInt32),
      /**
       * Indicates the maximum current, printed as part of the Node’s regulatory compliance label in mA
       * (milliamps), expected to be provided by the hard-wired source.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.9
       */
      wiredMaximumCurrent: (0, import_Cluster.OptionalFixedAttribute)(8, import_TlvNumber.TlvUInt32),
      /**
       * Indicates if the Node detects that the hard-wired power source is properly connected.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.10
       */
      wiredPresent: (0, import_Cluster.OptionalAttribute)(9, import_TlvBoolean.TlvBoolean),
      /**
       * Indicates the set of wired faults currently detected by the Node on this power source. This set is
       * represented as a list of WiredFaultEnum. When the Node detects a fault has been raised, the appropriate
       * WiredFaultEnum value shall be added to this list, provided it is not already present. This list shall NOT
       * contain more than one instance of a specific WiredFaultEnum value. When the Node detects all conditions
       * contributing to a fault have been cleared, the corresponding WiredFaultEnum value shall be removed from
       * this list. An empty list shall indicate there are currently no active faults. The order of this list
       * SHOULD have no significance. Clients interested in monitoring changes in active faults may subscribe to
       * this attribute, or they may subscribe to WiredFaultChange.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.11
       */
      activeWiredFaults: (0, import_Cluster.OptionalAttribute)(
        10,
        (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 }),
        { default: [] }
      )
    },
    events: {
      /**
       * The WiredFaultChange Event shall be generated when the set of wired faults currently detected by the Node
       * on this wired power source changes. This event shall correspond to a change in value of
       * ActiveWiredFaults.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.8.1
       */
      wiredFaultChange: (0, import_Cluster.OptionalEvent)(0, import_Priority.Priority.Info, PowerSource2.TlvWiredFaultChangeEvent)
    }
  });
  PowerSource2.BatteryComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the currently measured output voltage of the battery in mV (millivolts). A value of NULL shall
       * indicate the Node is currently unable to assess the value.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.12
       */
      batVoltage: (0, import_Cluster.OptionalAttribute)(11, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32), { omitChanges: true }),
      /**
       * Indicates the estimated percentage of battery charge remaining until the battery will no longer be able
       * to provide power to the Node. Values are expressed in half percent units, ranging from 0 to 200. E.g. a
       * value of 48 is equivalent to 24%. A value of NULL shall indicate the Node is currently unable to assess
       * the value.
       *
       * Changes to this attribute shall only be marked as reportable in the following cases:
       *
       *   • At most once every 10 seconds, or
       *
       *   • When it changes from null to any other value and vice versa.
       *
       * Since reporting consumes power, devices SHOULD be careful not to over-report.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.13
       */
      batPercentRemaining: (0, import_Cluster.OptionalAttribute)(12, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8.bound({ max: 200 }))),
      /**
       * Indicates the estimated time in seconds before the battery will no longer be able to provide power to the
       * Node. A value of NULL shall indicate the Node is currently unable to assess the value.
       *
       * Changes to this attribute shall only be marked as reportable in the following cases:
       *
       *   • At most once every 10 seconds, or
       *
       *   • When it changes from null to any other value and vice versa.
       *
       * Since reporting consumes power, devices SHOULD be careful not to over-report.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.14
       */
      batTimeRemaining: (0, import_Cluster.OptionalAttribute)(13, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32)),
      /**
       * Indicates a coarse ranking of the charge level of the battery, used to indicate when intervention is
       * required as specified in BatChargeLevelEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.15
       */
      batChargeLevel: (0, import_Cluster.Attribute)(14, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates if the battery needs to be replaced. Replacement may be simple routine maintenance, such as
       * with a single use, non-rechargeable cell. Replacement, however, may also indicate end of life, or serious
       * fault with a rechargeable or even non-replaceable cell.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.16
       */
      batReplacementNeeded: (0, import_Cluster.Attribute)(15, import_TlvBoolean.TlvBoolean),
      /**
       * Indicates the replaceability of the battery as specified in BatReplaceabilityEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.17
       */
      batReplaceability: (0, import_Cluster.FixedAttribute)(16, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates whether the Node detects that the batteries are properly installed.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.18
       */
      batPresent: (0, import_Cluster.OptionalAttribute)(17, import_TlvBoolean.TlvBoolean),
      /**
       * Indicates the set of battery faults currently detected by the Node on this power source. This set is
       * represented as a list of BatFaultEnum. When the Node detects a fault has been raised, the appropriate
       * BatFaultEnum value shall be added to this list, provided it is not already present. This list shall NOT
       * contain more than one instance of a specific BatFaultEnum value. When the Node detects all conditions
       * contributing to a fault have been cleared, the corresponding BatFaultEnum value shall be removed from
       * this list. An empty list shall indicate there are currently no active faults. The order of this list
       * SHOULD have no significance. Clients interested in monitoring changes in active faults may subscribe to
       * this attribute, or they may subscribe to BatFaultChange.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.19
       */
      activeBatFaults: (0, import_Cluster.OptionalAttribute)(18, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 8 }), { default: [] })
    },
    events: {
      /**
       * The BatFaultChange Event shall be generated when the set of battery faults currently detected by the Node
       * on this battery power source changes. This event shall correspond to a change in value of
       * ActiveBatFaults.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.8.2
       */
      batFaultChange: (0, import_Cluster.OptionalEvent)(1, import_Priority.Priority.Info, PowerSource2.TlvBatFaultChangeEvent)
    }
  });
  PowerSource2.ReplaceableComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * This attribute shall provide a user-facing description of this battery, which SHOULD contain information
       * required to identify a replacement, such as form factor, chemistry or preferred manufacturer.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.20
       */
      batReplacementDescription: (0, import_Cluster.FixedAttribute)(19, import_TlvString.TlvString.bound({ maxLength: 60 })),
      /**
       * Indicates the ID of the common or colloquial designation of the battery, as specified in
       * BatCommonDesignationEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.21
       */
      batCommonDesignation: (0, import_Cluster.OptionalFixedAttribute)(20, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the string representing the ANSI designation for the battery as specified in ANSI C18.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.22
       */
      batAnsiDesignation: (0, import_Cluster.OptionalFixedAttribute)(21, import_TlvString.TlvString.bound({ maxLength: 20 })),
      /**
       * Indicates the string representing the IEC designation for the battery as specified in IEC 60086.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.23
       */
      batIecDesignation: (0, import_Cluster.OptionalFixedAttribute)(22, import_TlvString.TlvString.bound({ maxLength: 20 })),
      /**
       * Indicates the ID of the preferred chemistry of the battery source as specified in
       * BatApprovedChemistryEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.24
       */
      batApprovedChemistry: (0, import_Cluster.OptionalFixedAttribute)(23, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the quantity of individual, user- or factory-serviceable battery cells or packs in the battery
       * source.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.26
       */
      batQuantity: (0, import_Cluster.FixedAttribute)(25, import_TlvNumber.TlvUInt8)
    }
  });
  PowerSource2.ReplaceableOrRechargeableComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the preferred minimum charge capacity rating in mAh of individual, user- or factory-serviceable
       * battery cells or packs in the battery source.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.25
       */
      batCapacity: (0, import_Cluster.OptionalFixedAttribute)(24, import_TlvNumber.TlvUInt32)
    }
  });
  PowerSource2.RechargeableComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the current state of the battery source with respect to charging as specified in
       * BatChargeStateEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.27
       */
      batChargeState: (0, import_Cluster.Attribute)(26, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the estimated time in seconds before the battery source will be at full charge. A value of NULL
       * shall indicate the Node is currently unable to assess the value.
       *
       * Changes to this attribute shall only be marked as reportable in the following cases:
       *
       *   • At most once every 10 seconds, or
       *
       *   • When it changes from null to any other value and vice versa.
       *
       * Since reporting consumes power, devices SHOULD be careful not to over-report.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.28
       */
      batTimeToFullCharge: (0, import_Cluster.OptionalAttribute)(27, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32)),
      /**
       * Indicates whether the Node can remain operational while the battery source is charging.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.29
       */
      batFunctionalWhileCharging: (0, import_Cluster.Attribute)(28, import_TlvBoolean.TlvBoolean),
      /**
       * Indicates assessed current in mA (milliamps) presently supplied to charge the battery source. A value of
       * NULL shall indicate the Node is currently unable to assess the value.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.30
       */
      batChargingCurrent: (0, import_Cluster.OptionalAttribute)(29, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32), { omitChanges: true }),
      /**
       * Indicates the set of charge faults currently detected by the Node on this power source. This set is
       * represented as a list of BatChargeFaultEnum. When the Node detects a fault has been raised, the
       * appropriate BatChargeFaultEnum value shall be added to this list, provided it is not already present.
       * This list shall NOT contain more than one instance of a specific BatChargeFaultEnum value. When the Node
       * detects all conditions contributing to a fault have been cleared, the corresponding BatChargeFaultEnum
       * value shall be removed from this list. An empty list shall indicate there are currently no active faults.
       * The order of this list SHOULD have no significance. Clients interested in monitoring changes in active
       * faults may subscribe to this attribute, or they may subscribe to the BatFaultChange event.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.31
       */
      activeBatChargeFaults: (0, import_Cluster.OptionalAttribute)(
        30,
        (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 16 }),
        { default: [] }
      )
    },
    events: {
      /**
       * The BatChargeFaultChange Event shall be generated when the set of charge faults currently detected by the
       * Node on this battery power source changes. This event shall correspond to a change in value of
       * ActiveBatChargeFaults.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.8.3
       */
      batChargeFaultChange: (0, import_Cluster.OptionalEvent)(2, import_Priority.Priority.Info, PowerSource2.TlvBatChargeFaultChangeEvent)
    }
  });
  PowerSource2.Base = import_MutableCluster.MutableCluster.Component({
    id: 47,
    name: "PowerSource",
    revision: 3,
    features: {
      /**
       * A wired power source
       */
      wired: (0, import_BitmapSchema.BitFlag)(0),
      /**
       * A battery power source
       */
      battery: (0, import_BitmapSchema.BitFlag)(1),
      /**
       * A rechargeable battery power source
       */
      rechargeable: (0, import_BitmapSchema.BitFlag)(2),
      /**
       * A replaceable battery power source
       */
      replaceable: (0, import_BitmapSchema.BitFlag)(3)
    },
    attributes: {
      /**
       * Indicates the participation of this power source in providing power to the Node as specified in
       * PowerSourceStatusEnum.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.1
       */
      status: (0, import_Cluster.Attribute)(0, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the relative preference with which the Node will select this source to provide power. A source
       * with a lower order shall be selected by the Node to provide power before any other source with a higher
       * order, if the lower order source is available (see Section 11.7.7.1, “Status Attribute”).
       *
       * Note, Order is read-only and therefore NOT intended to allow clients control over power source selection.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.2
       */
      order: (0, import_Cluster.Attribute)(1, import_TlvNumber.TlvUInt8, { persistent: true }),
      /**
       * This attribute shall provide a user-facing description of this source, used to distinguish it from other
       * power sources, e.g. "DC Power", "Primary Battery" or "Battery back-up". This attribute shall NOT be used
       * to convey information such as battery form factor, or chemistry.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.3
       */
      description: (0, import_Cluster.FixedAttribute)(2, import_TlvString.TlvString.bound({ maxLength: 60 })),
      /**
       * Indicates a list of endpoints that are powered by the source defined by this cluster. Multiple instances
       * of this cluster may list the same endpoint, because it is possible for power for an endpoint to come from
       * multiple sources. In that case the Order attribute indicates their priority.
       *
       * For each power source on a node, there shall only be one instance of this cluster.
       *
       * A cluster instance with an empty list shall indicate that the power source is for the entire node, which
       * includes all endpoints.
       *
       * A cluster instance with a non-empty list shall include the endpoint, upon which the cluster instance
       * resides.
       *
       * The above rules allow that some endpoints can have an unknown power source, and therefore would not be
       * indicated by any instance of this cluster.
       *
       * ### Empty list examples
       *
       * Typically, there is one power source for the node. Also common is mains power for the node with battery
       * backup power for the node. In both these common cases, for each cluster instance described, the list is
       * empty.
       *
       * ### Populated list example
       *
       * A node has a mains power source with Order as 0 (zero), but some application endpoints (not all) have a
       * battery back up source with Order as 1, which means this list is empty for the Power Source cluster
       * associated with the mains power, because it indicates the entire node, but the Power Source cluster
       * instance associated with the battery backup would list the endpoints that have a battery backup.
       *
       * @see {@link MatterSpecification.v142.Core} § 11.7.7.32
       */
      endpointList: (0, import_Cluster.Attribute)(31, (0, import_TlvArray.TlvArray)(import_EndpointNumber.TlvEndpointNumber), { default: [] })
    },
    /**
     * This metadata controls which PowerSourceCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions(
      { flags: { wired: true }, component: PowerSource2.WiredComponent },
      { flags: { battery: true }, component: PowerSource2.BatteryComponent },
      { flags: { replaceable: true }, component: PowerSource2.ReplaceableComponent },
      { flags: { replaceable: true }, component: PowerSource2.ReplaceableOrRechargeableComponent },
      { flags: { rechargeable: true }, component: PowerSource2.ReplaceableOrRechargeableComponent },
      { flags: { rechargeable: true }, component: PowerSource2.RechargeableComponent },
      { flags: { rechargeable: true, battery: false }, component: false },
      { flags: { replaceable: true, battery: false }, component: false },
      { flags: { wired: true, battery: true }, component: false },
      { flags: { wired: false, battery: false }, component: false }
    )
  });
  PowerSource2.ClusterInstance = import_MutableCluster.MutableCluster.ExtensibleOnly(PowerSource2.Base);
  PowerSource2.Cluster = PowerSource2.ClusterInstance;
  const WIRED = { wired: true };
  const BAT = { battery: true };
  const REPLC = { replaceable: true };
  const RECHG = { rechargeable: true };
  PowerSource2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: PowerSource2.Base.id,
    name: PowerSource2.Base.name,
    revision: PowerSource2.Base.revision,
    features: PowerSource2.Base.features,
    attributes: {
      ...PowerSource2.Base.attributes,
      wiredAssessedInputVoltage: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredAssessedInputVoltage,
        { optionalIf: [WIRED] }
      ),
      wiredAssessedInputFrequency: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredAssessedInputFrequency,
        { optionalIf: [WIRED] }
      ),
      wiredCurrentType: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredCurrentType,
        { mandatoryIf: [WIRED] }
      ),
      wiredAssessedCurrent: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredAssessedCurrent,
        { optionalIf: [WIRED] }
      ),
      wiredNominalVoltage: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredNominalVoltage,
        { optionalIf: [WIRED] }
      ),
      wiredMaximumCurrent: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.wiredMaximumCurrent,
        { optionalIf: [WIRED] }
      ),
      wiredPresent: import_MutableCluster.MutableCluster.AsConditional(PowerSource2.WiredComponent.attributes.wiredPresent, { optionalIf: [WIRED] }),
      activeWiredFaults: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.attributes.activeWiredFaults,
        { optionalIf: [WIRED] }
      ),
      batVoltage: import_MutableCluster.MutableCluster.AsConditional(PowerSource2.BatteryComponent.attributes.batVoltage, { optionalIf: [BAT] }),
      batPercentRemaining: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.batPercentRemaining,
        { optionalIf: [BAT] }
      ),
      batTimeRemaining: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.batTimeRemaining,
        { optionalIf: [BAT] }
      ),
      batChargeLevel: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.batChargeLevel,
        { mandatoryIf: [BAT] }
      ),
      batReplacementNeeded: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.batReplacementNeeded,
        { mandatoryIf: [BAT] }
      ),
      batReplaceability: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.batReplaceability,
        { mandatoryIf: [BAT] }
      ),
      batPresent: import_MutableCluster.MutableCluster.AsConditional(PowerSource2.BatteryComponent.attributes.batPresent, { optionalIf: [BAT] }),
      activeBatFaults: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.BatteryComponent.attributes.activeBatFaults,
        { optionalIf: [BAT] }
      ),
      batReplacementDescription: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batReplacementDescription,
        { mandatoryIf: [REPLC] }
      ),
      batCommonDesignation: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batCommonDesignation,
        { optionalIf: [REPLC] }
      ),
      batAnsiDesignation: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batAnsiDesignation,
        { optionalIf: [REPLC] }
      ),
      batIecDesignation: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batIecDesignation,
        { optionalIf: [REPLC] }
      ),
      batApprovedChemistry: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batApprovedChemistry,
        { optionalIf: [REPLC] }
      ),
      batCapacity: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableOrRechargeableComponent.attributes.batCapacity,
        { optionalIf: [REPLC, RECHG] }
      ),
      batQuantity: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.ReplaceableComponent.attributes.batQuantity,
        { mandatoryIf: [REPLC] }
      ),
      batChargeState: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.attributes.batChargeState,
        { mandatoryIf: [RECHG] }
      ),
      batTimeToFullCharge: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.attributes.batTimeToFullCharge,
        { optionalIf: [RECHG] }
      ),
      batFunctionalWhileCharging: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.attributes.batFunctionalWhileCharging,
        { mandatoryIf: [RECHG] }
      ),
      batChargingCurrent: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.attributes.batChargingCurrent,
        { optionalIf: [RECHG] }
      ),
      activeBatChargeFaults: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.attributes.activeBatChargeFaults,
        { optionalIf: [RECHG] }
      )
    },
    events: {
      wiredFaultChange: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.WiredComponent.events.wiredFaultChange,
        { optionalIf: [WIRED] }
      ),
      batFaultChange: import_MutableCluster.MutableCluster.AsConditional(PowerSource2.BatteryComponent.events.batFaultChange, { optionalIf: [BAT] }),
      batChargeFaultChange: import_MutableCluster.MutableCluster.AsConditional(
        PowerSource2.RechargeableComponent.events.batChargeFaultChange,
        { optionalIf: [RECHG] }
      )
    }
  });
  PowerSource2.Complete = PowerSource2.CompleteInstance;
})(PowerSource || (PowerSource = {}));
const PowerSourceCluster = PowerSource.Cluster;
import_ClusterRegistry.ClusterRegistry.register(PowerSource.Complete);
//# sourceMappingURL=power-source.js.map
