# OverallCurrentStateStruct

    struct OverallCurrentStateStruct

The current state of the closure.
- `


  ### [position](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV8positionAE0I12PositionEnumOSgvp)


  ` The current Position state of the closure, as defined in the `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/CurrentPositionEnum.html`.

  #### Declaration

  Swift

      let position: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/CurrentPositionEnum.html?

- `


  ### [latch](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV5latchSbSgvp)


  ` The current latch state of the closure. A null value indicates that the state is not
  known.

  #### Declaration

  Swift

      let latch: Bool?

- `


  ### [speed](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV5speedAE18ThreeLevelAutoEnumOSgvp)


  ` The current speed state of the closure, as defined in the `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/ThreeLevelAutoEnum.html`.

  #### Declaration

  Swift

      let speed: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/ThreeLevelAutoEnum.html?

- `


  ### [secureState](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV06secureJ0SbSgvp)


  ` The current secure state of the closure. A secure state requires the closure to meet both
  of the following conditions defined by the `OverallCurrentStateStruct`:
  - If the `Positioning` feature is supported, then the Position field of `OverallCurrentState` is `FullyClosed`.
  - If the `MotionLatching` feature is supported, then the `Latch` field `of OverallCurrentState`is `True`.

  <br />

  #### Declaration

  Swift

      let secureState: Bool?

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV7decoderAG0aB3SDK0G7DecoderV_tKcfc)


  ` Creates a new Struct instance using data read from the given `TraitDecoder`.
  Throws
  `HomeError.parseError` when parsing fails.

  #### Declaration

  Swift

      init(decoder: TraitDecoder) throws

  #### Parameters

  |---|---|
  | ` decoder ` | The raw data representing this Struct. |

- `


  ### [encode(with:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV6encode4withy0aB3SDK0G7EncoderC_tKF)


  ` Writes this Struct to the given `TraitEncoder`.
  Throws `HomeError.parseError` if the data could not be encoded.

  #### Declaration

  Swift

      func encode(with encoder: TraitEncoder) throws

- `


  ### [structField(id:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureControlTrait/OverallCurrentStateStruct#/s:15GoogleHomeTypes6MatterO19ClosureControlTraitV25OverallCurrentStateStructV11structField2id0aB3SDK0M0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

      static func structField(id: UInt32) -> (any Field)?