struct ChargingTargetStruct
A single user-specified charging target for an electric vehicle.
-
The desired charging completion time of the associated day, where the time is represented by a 16-bit unsigned integer to designate the minutes past midnight. For example, 6 a.m. is represented by 360 minutes past midnight.
Declaration
Swift
let targetTimeMinutesPastMidnight: UInt16
-
The target SoC, in percentage, that the vehicle should be charged to before the
targetTimeMinutesPastMidnight
is reached.Declaration
Swift
let targetSoC: UInt8?
-
The amount of energy, in milliwatt hours, that the user would like to have added to the vehicle before the
targetTimeMinutesPastMidnight
is reached.Declaration
Swift
let addedEnergy: Int64?
-
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
. ThrowsHomeError.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)?