"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var window_covering_exports = {};
__export(window_covering_exports, {
  WindowCovering: () => WindowCovering,
  WindowCoveringCluster: () => WindowCoveringCluster
});
module.exports = __toCommonJS(window_covering_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_model = require("@matter/model");
var import_TlvNoArguments = require("../tlv/TlvNoArguments.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var WindowCovering;
((WindowCovering2) => {
  let Feature;
  ((Feature2) => {
    Feature2["Lift"] = "Lift";
    Feature2["Tilt"] = "Tilt";
    Feature2["PositionAwareLift"] = "PositionAwareLift";
    Feature2["AbsolutePosition"] = "AbsolutePosition";
    Feature2["PositionAwareTilt"] = "PositionAwareTilt";
  })(Feature = WindowCovering2.Feature || (WindowCovering2.Feature = {}));
  WindowCovering2.TlvGoToLiftPercentageRequest = (0, import_TlvObject.TlvObject)({ liftPercent100thsValue: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvPercent100ths) });
  WindowCovering2.TlvGoToTiltPercentageRequest = (0, import_TlvObject.TlvObject)({ tiltPercent100thsValue: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvPercent100ths) });
  WindowCovering2.TlvGoToLiftValueRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall specify the requested physical lift/slide position in unit cm (centimeters).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.4.1
     */
    liftValue: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt16)
  });
  WindowCovering2.TlvGoToTiltValueRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall specify the requested physical tilt position in unit 0.1° (tenth of a degrees).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.6.1
     */
    tiltValue: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt16)
  });
  let WindowCoveringType;
  ((WindowCoveringType2) => {
    WindowCoveringType2[WindowCoveringType2["Rollershade"] = 0] = "Rollershade";
    WindowCoveringType2[WindowCoveringType2["Rollershade2Motor"] = 1] = "Rollershade2Motor";
    WindowCoveringType2[WindowCoveringType2["RollershadeExterior"] = 2] = "RollershadeExterior";
    WindowCoveringType2[WindowCoveringType2["RollershadeExterior2Motor"] = 3] = "RollershadeExterior2Motor";
    WindowCoveringType2[WindowCoveringType2["Drapery"] = 4] = "Drapery";
    WindowCoveringType2[WindowCoveringType2["Awning"] = 5] = "Awning";
    WindowCoveringType2[WindowCoveringType2["Shutter"] = 6] = "Shutter";
    WindowCoveringType2[WindowCoveringType2["TiltBlindTiltOnly"] = 7] = "TiltBlindTiltOnly";
    WindowCoveringType2[WindowCoveringType2["TiltBlindLift"] = 8] = "TiltBlindLift";
    WindowCoveringType2[WindowCoveringType2["ProjectorScreen"] = 9] = "ProjectorScreen";
    WindowCoveringType2[WindowCoveringType2["Unknown"] = 255] = "Unknown";
  })(WindowCoveringType = WindowCovering2.WindowCoveringType || (WindowCovering2.WindowCoveringType = {}));
  WindowCovering2.ConfigStatus = {
    /**
     * Device is operational.
     *
     * This bit shall indicate whether the window covering is operational for regular use:
     *
     *   - 0 = Not Operational
     *
     *   - 1 = Operational
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.1
     */
    operational: (0, import_BitmapSchema.BitFlag)(0),
    onlineReserved: (0, import_BitmapSchema.BitFlag)(1),
    /**
     * The lift movement is reversed.
     *
     * This bit shall indicate whether the lift movement is reversed:
     *
     *   - 0 = Lift movement is normal
     *
     *   - 1 = Lift movement is reversed
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.2
     */
    liftMovementReversed: (0, import_BitmapSchema.BitFlag)(2),
    /**
     * Supports the PositionAwareLift feature (PA_LF).
     *
     * This bit shall indicate whether the window covering supports the PositionAwareLift feature:
     *
     *   - 0 = Lift control is not position aware
     *
     *   - 1 = Lift control is position aware (PA_LF)
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.3
     */
    liftPositionAware: (0, import_BitmapSchema.BitFlag)(3),
    /**
     * Supports the PositionAwareTilt feature (PA_TL).
     *
     * This bit shall indicate whether the window covering supports the PositionAwareTilt feature:
     *
     *   - 0 = Tilt control is not position aware
     *
     *   - 1 = Tilt control is position aware (PA_TL)
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.4
     */
    tiltPositionAware: (0, import_BitmapSchema.BitFlag)(4),
    /**
     * Uses an encoder for lift.
     *
     * This bit shall indicate whether a position aware controlled window covering is employing an encoder for
     * positioning the height of the window covering:
     *
     *   - 0 = Timer Controlled
     *
     *   - 1 = Encoder Controlled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.5
     */
    liftEncoderControlled: (0, import_BitmapSchema.BitFlag)(5),
    /**
     * Uses an encoder for tilt.
     *
     * This bit shall indicate whether a position aware controlled window covering is employing an encoder for
     * tilting the window covering:
     *
     *   - 0 = Timer Controlled
     *
     *   - 1 = Encoder Controlled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.1.6
     */
    tiltEncoderControlled: (0, import_BitmapSchema.BitFlag)(6)
  };
  WindowCovering2.OperationalStatus = {
    /**
     * Global operational state.
     *
     * These bits shall indicate in which direction the covering is currently moving or if it has stopped. Global
     * operational state shall always reflect the overall motion of the device.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.3.1
     */
    global: (0, import_BitmapSchema.BitFieldEnum)(0, 2),
    /**
     * Lift operational state.
     *
     * These bits shall indicate in which direction the covering’s lift is currently moving or if it has stopped.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.3.2
     */
    lift: (0, import_BitmapSchema.BitFieldEnum)(2, 2),
    /**
     * Tilt operational state.
     *
     * These bits shall indicate in which direction the covering’s tilt is currently moving or if it has stopped.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.3.3
     */
    tilt: (0, import_BitmapSchema.BitFieldEnum)(4, 2)
  };
  let MovementStatus;
  ((MovementStatus2) => {
    MovementStatus2[MovementStatus2["Stopped"] = 0] = "Stopped";
    MovementStatus2[MovementStatus2["Opening"] = 1] = "Opening";
    MovementStatus2[MovementStatus2["Closing"] = 2] = "Closing";
  })(MovementStatus = WindowCovering2.MovementStatus || (WindowCovering2.MovementStatus = {}));
  let EndProductType;
  ((EndProductType2) => {
    EndProductType2[EndProductType2["RollerShade"] = 0] = "RollerShade";
    EndProductType2[EndProductType2["RomanShade"] = 1] = "RomanShade";
    EndProductType2[EndProductType2["BalloonShade"] = 2] = "BalloonShade";
    EndProductType2[EndProductType2["WovenWood"] = 3] = "WovenWood";
    EndProductType2[EndProductType2["PleatedShade"] = 4] = "PleatedShade";
    EndProductType2[EndProductType2["CellularShade"] = 5] = "CellularShade";
    EndProductType2[EndProductType2["LayeredShade"] = 6] = "LayeredShade";
    EndProductType2[EndProductType2["LayeredShade2D"] = 7] = "LayeredShade2D";
    EndProductType2[EndProductType2["SheerShade"] = 8] = "SheerShade";
    EndProductType2[EndProductType2["TiltOnlyInteriorBlind"] = 9] = "TiltOnlyInteriorBlind";
    EndProductType2[EndProductType2["InteriorBlind"] = 10] = "InteriorBlind";
    EndProductType2[EndProductType2["VerticalBlindStripCurtain"] = 11] = "VerticalBlindStripCurtain";
    EndProductType2[EndProductType2["InteriorVenetianBlind"] = 12] = "InteriorVenetianBlind";
    EndProductType2[EndProductType2["ExteriorVenetianBlind"] = 13] = "ExteriorVenetianBlind";
    EndProductType2[EndProductType2["LateralLeftCurtain"] = 14] = "LateralLeftCurtain";
    EndProductType2[EndProductType2["LateralRightCurtain"] = 15] = "LateralRightCurtain";
    EndProductType2[EndProductType2["CentralCurtain"] = 16] = "CentralCurtain";
    EndProductType2[EndProductType2["RollerShutter"] = 17] = "RollerShutter";
    EndProductType2[EndProductType2["ExteriorVerticalScreen"] = 18] = "ExteriorVerticalScreen";
    EndProductType2[EndProductType2["AwningTerracePatio"] = 19] = "AwningTerracePatio";
    EndProductType2[EndProductType2["AwningVerticalScreen"] = 20] = "AwningVerticalScreen";
    EndProductType2[EndProductType2["TiltOnlyPergola"] = 21] = "TiltOnlyPergola";
    EndProductType2[EndProductType2["SwingingShutter"] = 22] = "SwingingShutter";
    EndProductType2[EndProductType2["SlidingShutter"] = 23] = "SlidingShutter";
    EndProductType2[EndProductType2["Unknown"] = 255] = "Unknown";
  })(EndProductType = WindowCovering2.EndProductType || (WindowCovering2.EndProductType = {}));
  WindowCovering2.Mode = {
    /**
     * Reverse the lift direction.
     *
     * This bit shall control the motor direction:
     *
     *   - 0 = Lift movement is normal
     *
     *   - 1 = Lift movement is reversed
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.2.1
     */
    motorDirectionReversed: (0, import_BitmapSchema.BitFlag)(0),
    /**
     * Perform a calibration.
     *
     * This bit shall set the window covering into calibration mode:
     *
     *   - 0 = Normal mode
     *
     *   - 1 = Calibration mode
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.2.2
     */
    calibrationMode: (0, import_BitmapSchema.BitFlag)(1),
    /**
     * Freeze all motions for maintenance.
     *
     * This bit shall set the window covering into maintenance mode:
     *
     *   - 0 = Normal mode
     *
     *   - 1 = Maintenance mode
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.2.3
     */
    maintenanceMode: (0, import_BitmapSchema.BitFlag)(2),
    /**
     * Control the LEDs feedback.
     *
     * This bit shall control feedback LEDs:
     *
     *   - 0 = LEDs are off
     *
     *   - 1 = LEDs will display feedback
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.3.5.2.4
     */
    ledFeedback: (0, import_BitmapSchema.BitFlag)(3)
  };
  WindowCovering2.SafetyStatus = {
    /**
     * Movement commands are ignored (locked out). e.g. not granted authorization, outside some time/date range.
     */
    remoteLockout: (0, import_BitmapSchema.BitFlag)(0),
    /**
     * Tampering detected on sensors or any other safety equipment. Ex: a device has been forcedly moved without its
     * actuator(s).
     */
    tamperDetection: (0, import_BitmapSchema.BitFlag)(1),
    /**
     * Communication failure to sensors or other safety equipment.
     */
    failedCommunication: (0, import_BitmapSchema.BitFlag)(2),
    /**
     * Device has failed to reach the desired position. e.g. with position aware device, time expired before
     * TargetPosition is reached.
     */
    positionFailure: (0, import_BitmapSchema.BitFlag)(3),
    /**
     * Motor(s) and/or electric circuit thermal protection activated.
     */
    thermalProtection: (0, import_BitmapSchema.BitFlag)(4),
    /**
     * An obstacle is preventing actuator movement.
     */
    obstacleDetected: (0, import_BitmapSchema.BitFlag)(5),
    /**
     * Device has power related issue or limitation e.g. device is running w/ the help of a backup battery or power
     * might not be fully available at the moment.
     */
    power: (0, import_BitmapSchema.BitFlag)(6),
    /**
     * Local safety sensor (not a direct obstacle) is preventing movements (e.g. Safety EU Standard EN60335).
     */
    stopInput: (0, import_BitmapSchema.BitFlag)(7),
    /**
     * Mechanical problem related to the motor(s) detected.
     */
    motorJammed: (0, import_BitmapSchema.BitFlag)(8),
    /**
     * PCB, fuse and other electrics problems.
     */
    hardwareFailure: (0, import_BitmapSchema.BitFlag)(9),
    /**
     * Actuator is manually operated and is preventing actuator movement (e.g. actuator is disengaged/decoupled).
     */
    manualOperation: (0, import_BitmapSchema.BitFlag)(10),
    /**
     * Protection is activated.
     */
    protection: (0, import_BitmapSchema.BitFlag)(11)
  };
  WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the maximum possible encoder position possible (Unit cm, centimeters) to position the height of
       * the window covering lift.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.2
       */
      physicalClosedLimitLift: (0, import_Cluster.OptionalFixedAttribute)(1, import_TlvNumber.TlvUInt16, { default: 0 }),
      /**
       * Indicates the actual lift position (Unit cm, centimeters) of the window covering from the fully-open
       * position.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.4
       */
      currentPositionLift: (0, import_Cluster.OptionalAttribute)(3, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16), { persistent: true, default: null }),
      /**
       * Indicates the open limit for lifting the window covering whether position (in centimeters) is encoded or
       * timed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.17
       */
      installedOpenLimitLift: (0, import_Cluster.Attribute)(16, import_TlvNumber.TlvUInt16.bound({ max: 65534 }), { persistent: true, default: 0 }),
      /**
       * Indicates the closed limit for lifting the window covering whether position (in centimeters) is encoded
       * or timed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.18
       */
      installedClosedLimitLift: (0, import_Cluster.Attribute)(
        17,
        import_TlvNumber.TlvUInt16.bound({ max: 65534 }),
        { persistent: true, default: 65534 }
      )
    }
  });
  WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the maximum possible encoder position possible (Unit 0.1°, tenths of a degree) to position the
       * angle of the window covering tilt.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.3
       */
      physicalClosedLimitTilt: (0, import_Cluster.OptionalFixedAttribute)(2, import_TlvNumber.TlvUInt16, { default: 0 }),
      /**
       * Indicates the actual tilt position (Unit 0.1°, tenths of a degree) of the window covering from the
       * fully-open position.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.5
       */
      currentPositionTilt: (0, import_Cluster.OptionalAttribute)(4, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt16), { persistent: true, default: null }),
      /**
       * Indicates the open limit for tilting the window covering whether position (in tenth of a degree) is
       * encoded or timed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.19
       */
      installedOpenLimitTilt: (0, import_Cluster.Attribute)(18, import_TlvNumber.TlvUInt16.bound({ max: 65534 }), { persistent: true, default: 0 }),
      /**
       * Indicates the closed limit for tilting the window covering whether position (in tenth of a degree) is
       * encoded or timed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.20
       */
      installedClosedLimitTilt: (0, import_Cluster.Attribute)(
        19,
        import_TlvNumber.TlvUInt16.bound({ max: 65534 }),
        { persistent: true, default: 65534 }
      )
    }
  });
  WindowCovering2.LiftComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the total number of lift/slide actuations applied to the window covering since the device was
       * installed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.6
       */
      numberOfActuationsLift: (0, import_Cluster.OptionalAttribute)(5, import_TlvNumber.TlvUInt16, { persistent: true, default: 0 })
    },
    commands: {
      /**
       * This command is used to set the target lift position of the window covering to the percentage value
       * specified in the command.
       *
       * Upon receipt of this command, the server will adjust the window covering to the lift/slide percentage
       * specified in the payload of this command.
       *
       * If the command includes LiftPercent100thsValue, then TargetPositionLiftPercent100ths attribute shall be
       * set to LiftPercent100thsValue. Otherwise the TargetPositionLiftPercent100ths attribute shall be set to
       * LiftPercentageValue * 100.
       *
       * If a client includes LiftPercent100thsValue in the command, the LiftPercentageValue shall be set to
       * LiftPercent100thsValue / 100, so a legacy server which only supports LiftPercentageValue (not
       * LiftPercent100thsValue) has a value to set the target position.
       *
       * If the server does not support the PositionAware feature, then a zero percentage shall be treated as a
       * UpOrOpen command and a non-zero percentage shall be treated as an DownOrClose command. If the device is
       * only a tilt control device, then the command SHOULD be ignored and a UNSUPPORTED_COMMAND status SHOULD be
       * returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.5
       */
      goToLiftPercentage: (0, import_Cluster.OptionalCommand)(5, WindowCovering2.TlvGoToLiftPercentageRequest, 5, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.TiltComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the total number of tilt actuations applied to the window covering since the device was
       * installed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.7
       */
      numberOfActuationsTilt: (0, import_Cluster.OptionalAttribute)(6, import_TlvNumber.TlvUInt16, { persistent: true, default: 0 })
    },
    commands: {
      /**
       * This command is used to set the target tilt position of the window covering to the percentage value
       * specified in the command.
       *
       * Upon receipt of this command, the server will adjust the window covering to the tilt percentage specified
       * in the payload of this command.
       *
       * If the command includes TiltPercent100thsValue, then TargetPositionTiltPercent100ths attribute shall be
       * set to TiltPercent100thsValue. Otherwise the TargetPositionTiltPercent100ths attribute shall be set to
       * TiltPercentageValue * 100.
       *
       * If a client includes TiltPercent100thsValue in the command, the TiltPercentageValue shall be set to
       * TiltPercent100thsValue / 100, so a legacy server which only supports TiltPercentageValue (not
       * TiltPercent100thsValue) has a value to set the target position.
       *
       * If the server does not support the PositionAware feature, then a zero percentage shall be treated as a
       * UpOrOpen command and a non-zero percentage shall be treated as an DownOrClose command. If the device is
       * only a tilt control device, then the command SHOULD be ignored and a UNSUPPORTED_COMMAND status SHOULD be
       * returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.7
       */
      goToTiltPercentage: (0, import_Cluster.OptionalCommand)(8, WindowCovering2.TlvGoToTiltPercentageRequest, 8, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.LiftAndPositionAwareLiftComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the actual position as a percentage from 0% to 100% with 1% default step. This attribute is
       * equal to CurrentPositionLiftPercent100ths attribute divided by 100.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.11
       */
      currentPositionLiftPercentage: (0, import_Cluster.OptionalAttribute)(
        8,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent),
        { persistent: true, default: null }
      ),
      /**
       * Indicates the position where the window covering lift will go or is moving to as a percentage (Unit
       * 0.01%).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.13
       */
      targetPositionLiftPercent100ths: (0, import_Cluster.Attribute)(11, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent100ths), { default: null }),
      /**
       * Indicates the actual position as a percentage with a minimal step of 0.01%. E.g Max 10000 equals 100.00%.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.9
       */
      currentPositionLiftPercent100ths: (0, import_Cluster.Attribute)(
        14,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent100ths),
        { persistent: true, default: null }
      )
    },
    commands: {
      /**
       * This command is used to set the target lift position of the window covering to the percentage value
       * specified in the command.
       *
       * Upon receipt of this command, the server will adjust the window covering to the lift/slide percentage
       * specified in the payload of this command.
       *
       * If the command includes LiftPercent100thsValue, then TargetPositionLiftPercent100ths attribute shall be
       * set to LiftPercent100thsValue. Otherwise the TargetPositionLiftPercent100ths attribute shall be set to
       * LiftPercentageValue * 100.
       *
       * If a client includes LiftPercent100thsValue in the command, the LiftPercentageValue shall be set to
       * LiftPercent100thsValue / 100, so a legacy server which only supports LiftPercentageValue (not
       * LiftPercent100thsValue) has a value to set the target position.
       *
       * If the server does not support the PositionAware feature, then a zero percentage shall be treated as a
       * UpOrOpen command and a non-zero percentage shall be treated as an DownOrClose command. If the device is
       * only a tilt control device, then the command SHOULD be ignored and a UNSUPPORTED_COMMAND status SHOULD be
       * returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.5
       */
      goToLiftPercentage: (0, import_Cluster.Command)(5, WindowCovering2.TlvGoToLiftPercentageRequest, 5, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.TiltAndPositionAwareTiltComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the actual position as a percentage from 0% to 100% with 1% default step. This attribute is
       * equal to CurrentPositionTiltPercent100ths attribute divided by 100.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.12
       */
      currentPositionTiltPercentage: (0, import_Cluster.OptionalAttribute)(
        9,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent),
        { persistent: true, default: null }
      ),
      /**
       * Indicates the position where the window covering tilt will go or is moving to as a percentage (Unit
       * 0.01%).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.14
       */
      targetPositionTiltPercent100ths: (0, import_Cluster.Attribute)(12, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent100ths), { default: null }),
      /**
       * Indicates the actual position as a percentage with a minimal step of 0.01%. E.g Max 10000 equals 100.00%.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.10
       */
      currentPositionTiltPercent100ths: (0, import_Cluster.Attribute)(
        15,
        (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvPercent100ths),
        { persistent: true, default: null }
      )
    },
    commands: {
      /**
       * This command is used to set the target tilt position of the window covering to the percentage value
       * specified in the command.
       *
       * Upon receipt of this command, the server will adjust the window covering to the tilt percentage specified
       * in the payload of this command.
       *
       * If the command includes TiltPercent100thsValue, then TargetPositionTiltPercent100ths attribute shall be
       * set to TiltPercent100thsValue. Otherwise the TargetPositionTiltPercent100ths attribute shall be set to
       * TiltPercentageValue * 100.
       *
       * If a client includes TiltPercent100thsValue in the command, the TiltPercentageValue shall be set to
       * TiltPercent100thsValue / 100, so a legacy server which only supports TiltPercentageValue (not
       * TiltPercent100thsValue) has a value to set the target position.
       *
       * If the server does not support the PositionAware feature, then a zero percentage shall be treated as a
       * UpOrOpen command and a non-zero percentage shall be treated as an DownOrClose command. If the device is
       * only a tilt control device, then the command SHOULD be ignored and a UNSUPPORTED_COMMAND status SHOULD be
       * returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.7
       */
      goToTiltPercentage: (0, import_Cluster.Command)(8, WindowCovering2.TlvGoToTiltPercentageRequest, 8, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.LiftAndAbsolutePositionComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * This command is used to set the target lift position of the window covering to the value specified in the
       * command.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.4
       */
      goToLiftValue: (0, import_Cluster.OptionalCommand)(4, WindowCovering2.TlvGoToLiftValueRequest, 4, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.TiltAndAbsolutePositionComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * This command is used to set the target tilt position of the window covering to the value specified in the
       * command.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.6
       */
      goToTiltValue: (0, import_Cluster.OptionalCommand)(7, WindowCovering2.TlvGoToTiltValueRequest, 7, import_Cluster.TlvNoResponse)
    }
  });
  WindowCovering2.Base = import_MutableCluster.MutableCluster.Component({
    id: 258,
    name: "WindowCovering",
    revision: 6,
    features: {
      /**
       * The Lift feature applies to window coverings that lift up and down (e.g. for a roller shade, Up and Down
       * is lift Open and Close) or slide left to right (e.g. for a sliding curtain, Left and Right is lift Open
       * and Close).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.4.1
       */
      lift: (0, import_BitmapSchema.BitFlag)(0),
      /**
       * The Tilt feature applies to window coverings with vertical or horizontal strips.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.4.2
       */
      tilt: (0, import_BitmapSchema.BitFlag)(1),
      /**
       * Position aware lift control is supported.
       */
      positionAwareLift: (0, import_BitmapSchema.BitFlag)(2),
      /**
       * The percentage attributes shall indicate the position as a percentage between the InstalledOpenLimits and
       * InstalledClosedLimits attributes of the window covering starting at the open (0.00%).
       *
       * As a general rule, absolute positioning (in centimeters or tenth of a degrees) SHOULD NOT be supported
       * for new implementations.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.4.4
       */
      absolutePosition: (0, import_BitmapSchema.BitFlag)(3),
      /**
       * Position aware tilt control is supported.
       */
      positionAwareTilt: (0, import_BitmapSchema.BitFlag)(4)
    },
    attributes: {
      /**
       * This attribute shall identify the type of window covering.
       *
       * If the window covering supports the LF feature and not the TL feature, the following types shall be used
       * as the constraint for this attribute:
       *
       * If the window covering supports the TL feature and not the LF feature, the following types shall be used
       * as the constraint for this attribute:
       *
       * If the window covering supports both the LF and TL features, the following types are allowed to be used:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.1
       */
      type: (0, import_Cluster.FixedAttribute)(0, (0, import_TlvNumber.TlvEnum)(), { default: 0 /* Rollershade */ }),
      /**
       * This attribute specifies the configuration and status information of the window covering.
       *
       * To change settings, devices shall write to the Mode attribute. The behavior causing the setting or
       * clearing of each bit is vendor specific.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.8
       */
      configStatus: (0, import_Cluster.Attribute)(7, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, WindowCovering2.ConfigStatus), { persistent: true }),
      /**
       * Indicates the currently ongoing operations and applies to all type of devices.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.15
       */
      operationalStatus: (0, import_Cluster.Attribute)(10, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, WindowCovering2.OperationalStatus)),
      /**
       * This attribute SHOULD provide more detail about the product type than can be determined from the main
       * category indicated by the Type attribute.
       *
       * If the window covering supports the LF feature and not the TL feature, the following types shall be used
       * as the constraint for this attribute:
       *
       * If the window covering supports the TL feature and not the LF feature, the following types shall be used
       * as the constraint for this attribute:
       *
       * If the window covering supports both the LF and TL features, the following types are allowed to be used:
       *
       * The table below helps to match the EndProductType attribute with the Type attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.16
       */
      endProductType: (0, import_Cluster.FixedAttribute)(13, (0, import_TlvNumber.TlvEnum)(), { default: 0 /* RollerShade */ }),
      /**
       * The Mode attribute allows configuration of the window covering, such as: reversing the motor direction,
       * placing the window covering into calibration mode, placing the motor into maintenance mode, disabling the
       * network, and disabling status LEDs.
       *
       * In the case a device does not support or implement a specific mode, e.g. the device has a specific
       * installation method and reversal is not relevant or the device does not include a maintenance mode, any
       * write interaction to the Mode attribute, with an unsupported mode bit or any out of bounds bits set, must
       * be ignored and a response containing the status of CONSTRAINT_ERROR will be returned.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.21
       */
      mode: (0, import_Cluster.WritableAttribute)(
        23,
        (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, WindowCovering2.Mode),
        { persistent: true, writeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * The SafetyStatus attribute reflects the state of the safety sensors and the common issues preventing
       * movements. By default for nominal operation all flags are cleared (0). A device might support none, one
       * or several bit flags from this attribute (all optional).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.6.22
       */
      safetyStatus: (0, import_Cluster.OptionalAttribute)(26, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt16, WindowCovering2.SafetyStatus))
    },
    commands: {
      /**
       * Upon receipt of this command, the window covering will adjust its position so the physical lift/slide and
       * tilt is at the maximum open/up position. This will happen as fast as possible. The server attributes
       * shall be updated as follows:
       *
       * if the PositionAware feature is supported:
       *
       *   - TargetPositionLiftPercent100ths attribute shall be set to 0.00%.
       *
       *   - TargetPositionTiltPercent100ths attribute shall be set to 0.00%.
       *
       * The server positioning attributes will follow the movements, once the movement has successfully finished,
       * the server attributes shall be updated as follows:
       *
       * if the PositionAware feature is supported:
       *
       *   - CurrentPositionLiftPercent100ths attribute shall be 0.00%.
       *
       *   - CurrentPositionLiftPercentage attribute shall be 0%.
       *
       *   - CurrentPositionTiltPercent100ths attribute shall be 0.00%.
       *
       *   - CurrentPositionTiltPercentage attribute shall be 0%.
       *
       * if the AbsolutePosition feature is supported:
       *
       *   - CurrentPositionLift attribute shall be equal to the InstalledOpenLimitLift attribute.
       *
       *   - CurrentPositionTilt attribute shall be equal to the InstalledOpenLimitTilt attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.1
       */
      upOrOpen: (0, import_Cluster.Command)(0, import_TlvNoArguments.TlvNoArguments, 0, import_Cluster.TlvNoResponse),
      /**
       * Upon receipt of this command, the window covering will adjust its position so the physical lift/slide and
       * tilt is at the maximum closed/down position. This will happen as fast as possible. The server attributes
       * supported shall be updated as follows:
       *
       * if the PositionAware feature is supported:
       *
       *   - TargetPositionLiftPercent100ths attribute shall be set to 100.00%.
       *
       *   - TargetPositionTiltPercent100ths attribute shall be set to 100.00%.
       *
       * The server positioning attributes will follow the movements, once the movement has successfully finished,
       * the server attributes shall be updated as follows:
       *
       * if the PositionAware feature is supported:
       *
       *   - CurrentPositionLiftPercent100ths attribute shall be 100.00%.
       *
       *   - CurrentPositionLiftPercentage attribute shall be 100%.
       *
       *   - CurrentPositionTiltPercent100ths attribute shall be 100.00%.
       *
       *   - CurrentPositionTiltPercentage attribute shall be 100%.
       *
       * if the AbsolutePosition feature is supported:
       *
       *   - CurrentPositionLift attribute shall be equal to the InstalledClosedLimitLift attribute.
       *
       *   - CurrentPositionTilt attribute shall be equal to the InstalledClosedLimitTilt attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.2
       */
      downOrClose: (0, import_Cluster.Command)(1, import_TlvNoArguments.TlvNoArguments, 1, import_Cluster.TlvNoResponse),
      /**
       * Upon receipt of this command, the window covering will stop any adjusting to the physical tilt and
       * lift/slide that is currently occurring. The server attributes supported shall be updated as follows:
       *
       *   - TargetPositionLiftPercent100ths attribute will be set to CurrentPositionLiftPercent100ths attribute
       *     value.
       *
       *   - TargetPositionTiltPercent100ths attribute will be set to CurrentPositionTiltPercent100ths attribute
       *     value.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.3.7.3
       */
      stopMotion: (0, import_Cluster.Command)(2, import_TlvNoArguments.TlvNoArguments, 2, import_Cluster.TlvNoResponse)
    },
    /**
     * This metadata controls which WindowCoveringCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions(
      {
        flags: { lift: true, positionAwareLift: true, absolutePosition: true },
        component: WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent
      },
      {
        flags: { tilt: true, positionAwareTilt: true, absolutePosition: true },
        component: WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent
      },
      { flags: { lift: true }, component: WindowCovering2.LiftComponent },
      { flags: { tilt: true }, component: WindowCovering2.TiltComponent },
      { flags: { lift: true, positionAwareLift: true }, component: WindowCovering2.LiftAndPositionAwareLiftComponent },
      { flags: { tilt: true, positionAwareTilt: true }, component: WindowCovering2.TiltAndPositionAwareTiltComponent },
      { flags: { lift: true, absolutePosition: true }, component: WindowCovering2.LiftAndAbsolutePositionComponent },
      { flags: { tilt: true, absolutePosition: true }, component: WindowCovering2.TiltAndAbsolutePositionComponent },
      { flags: { positionAwareLift: true, lift: false }, component: false },
      { flags: { positionAwareTilt: true, tilt: false }, component: false },
      { flags: { lift: false, tilt: false }, component: false }
    )
  });
  WindowCovering2.ClusterInstance = import_MutableCluster.MutableCluster.ExtensibleOnly(WindowCovering2.Base);
  WindowCovering2.Cluster = WindowCovering2.ClusterInstance;
  const LF_PA_LF_ABS = { lift: true, positionAwareLift: true, absolutePosition: true };
  const TL_PA_TL_ABS = { tilt: true, positionAwareTilt: true, absolutePosition: true };
  const LF = { lift: true };
  const TL = { tilt: true };
  const LF_PA_LF = { lift: true, positionAwareLift: true };
  const TL_PA_TL = { tilt: true, positionAwareTilt: true };
  const LF_ABS = { lift: true, absolutePosition: true };
  const TL_ABS = { tilt: true, absolutePosition: true };
  WindowCovering2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: WindowCovering2.Base.id,
    name: WindowCovering2.Base.name,
    revision: WindowCovering2.Base.revision,
    features: WindowCovering2.Base.features,
    attributes: {
      ...WindowCovering2.Base.attributes,
      physicalClosedLimitLift: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent.attributes.physicalClosedLimitLift,
        { optionalIf: [LF_PA_LF_ABS] }
      ),
      physicalClosedLimitTilt: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent.attributes.physicalClosedLimitTilt,
        { optionalIf: [TL_PA_TL_ABS] }
      ),
      currentPositionLift: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent.attributes.currentPositionLift,
        { optionalIf: [LF_PA_LF_ABS] }
      ),
      currentPositionTilt: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent.attributes.currentPositionTilt,
        { optionalIf: [TL_PA_TL_ABS] }
      ),
      numberOfActuationsLift: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftComponent.attributes.numberOfActuationsLift,
        { optionalIf: [LF] }
      ),
      numberOfActuationsTilt: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltComponent.attributes.numberOfActuationsTilt,
        { optionalIf: [TL] }
      ),
      currentPositionLiftPercentage: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftComponent.attributes.currentPositionLiftPercentage,
        { optionalIf: [LF_PA_LF] }
      ),
      currentPositionTiltPercentage: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltComponent.attributes.currentPositionTiltPercentage,
        { optionalIf: [TL_PA_TL] }
      ),
      targetPositionLiftPercent100ths: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftComponent.attributes.targetPositionLiftPercent100ths,
        { mandatoryIf: [LF_PA_LF] }
      ),
      targetPositionTiltPercent100ths: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltComponent.attributes.targetPositionTiltPercent100ths,
        { mandatoryIf: [TL_PA_TL] }
      ),
      currentPositionLiftPercent100ths: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftComponent.attributes.currentPositionLiftPercent100ths,
        { mandatoryIf: [LF_PA_LF] }
      ),
      currentPositionTiltPercent100ths: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltComponent.attributes.currentPositionTiltPercent100ths,
        { mandatoryIf: [TL_PA_TL] }
      ),
      installedOpenLimitLift: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent.attributes.installedOpenLimitLift,
        { mandatoryIf: [LF_PA_LF_ABS] }
      ),
      installedClosedLimitLift: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndPositionAwareLiftAndAbsolutePositionComponent.attributes.installedClosedLimitLift,
        { mandatoryIf: [LF_PA_LF_ABS] }
      ),
      installedOpenLimitTilt: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent.attributes.installedOpenLimitTilt,
        { mandatoryIf: [TL_PA_TL_ABS] }
      ),
      installedClosedLimitTilt: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndPositionAwareTiltAndAbsolutePositionComponent.attributes.installedClosedLimitTilt,
        { mandatoryIf: [TL_PA_TL_ABS] }
      )
    },
    commands: {
      ...WindowCovering2.Base.commands,
      goToLiftValue: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftAndAbsolutePositionComponent.commands.goToLiftValue,
        { optionalIf: [LF_ABS] }
      ),
      goToLiftPercentage: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.LiftComponent.commands.goToLiftPercentage,
        { optionalIf: [LF], mandatoryIf: [LF_PA_LF] }
      ),
      goToTiltValue: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltAndAbsolutePositionComponent.commands.goToTiltValue,
        { optionalIf: [TL_ABS] }
      ),
      goToTiltPercentage: import_MutableCluster.MutableCluster.AsConditional(
        WindowCovering2.TiltComponent.commands.goToTiltPercentage,
        { optionalIf: [TL], mandatoryIf: [TL_PA_TL] }
      )
    }
  });
  WindowCovering2.Complete = WindowCovering2.CompleteInstance;
})(WindowCovering || (WindowCovering = {}));
const WindowCoveringCluster = WindowCovering.Cluster;
import_ClusterRegistry.ClusterRegistry.register(WindowCovering.Complete);
//# sourceMappingURL=window-covering.js.map
