# SlotAdjustmentStruct

    struct SlotAdjustmentStruct

Indicates requested power and duration adjustments for a specific slot.
- `


  ### [slotIndex](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV9slotIndexs5UInt8Vvp)


  ` The index into the \[slots list\]\[DeviceEnergyManagementTrait.ForecastStruct.slots\] within
  the forecast to be modified.

  #### Declaration

  Swift

      let slotIndex: UInt8

- `


  ### [nominalPower](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV12nominalPowers5Int64VSgvp)


  ` The power, in milliwatts, at which the ESA is being requested to operate.

  #### Declaration

  Swift

      let nominalPower: Int64?

- `


  ### [duration](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV8durations6UInt32Vvp)


  ` The new amount of time, in seconds, to which the ESA is extending or shortening its
  duration.

  #### Declaration

  Swift

      let duration: UInt32

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/DeviceEnergyManagementTrait/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV7decoderAG0aB3SDK0H7DecoderV_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/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV6encode4withy0aB3SDK0H7EncoderC_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/SlotAdjustmentStruct#/s:15GoogleHomeTypes6MatterO27DeviceEnergyManagementTraitV20SlotAdjustmentStructV11structField2id0aB3SDK0M0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

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