/**
 * @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,
  EventElement as Event,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const ValveConfigurationAndControl = Cluster(
  { name: "ValveConfigurationAndControl", id: 129, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "TS", conformance: "desc", constraint: "0", title: "TimeSync" }),
    Field({ name: "LVL", conformance: "O", constraint: "1", title: "Level" })
  ),
  Attribute({
    name: "OpenDuration",
    id: 0,
    type: "elapsed-s",
    access: "R V",
    conformance: "M",
    constraint: "min 1",
    quality: "X"
  }),
  Attribute({
    name: "DefaultOpenDuration",
    id: 1,
    type: "elapsed-s",
    access: "RW VO",
    conformance: "M",
    constraint: "min 1",
    quality: "X N"
  }),
  Attribute({ name: "AutoCloseTime", id: 2, type: "epoch-us", access: "R V", conformance: "TS", quality: "X" }),
  Attribute({ name: "RemainingDuration", id: 3, type: "elapsed-s", access: "R V", conformance: "M", quality: "X Q" }),
  Attribute({ name: "CurrentState", id: 4, type: "ValveStateEnum", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "TargetState", id: 5, type: "ValveStateEnum", access: "R V", conformance: "M", quality: "X" }),
  Attribute({ name: "CurrentLevel", id: 6, type: "percent", access: "R V", conformance: "LVL", quality: "X" }),
  Attribute({ name: "TargetLevel", id: 7, type: "percent", access: "R V", conformance: "LVL", quality: "X" }),
  Attribute({
    name: "DefaultOpenLevel",
    id: 8,
    type: "percent",
    access: "RW VO",
    conformance: "[LVL]",
    constraint: "1 to 100",
    default: 100,
    quality: "N"
  }),
  Attribute({ name: "ValveFault", id: 9, type: "ValveFaultBitmap", access: "R V", conformance: "O", default: 0 }),
  Attribute({
    name: "LevelStep",
    id: 10,
    type: "uint8",
    access: "R V",
    conformance: "[LVL]",
    constraint: "1 to 50",
    default: 1,
    quality: "F"
  }),
  Event(
    { name: "ValveStateChanged", id: 0, access: "V", conformance: "O", priority: "info" },
    Field({ name: "ValveState", id: 0, type: "ValveStateEnum", conformance: "M" }),
    Field({ name: "ValveLevel", id: 1, type: "percent", conformance: "LVL" })
  ),
  Event(
    { name: "ValveFault", id: 1, access: "V", conformance: "O", priority: "info" },
    Field({ name: "ValveFault", id: 0, type: "ValveFaultBitmap", conformance: "M" })
  ),
  Command(
    { name: "Open", id: 0, access: "O", conformance: "M", direction: "request", response: "status" },
    Field({ name: "OpenDuration", id: 0, type: "elapsed-s", conformance: "O", constraint: "min 1", quality: "X" }),
    Field({ name: "TargetLevel", id: 1, type: "percent", conformance: "[LVL]", constraint: "min 1" })
  ),
  Command({ name: "Close", id: 1, access: "O", conformance: "M", direction: "request", response: "status" }),
  Datatype(
    { name: "ValveFaultBitmap", type: "map16" },
    Field({ name: "GeneralFault", constraint: "0" }),
    Field({ name: "Blocked", constraint: "1" }),
    Field({ name: "Leaking", constraint: "2" }),
    Field({ name: "NotConnected", constraint: "3" }),
    Field({ name: "ShortCircuit", constraint: "4" }),
    Field({ name: "CurrentExceeded", constraint: "5" })
  ),
  Datatype(
    { name: "ValveStateEnum", type: "enum8" },
    Field({ name: "Closed", id: 0, conformance: "M" }),
    Field({ name: "Open", id: 1, conformance: "M" }),
    Field({ name: "Transitioning", id: 2, conformance: "M" })
  ),
  Datatype(
    { name: "StatusCodeEnum", type: "enum8" },
    Field({ name: "FailureDueToFault", id: 2, conformance: "M" })
  )
);
MatterDefinition.children.push(ValveConfigurationAndControl);
export {
  ValveConfigurationAndControl
};
//# sourceMappingURL=valve-configuration-and-control.element.js.map
