# UnitRangeStruct

    struct UnitRangeStruct

Defines an operational range, from a minimum to a maximum value, for a dimension of a closure.
- `


  ### [min](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/UnitRangeStruct#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV3mins5Int16Vvp)


  ` The minimum value of the operational range for this dimension, where the unit of
  measurement is specified by `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/ClosureUnitEnum.html`. The value of `min` must be less than or
  equal to the value of `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/UnitRangeStruct.html#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV3maxs5Int16Vvp` and greater than or equal to -32768. The default value is 0.

  #### Declaration

  Swift

      let min: Int16

- `


  ### [max](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/UnitRangeStruct#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV3maxs5Int16Vvp)


  ` The maximum value of the operational range for this dimension, where the unit of
  measurement is specified by `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/ClosureUnitEnum.html`. The value of `max` must be greater than or
  equal to the value of `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/UnitRangeStruct.html#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV3mins5Int16Vvp` and less than or equal to 32767. The default value is 1.

  #### Declaration

  Swift

      let max: Int16

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ClosureDimensionTrait/UnitRangeStruct#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV7decoderAG0aB3SDK0G7DecoderV_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/ClosureDimensionTrait/UnitRangeStruct#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV6encode4withy0aB3SDK0G7EncoderC_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/ClosureDimensionTrait/UnitRangeStruct#/s:15GoogleHomeTypes6MatterO21ClosureDimensionTraitV15UnitRangeStructV11structField2id0aB3SDK0L0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

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