/**
 * @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,
  EventElement as Event
} from "../../elements/index.js";
const Switch = Cluster(
  { name: "Switch", id: 59, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "LS", conformance: "O.a", constraint: "0", title: "LatchingSwitch" }),
    Field({ name: "MS", conformance: "O.a", constraint: "1", title: "MomentarySwitch" }),
    Field({ name: "MSR", conformance: "[MS & !AS]", constraint: "2", title: "MomentarySwitchRelease" }),
    Field({ name: "MSL", conformance: "[MS & (MSR | AS)]", constraint: "3", title: "MomentarySwitchLongPress" }),
    Field({ name: "MSM", conformance: "AS, [MS & MSR]", constraint: "4", title: "MomentarySwitchMultiPress" }),
    Field({ name: "AS", conformance: "[MS]", constraint: "5", title: "ActionSwitch" })
  ),
  Attribute({
    name: "NumberOfPositions",
    id: 0,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "min 2",
    quality: "F"
  }),
  Attribute({
    name: "CurrentPosition",
    id: 1,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "max numberOfPositions - 1",
    quality: "N"
  }),
  Attribute({
    name: "MultiPressMax",
    id: 2,
    type: "uint8",
    access: "R V",
    conformance: "MSM",
    constraint: "min 2",
    quality: "F"
  }),
  Event(
    { name: "SwitchLatched", id: 0, access: "V", conformance: "LS", priority: "info" },
    Field({ name: "NewPosition", id: 0, type: "uint8", conformance: "M", constraint: "0 to numberOfPositions - 1" })
  ),
  Event(
    { name: "InitialPress", id: 1, access: "V", conformance: "MS", priority: "info" },
    Field({ name: "NewPosition", id: 0, type: "uint8", conformance: "M", constraint: "0 to numberOfPositions - 1" })
  ),
  Event(
    { name: "LongPress", id: 2, access: "V", conformance: "MSL", priority: "info" },
    Field({ name: "NewPosition", id: 0, type: "uint8", conformance: "M", constraint: "0 to numberOfPositions - 1" })
  ),
  Event(
    { name: "ShortRelease", id: 3, access: "V", conformance: "MSR", priority: "info" },
    Field({
      name: "PreviousPosition",
      id: 0,
      type: "uint8",
      conformance: "M",
      constraint: "0 to numberOfPositions - 1"
    })
  ),
  Event(
    { name: "LongRelease", id: 4, access: "V", conformance: "MSL", priority: "info" },
    Field({
      name: "PreviousPosition",
      id: 0,
      type: "uint8",
      conformance: "M",
      constraint: "0 to numberOfPositions - 1"
    })
  ),
  Event(
    { name: "MultiPressOngoing", id: 5, access: "V", conformance: "MSM & !AS", priority: "info" },
    Field({ name: "NewPosition", id: 0, type: "uint8", conformance: "M", constraint: "0 to numberOfPositions - 1" }),
    Field({
      name: "CurrentNumberOfPressesCounted",
      id: 1,
      type: "uint8",
      conformance: "M",
      constraint: "2 to multiPressMax"
    })
  ),
  Event(
    { name: "MultiPressComplete", id: 6, access: "V", conformance: "MSM", priority: "info" },
    Field({
      name: "PreviousPosition",
      id: 0,
      type: "uint8",
      conformance: "M",
      constraint: "0 to numberOfPositions - 1"
    }),
    Field({
      name: "TotalNumberOfPressesCounted",
      id: 1,
      type: "uint8",
      conformance: "M",
      constraint: "max multiPressMax"
    })
  )
);
MatterDefinition.children.push(Switch);
export {
  Switch
};
//# sourceMappingURL=switch.element.js.map
