"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 oven_cavity_operational_state_exports = {};
__export(oven_cavity_operational_state_exports, {
  OvenCavityOperationalState: () => OvenCavityOperationalState,
  OvenCavityOperationalStateCluster: () => OvenCavityOperationalStateCluster
});
module.exports = __toCommonJS(oven_cavity_operational_state_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_operational_state = require("./operational-state.js");
var import_TlvNoArguments = require("../tlv/TlvNoArguments.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_Priority = require("../globals/Priority.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var OvenCavityOperationalState;
((OvenCavityOperationalState2) => {
  OvenCavityOperationalState2.TlvOperationalCommandResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This shall indicate the success or otherwise of the attempted command invocation. On a successful invocation
     * of the attempted command, the ErrorStateID shall be populated with NoError. See the individual command
     * sections for additional specific requirements on population.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 1.14.6.5.1
     */
    commandResponseState: (0, import_TlvObject.TlvField)(0, import_operational_state.OperationalState.TlvErrorStateStruct)
  });
  OvenCavityOperationalState2.ClusterInstance = (0, import_MutableCluster.MutableCluster)({
    id: 72,
    name: "OvenCavityOperationalState",
    revision: 2,
    attributes: {
      /**
       * Indicates a list of names of different phases that the device can go through for the selected function or
       * mode. The list may not be in sequence order. For example in a washing machine this could include items
       * such as "pre-soak", "rinse", and "spin". These phases are manufacturer specific and may change when a
       * different function or mode is selected.
       *
       * A null value indicates that the device does not present phases during its operation. When this
       * attribute’s value is null, the CurrentPhase attribute shall also be set to null.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.1
       */
      phaseList: (0, import_Cluster.Attribute)(0, (0, import_TlvNullable.TlvNullable)((0, import_TlvArray.TlvArray)(import_TlvString.TlvString, { maxLength: 32 }))),
      /**
       * This attribute represents the current phase of operation being performed by the server. This shall be the
       * positional index representing the value from the set provided in the PhaseList Attribute, where the first
       * item in that list is an index of 0. Thus, this attribute shall have a maximum value that is
       * "length(PhaseList) - 1".
       *
       * Null if the PhaseList attribute is null or if the PhaseList attribute is an empty list.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.2
       */
      currentPhase: (0, import_Cluster.Attribute)(1, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8)),
      /**
       * Indicates the estimated time left before the operation is completed, in seconds.
       *
       * A value of 0 (zero) means that the operation has completed.
       *
       * A value of null represents that there is no time currently defined until operation completion. This may
       * happen, for example, because no operation is in progress or because the completion time is unknown.
       *
       * Changes to this attribute shall only be marked as reportable in the following cases:
       *
       *   - If it has changed due to a change in the CurrentPhase or OperationalState attributes, or
       *
       *   - When it changes from 0 to any other value and vice versa, or
       *
       *   - When it changes from null to any other value and vice versa, or
       *
       *   - When it increases, or
       *
       *   - When there is any increase or decrease in the estimated time remaining that was due to progressing
       *     insight of the server’s control logic, or
       *
       *   - When it changes at a rate significantly different from one unit per second.
       *
       * Changes to this attribute merely due to the normal passage of time with no other dynamic change of device
       * state shall NOT be reported.
       *
       * As this attribute is not being reported during a regular countdown, clients SHOULD NOT rely on the
       * reporting of this attribute in order to keep track of the remaining duration.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.3
       */
      countdownTime: (0, import_Cluster.OptionalAttribute)(2, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32.bound({ max: 259200 })), { default: null }),
      /**
       * This attribute describes the set of possible operational states that the device exposes. An operational
       * state is a fundamental device state such as Running or Error. Details of the phase of a device when, for
       * example, in a state of Running are provided by the CurrentPhase attribute.
       *
       * All devices shall, at a minimum, expose the set of states matching the commands that are also supported
       * by the cluster instance, in addition to Error. The set of possible device states are defined in the
       * OperationalStateEnum. A device type requiring implementation of this cluster shall define the set of
       * states that are applicable to that specific device type.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.4
       */
      operationalStateList: (0, import_Cluster.Attribute)(3, (0, import_TlvArray.TlvArray)(import_operational_state.OperationalState.TlvOperationalStateStruct), { default: [] }),
      /**
       * This attribute specifies the current operational state of a device. This shall be populated with a valid
       * OperationalStateID from the set of values in the OperationalStateList Attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.5
       */
      operationalState: (0, import_Cluster.Attribute)(4, (0, import_TlvNumber.TlvEnum)()),
      /**
       * This attribute shall specify the details of any current error condition being experienced on the device
       * when the OperationalState attribute is populated with Error. See Section 1.14.4.4, “ErrorStateStruct
       * Type” for general requirements on the population of this attribute.
       *
       * When there is no error detected, this shall have an ErrorStateID of NoError.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.5.6
       */
      operationalError: (0, import_Cluster.Attribute)(5, import_operational_state.OperationalState.TlvErrorStateStruct)
    },
    commands: {
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 8.10.5
       */
      stop: (0, import_Cluster.Command)(1, import_TlvNoArguments.TlvNoArguments, 4, OvenCavityOperationalState2.TlvOperationalCommandResponse),
      /**
       * @see {@link MatterSpecification.v142.Cluster} § 8.10.5
       */
      start: (0, import_Cluster.Command)(2, import_TlvNoArguments.TlvNoArguments, 4, OvenCavityOperationalState2.TlvOperationalCommandResponse)
    },
    events: {
      /**
       * This event is generated when a reportable error condition is detected. A device that generates this event
       * shall also set the OperationalState attribute to Error, indicating an error condition.
       *
       * This event shall contain the following fields:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.7.1
       */
      operationalError: (0, import_Cluster.Event)(0, import_Priority.Priority.Critical, import_operational_state.OperationalState.TlvOperationalErrorEvent),
      /**
       * This event SHOULD be generated when the overall operation ends, successfully or otherwise. For example,
       * the completion of a cleaning operation in a Robot Vacuum Cleaner, or the completion of a wash cycle in a
       * Washing Machine.
       *
       * It is highly recommended that appliances device types employing the Operational State cluster support
       * this event, even if it is optional. This assists clients in executing automations or issuing
       * notifications at critical points in the device operation cycles.
       *
       * This event shall contain the following fields:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.14.7.2
       */
      operationCompletion: (0, import_Cluster.OptionalEvent)(1, import_Priority.Priority.Info, import_operational_state.OperationalState.TlvOperationCompletionEvent)
    }
  });
  OvenCavityOperationalState2.Cluster = OvenCavityOperationalState2.ClusterInstance;
  OvenCavityOperationalState2.Complete = OvenCavityOperationalState2.Cluster;
})(OvenCavityOperationalState || (OvenCavityOperationalState = {}));
const OvenCavityOperationalStateCluster = OvenCavityOperationalState.Cluster;
import_ClusterRegistry.ClusterRegistry.register(OvenCavityOperationalState.Complete);
//# sourceMappingURL=oven-cavity-operational-state.js.map
