/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MutableCluster } from "../cluster/mutation/MutableCluster.js";
import { Attribute, OptionalEvent } from "../cluster/Cluster.js";
import { TlvBoolean } from "../tlv/TlvBoolean.js";
import { Priority } from "../globals/Priority.js";
import { TlvField, TlvObject } from "../tlv/TlvObject.js";
import { ClusterRegistry } from "../cluster/ClusterRegistry.js";
var BooleanState;
((BooleanState2) => {
  BooleanState2.TlvStateChangeEvent = TlvObject({
    /**
     * This field shall indicate the new value of the StateValue attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 1.7.5.1.1
     */
    stateValue: TlvField(0, TlvBoolean)
  });
  BooleanState2.ClusterInstance = MutableCluster({
    id: 69,
    name: "BooleanState",
    revision: 1,
    attributes: {
      /**
       * This represents a boolean state.
       *
       * The semantics of this boolean state are defined by the device type using this cluster.
       *
       * For example, in a Contact Sensor device type, FALSE=open or no contact, TRUE=closed or contact.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.7.4.1
       */
      stateValue: Attribute(0, TlvBoolean)
    },
    events: {
      /**
       * If this event is supported, it shall be generated when the StateValue attribute changes.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 1.7.5.1
       */
      stateChange: OptionalEvent(0, Priority.Info, BooleanState2.TlvStateChangeEvent)
    }
  });
  BooleanState2.Cluster = BooleanState2.ClusterInstance;
  BooleanState2.Complete = BooleanState2.Cluster;
})(BooleanState || (BooleanState = {}));
const BooleanStateCluster = BooleanState.Cluster;
ClusterRegistry.register(BooleanState.Complete);
export {
  BooleanState,
  BooleanStateCluster
};
//# sourceMappingURL=boolean-state.js.map
