ConstraintsStruct

struct ConstraintsStruct

Allows a client such as an EMS to inform an ESA about a constraint period.

  • The start time, in UTC, of the constraint period.

    Declaration

    Swift

    let startTime: UInt32
  • The duration, in seconds, of the constraint period.

    Declaration

    Swift

    let duration: UInt32
  • The nominal power, in milliwatts, at which the EMS requests the ESA to operate during the constrained period.

    Declaration

    Swift

    let nominalPower: Int64?
  • The maximum amount of energy, in megawatt hours, that the ESA can use during the constraint period. This is a signed value and can be used to indicate charging or discharging.

    Declaration

    Swift

    let maximumEnergy: Int64?
  • Indicates the turn-up or turn-down value for the ESA during the constraint period. This is expressed as a signed value between -100 and +100. A negative value indicates a request to use less energy, and a positive value indicates a request to use more energy. A value of 0 is neutral.

    Declaration

    Swift

    let loadControl: Int8?
  • 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)?