EVChargingTariffElementCondition
public struct EVChargingTariffElementCondition : Hashable
Condition that the charging session needs to meet to apply the tariff element. Tariff elements may include conditions that define when they apply:
- Time of day (e.g., 22:00–06:00)
- Day of week (e.g., weekends only)
Date
Date range (e.g., seasonal pricing)- Charging session duration
- Battery level thresholds (e.g., overstay fees)
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Date range when the tariff element is valid. This is typically used to indicate seasonal tariffs or to announce an update to the tariff in advance. It may also be used to indicate spot prices, together with time period.
Declaration
Swift
public var date: DateRange? -
Day(s) of the week when the tariff element is valid. An example would be to specify lower prices for weekends
Declaration
Swift
public var days: [DayOfWeek] -
Time period when the tariff element is valid, in local time. The time period wraps around to the next day, when end time of the period
TimeOfDayRange.tois smaller than the beginningTimeOfDayRange.from.Declaration
Swift
public var time: TimeOfDayRange? -
Duration of the charging session when the tariff element is valid, in seconds.
Often only either one of the values is present, indicating the minimum or maximum duration.
Declaration
Swift
public var duration: EVChargingDurationRange? -
Minimum battery level when the tariff element is valid, in percentages. This can be used to set additional fees for charging a full or nearly full battery.
Declaration
Swift
public var overstayBatteryLevel: Int32? -
Creates a new instance.
Parameters
Date
Date range when the tariff element is valid. This is typically used to indicate seasonal tariffs or to announce an update to the tariff in advance. It may also be used to indicate spot prices, together with time period.- days: Day(s) of the week when the tariff element is valid. An example would be to specify lower prices for weekends
- time: Time period when the tariff element is valid, in local time. The time period wraps around to
the next day, when end time of the period
TimeOfDayRange.tois smaller than the beginningTimeOfDayRange.from. - duration: Duration of the charging session when the tariff element is valid, in seconds.
Often only either one of the values is present, indicating the minimum or maximum duration.
- overstayBatteryLevel: Minimum battery level when the tariff element is valid, in percentages. This can be used to set additional fees for charging a full or nearly full battery.
Declaration
Swift
public init(date: DateRange? = nil, days: [DayOfWeek] = [], time: TimeOfDayRange? = nil, duration: EVChargingDurationRange? = nil, overstayBatteryLevel: Int32? = nil)