ocpp/v2_1/datatype/tariff_energy_price
OCPP 2.1 TariffEnergyPrice data type (schema TariffEnergyPriceType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Tariff with optional conditions for an energy price.
| Field | Type | Req | Description |
|---|---|---|---|
conditions | TariffConditions | — | |
custom_data | CustomData | — | |
price_kwh | Float | ✓ | Price per kWh (excl. tax) for this element. |
Schema: TariffEnergyPriceType
pub type TariffEnergyPrice {
TariffEnergyPrice(
conditions: option.Option(tariff_conditions.TariffConditions),
custom_data: option.Option(custom_data.CustomData),
price_kwh: Float,
)
}
Constructors
-
TariffEnergyPrice( conditions: option.Option(tariff_conditions.TariffConditions), custom_data: option.Option(custom_data.CustomData), price_kwh: Float, )
Values
pub fn decoder() -> decode.Decoder(TariffEnergyPrice)
Decode a TariffEnergyPrice from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(price_kwh price_kwh: Float) -> TariffEnergyPrice
Construct a TariffEnergyPrice from its required fields, with every optional field set to None.
pub fn to_json(value: TariffEnergyPrice) -> json.Json
Encode a TariffEnergyPrice to its OCPP-J JSON object.