SlotAdjustmentStruct

struct SlotAdjustmentStruct

Indicates requested power and duration adjustments for a specific slot.

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

    Declaration

    Swift

    let slotIndex: UInt8
  • The power, in milliwatts, at which the ESA is being requested to operate.

    Declaration

    Swift

    let nominalPower: Int64?
  • The new amount of time, in seconds, to which the ESA is extending or shortening its duration.

    Declaration

    Swift

    let duration: UInt32
  • 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.

  • 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
  • Returns the field corresponding to the given field ID.

    Declaration

    Swift

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