/**
 * @license
 * Copyright 2022-2025 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 LevelControl = Cluster(
  { name: "LevelControl", id: 8, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 6 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "OO", conformance: "O", constraint: "0", default: 1, title: "OnOff" }),
    Field({ name: "LT", conformance: "O", constraint: "1", default: 0, title: "Lighting" }),
    Field({ name: "FQ", conformance: "P", constraint: "2", default: 0, title: "Frequency" })
  ),
  Attribute({
    name: "CurrentLevel",
    id: 0,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "minLevel to maxLevel",
    quality: "X N S Q"
  }),
  Attribute({ name: "RemainingTime", id: 1, type: "uint16", access: "R V", conformance: "LT", quality: "Q" }),
  Attribute({
    name: "MinLevel",
    id: 2,
    type: "uint8",
    access: "R V",
    conformance: "[LT]",
    constraint: "1 to 254",
    default: 1
  }),
  Attribute({
    name: "MinLevel",
    id: 2,
    type: "uint8",
    access: "R V",
    conformance: "[!LT]",
    constraint: "max 254",
    default: 0
  }),
  Attribute({
    name: "MaxLevel",
    id: 3,
    type: "uint8",
    access: "R V",
    conformance: "O",
    constraint: "minLevel to 254",
    default: 254
  }),
  Attribute({
    name: "CurrentFrequency",
    id: 4,
    type: "uint16",
    access: "R V",
    conformance: "FQ",
    constraint: "minFrequency to maxFrequency",
    quality: "S P Q"
  }),
  Attribute({ name: "MinFrequency", id: 5, type: "uint16", access: "R V", conformance: "FQ" }),
  Attribute({ name: "MaxFrequency", id: 6, type: "uint16", access: "R V", conformance: "FQ", constraint: "min minFrequency" }),
  Attribute({ name: "OnOffTransitionTime", id: 16, type: "uint16", access: "RW VO", conformance: "O", default: 0 }),
  Attribute({
    name: "OnLevel",
    id: 17,
    type: "uint8",
    access: "RW VO",
    conformance: "M",
    constraint: "minLevel to maxLevel",
    quality: "X"
  }),
  Attribute({
    name: "OnTransitionTime",
    id: 18,
    type: "uint16",
    access: "RW VO",
    conformance: "O",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "OffTransitionTime",
    id: 19,
    type: "uint16",
    access: "RW VO",
    conformance: "O",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "DefaultMoveRate",
    id: 20,
    type: "uint8",
    access: "RW VO",
    conformance: "O",
    constraint: "min 1",
    quality: "X"
  }),
  Attribute({ name: "Options", id: 15, type: "OptionsBitmap", access: "RW VO", conformance: "M", constraint: "desc" }),
  Attribute({
    name: "StartUpCurrentLevel",
    id: 16384,
    type: "uint8",
    access: "RW VM",
    conformance: "LT",
    constraint: "desc",
    quality: "X N"
  }),
  Command(
    { name: "MoveToLevel", id: 0, access: "O", conformance: "M", direction: "request", response: "status" },
    Field({ name: "Level", id: 0, type: "uint8", conformance: "M", constraint: "max 254" }),
    Field({ name: "TransitionTime", id: 1, type: "uint16", conformance: "M", quality: "X" }),
    Field({ name: "OptionsMask", id: 2, type: "OptionsBitmap", conformance: "M", constraint: "desc" }),
    Field({ name: "OptionsOverride", id: 3, type: "OptionsBitmap", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "Move", id: 1, access: "O", conformance: "M", direction: "request", response: "status" },
    Field({ name: "MoveMode", id: 0, type: "MoveModeEnum", conformance: "M", constraint: "desc" }),
    Field({ name: "Rate", id: 1, type: "uint8", conformance: "M", quality: "X" }),
    Field({ name: "OptionsMask", id: 2, type: "OptionsBitmap", conformance: "M", constraint: "desc" }),
    Field({ name: "OptionsOverride", id: 3, type: "OptionsBitmap", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "Step", id: 2, access: "O", conformance: "M", direction: "request", response: "status" },
    Field({ name: "StepMode", id: 0, type: "StepModeEnum", conformance: "M", constraint: "desc" }),
    Field({ name: "StepSize", id: 1, type: "uint8", conformance: "M" }),
    Field({ name: "TransitionTime", id: 2, type: "uint16", conformance: "M", quality: "X" }),
    Field({ name: "OptionsMask", id: 3, type: "OptionsBitmap", conformance: "M", constraint: "desc" }),
    Field({ name: "OptionsOverride", id: 4, type: "OptionsBitmap", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "Stop", id: 3, access: "O", conformance: "M", direction: "request", response: "status" },
    Field({ name: "OptionsMask", id: 0, type: "OptionsBitmap", conformance: "M", constraint: "desc" }),
    Field({ name: "OptionsOverride", id: 1, type: "OptionsBitmap", conformance: "M", constraint: "desc" })
  ),
  Command({
    name: "MoveToLevelWithOnOff",
    id: 4,
    type: "MoveToLevel",
    access: "O",
    conformance: "M",
    direction: "request",
    response: "status"
  }),
  Command({
    name: "MoveWithOnOff",
    id: 5,
    type: "Move",
    access: "O",
    conformance: "M",
    direction: "request",
    response: "status"
  }),
  Command({
    name: "StepWithOnOff",
    id: 6,
    type: "Step",
    access: "O",
    conformance: "M",
    direction: "request",
    response: "status"
  }),
  Command({
    name: "StopWithOnOff",
    id: 7,
    type: "Stop",
    access: "O",
    conformance: "M",
    direction: "request",
    response: "status"
  }),
  Command(
    {
      name: "MoveToClosestFrequency",
      id: 8,
      access: "O",
      conformance: "FQ",
      direction: "request",
      response: "status"
    },
    Field({ name: "Frequency", id: 0, type: "uint16", conformance: "M" })
  ),
  Datatype(
    { name: "OptionsBitmap", type: "map8" },
    Field({ name: "ExecuteIfOff", constraint: "0" }),
    Field({ name: "CoupleColorTempToLevel", constraint: "1" })
  ),
  Datatype(
    { name: "MoveModeEnum", type: "enum8" },
    Field({ name: "Up", id: 0, conformance: "M" }),
    Field({ name: "Down", id: 1, conformance: "M" })
  ),
  Datatype(
    { name: "StepModeEnum", type: "enum8" },
    Field({ name: "Up", id: 0, conformance: "M" }),
    Field({ name: "Down", id: 1, conformance: "M" })
  )
);
MatterDefinition.children.push(LevelControl);
export {
  LevelControl
};
//# sourceMappingURL=level-control.element.js.map
