PowerAdjustStruct

struct PowerAdjustStruct

The amount and duration of a power adjustment.

  • 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
  • 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
  • The minimum duration, in seconds, that a controller can invoke an ESA adjustment.

    Declaration

    Swift

    let minDuration: UInt32
  • The maximum duration, in seconds, that a controller can invoke an ESA adjustment.

    Declaration

    Swift

    let maxDuration: 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)?