/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const ModeBase = Cluster(
  { name: "ModeBase", classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "DEPONOFF", conformance: "O", constraint: "0", title: "OnOff" })
  ),
  Attribute(
    {
      name: "SupportedModes",
      id: 0,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "2 to 255",
      quality: "F"
    },
    Field({ name: "entry", type: "ModeOptionStruct" })
  ),
  Attribute({ name: "CurrentMode", id: 1, type: "uint8", access: "R V", conformance: "M", constraint: "desc", quality: "N" }),
  Attribute({
    name: "StartUpMode",
    id: 2,
    type: "uint8",
    access: "RW VO",
    conformance: "O",
    constraint: "desc",
    quality: "X N"
  }),
  Attribute({
    name: "OnMode",
    id: 3,
    type: "uint8",
    access: "RW VO",
    conformance: "DEPONOFF",
    constraint: "desc",
    quality: "X N"
  }),
  Command(
    {
      name: "ChangeToMode",
      id: 0,
      access: "O",
      conformance: "M",
      direction: "request",
      response: "ChangeToModeResponse"
    },
    Field({ name: "NewMode", id: 0, type: "uint8", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "ChangeToModeResponse", id: 1, conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "ModeChangeStatus", conformance: "M", constraint: "desc" }),
    Field({ name: "StatusText", id: 1, type: "string", conformance: "[Status == Success], M", constraint: "max 64" })
  ),
  Datatype(
    { name: "ModeTagStruct", type: "struct" },
    Field({ name: "MfgCode", id: 0, type: "vendor-id", conformance: "O", constraint: "desc" }),
    Field({ name: "Value", id: 1, type: "ModeTag", conformance: "M" })
  ),
  Datatype(
    { name: "ModeOptionStruct", type: "struct" },
    Field({ name: "Label", id: 0, type: "string", conformance: "M", constraint: "max 64", quality: "F" }),
    Field({ name: "Mode", id: 1, type: "uint8", conformance: "M", quality: "F" }),
    Field(
      { name: "ModeTags", id: 2, type: "list", conformance: "M", constraint: "max 8", quality: "F" },
      Field({ name: "entry", type: "ModeTagStruct" })
    )
  ),
  Datatype(
    { name: "ModeChangeStatus", type: "enum8" },
    Field({ name: "Success", id: 0 }),
    Field({ name: "UnsupportedMode", id: 1 }),
    Field({ name: "GenericFailure", id: 2 }),
    Field({ name: "InvalidInMode", id: 3 })
  ),
  Datatype(
    { name: "ModeTag", type: "enum16" },
    Field({ name: "Auto", id: 0 }),
    Field({ name: "Quick", id: 1 }),
    Field({ name: "Quiet", id: 2 }),
    Field({ name: "LowNoise", id: 3 }),
    Field({ name: "LowEnergy", id: 4 }),
    Field({ name: "Vacation", id: 5 }),
    Field({ name: "Min", id: 6 }),
    Field({ name: "Max", id: 7 }),
    Field({ name: "Night", id: 8 }),
    Field({ name: "Day", id: 9 })
  )
);
MatterDefinition.children.push(ModeBase);
export {
  ModeBase
};
//# sourceMappingURL=mode-base.element.js.map
