/**
 * @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,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const OccupancySensing = Cluster(
  { name: "OccupancySensing", id: 1030, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 5 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "OTHER", conformance: "O.a+", constraint: "0", title: "Other" }),
    Field({ name: "PIR", conformance: "O.a+", constraint: "1", title: "PassiveInfrared" }),
    Field({ name: "US", conformance: "O.a+", constraint: "2", title: "Ultrasonic" }),
    Field({ name: "PHY", conformance: "O.a+", constraint: "3", title: "PhysicalContact" }),
    Field({ name: "AIR", conformance: "O.a+", constraint: "4", title: "ActiveInfrared" }),
    Field({ name: "RAD", conformance: "O.a+", constraint: "5", title: "Radar" }),
    Field({ name: "RFS", conformance: "O.a+", constraint: "6", title: "RfSensing" }),
    Field({ name: "VIS", conformance: "O.a+", constraint: "7", title: "Vision" })
  ),
  Attribute({
    name: "Occupancy",
    id: 0,
    type: "OccupancyBitmap",
    access: "R V",
    conformance: "M",
    constraint: "0 to 1",
    quality: "P"
  }),
  Attribute({
    name: "OccupancySensorType",
    id: 1,
    type: "OccupancySensorTypeEnum",
    access: "R V",
    conformance: "M, D",
    constraint: "desc",
    quality: "F"
  }),
  Attribute({
    name: "OccupancySensorTypeBitmap",
    id: 2,
    type: "OccupancySensorTypeBitmap",
    access: "R V",
    conformance: "M, D",
    constraint: "0 to 7",
    quality: "F"
  }),
  Attribute({
    name: "HoldTime",
    id: 3,
    type: "uint16",
    access: "RW VM",
    conformance: "O",
    constraint: "holdTimeLimits.holdTimeMin to holdTimeLimits.holdTimeMax",
    quality: "N"
  }),
  Attribute({
    name: "HoldTimeLimits",
    id: 4,
    type: "HoldTimeLimitsStruct",
    access: "R V",
    conformance: "HoldTime",
    quality: "F"
  }),
  Attribute({
    name: "PirOccupiedToUnoccupiedDelay",
    id: 16,
    type: "uint16",
    access: "RW VM",
    conformance: "[HoldTime & (PIR | !PIR & !US & !PHY)], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "PirUnoccupiedToOccupiedDelay",
    id: 17,
    type: "uint16",
    access: "RW VM",
    conformance: "HoldTime & (PIR | !PIR & !US & !PHY) & PirUnoccupiedToOccupiedThreshold, [HoldTime & (PIR | !PIR & !US & !PHY)], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "PirUnoccupiedToOccupiedThreshold",
    id: 18,
    type: "uint8",
    access: "RW VM",
    conformance: "HoldTime & (PIR | !PIR & !US & !PHY) & PirUnoccupiedToOccupiedDelay, [HoldTime & (PIR | !PIR & !US & !PHY)], D",
    constraint: "1 to 254",
    default: 1,
    quality: "N"
  }),
  Attribute({
    name: "UltrasonicOccupiedToUnoccupiedDelay",
    id: 32,
    type: "uint16",
    access: "RW VM",
    conformance: "[HoldTime & US], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "UltrasonicUnoccupiedToOccupiedDelay",
    id: 33,
    type: "uint16",
    access: "RW VM",
    conformance: "HoldTime & US & UltrasonicUnoccupiedToOccupiedThreshold, [HoldTime & US], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "UltrasonicUnoccupiedToOccupiedThreshold",
    id: 34,
    type: "uint8",
    access: "RW VM",
    conformance: "HoldTime & US & UltrasonicUnoccupiedToOccupiedDelay, [HoldTime & US], D",
    constraint: "1 to 254",
    default: 1,
    quality: "N"
  }),
  Attribute({
    name: "PhysicalContactOccupiedToUnoccupiedDelay",
    id: 48,
    type: "uint16",
    access: "RW VM",
    conformance: "[HoldTime & PHY], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "PhysicalContactUnoccupiedToOccupiedDelay",
    id: 49,
    type: "uint16",
    access: "RW VM",
    conformance: "HoldTime & PHY & PhysicalContactUnoccupiedToOccupiedThreshold, [HoldTime & PHY], D",
    default: 0,
    quality: "N"
  }),
  Attribute({
    name: "PhysicalContactUnoccupiedToOccupiedThreshold",
    id: 50,
    type: "uint8",
    access: "RW VM",
    conformance: "HoldTime & PHY & PhysicalContactUnoccupiedToOccupiedDelay, [HoldTime & PHY], D",
    constraint: "1 to 254",
    default: 1,
    quality: "N"
  }),
  Event(
    { name: "OccupancyChanged", id: 0, access: "V", conformance: "O", priority: "info" },
    Field({ name: "Occupancy", id: 0, type: "OccupancyBitmap", conformance: "M" })
  ),
  Datatype({ name: "OccupancyBitmap", type: "map8" }, Field({ name: "Occupied", constraint: "0" })),
  Datatype(
    { name: "OccupancySensorTypeBitmap", type: "map8" },
    Field({ name: "Pir", constraint: "0" }),
    Field({ name: "Ultrasonic", constraint: "1" }),
    Field({ name: "PhysicalContact", constraint: "2" })
  ),
  Datatype(
    { name: "OccupancySensorTypeEnum", type: "enum8" },
    Field({ name: "Pir", id: 0, conformance: "M" }),
    Field({ name: "Ultrasonic", id: 1, conformance: "M" }),
    Field({ name: "PirAndUltrasonic", id: 2, conformance: "M" }),
    Field({ name: "PhysicalContact", id: 3, conformance: "M" })
  ),
  Datatype(
    { name: "HoldTimeLimitsStruct", type: "struct" },
    Field({ name: "HoldTimeMin", id: 0, type: "uint16", conformance: "M", constraint: "min 1" }),
    Field({ name: "HoldTimeMax", id: 1, type: "uint16", conformance: "M", constraint: "min maxOf(holdTimeMin, 10)" }),
    Field({
      name: "HoldTimeDefault",
      id: 2,
      type: "uint16",
      conformance: "M",
      constraint: "holdTimeMin to holdTimeMax"
    })
  )
);
MatterDefinition.children.push(OccupancySensing);
export {
  OccupancySensing
};
//# sourceMappingURL=occupancy-sensing.element.js.map
