# PowerAdjustStruct

    struct PowerAdjustStruct

The amount and duration of a power adjustment.
- `


  ### [minPower](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV03minI0s5Int64Vvp)


  ` The minimum power, in milliwatts, to which the ESA can have its power adjusted. A negative
  value indicates that the power flows away from loads, as in charging a battery inverter.

  #### Declaration

  Swift

      let minPower: Int64

- `


  ### [maxPower](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV03maxI0s5Int64Vvp)


  ` The maximum power, in milliwatts, that the ESA can have its power adjusted to. A negative
  value indicates that the power flows away from loads, as in charging a battery inverter.

  #### Declaration

  Swift

      let maxPower: Int64

- `


  ### [minDuration](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV11minDurations6UInt32Vvp)


  ` The minimum duration, in seconds, that a controller can invoke an ESA adjustment.

  #### Declaration

  Swift

      let minDuration: UInt32

- `


  ### [maxDuration](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV11maxDurations6UInt32Vvp)


  ` The maximum duration, in seconds, that a controller can invoke an ESA adjustment.

  #### Declaration

  Swift

      let maxDuration: UInt32

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV7decoderAG0aB3SDK0H7DecoderV_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/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV6encode4withy0aB3SDK0H7EncoderC_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/DeviceEnergyManagementTrait/PowerAdjustStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV17PowerAdjustStructV11structField2id0aB3SDK0M0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

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