AutoApi.ChargingSessionState (auto_api v13.2.0) View Source

Keeps ChargingSession state

Link to this section Summary

Functions

Callback implementation for AutoApi.State.base/0.

Build state based on binary value

Convenience function to build the State properties.

Parse state to bin

Link to this section Types

Specs

brand() ::
  :unknown
  | :abarth
  | :alfaromeo
  | :alpine
  | :audi
  | :bmw
  | :cadillac
  | :chevrolet
  | :chrysler
  | :citroen
  | :cupra
  | :dacia
  | :dodge
  | :ds
  | :fiat
  | :ford
  | :honda
  | :hyundai
  | :iveco
  | :jaguar
  | :jeep
  | :kia
  | :lancia
  | :land_rover
  | :lexus
  | :man
  | :mazda
  | :mercedes_benz
  | :mini
  | :mitsubishi
  | :nissan
  | :opel
  | :peugeot
  | :porsche
  | :renault
  | :seat
  | :skoda
  | :smart
  | :subaru
  | :toyota
  | :volkswagen
  | :volvo_cars
  | :emulator

Specs

business_errors() :: String.t()

Specs

end_time() :: DateTime.t()

Specs

nonce() :: binary()

Specs

start_time() :: DateTime.t()

Specs

t() :: %AutoApi.ChargingSessionState{
  brand:
    AutoApi.State.property(
      :unknown
      | :abarth
      | :alfaromeo
      | :alpine
      | :audi
      | :bmw
      | :cadillac
      | :chevrolet
      | :chrysler
      | :citroen
      | :cupra
      | :dacia
      | :dodge
      | :ds
      | :fiat
      | :ford
      | :honda
      | :hyundai
      | :iveco
      | :jaguar
      | :jeep
      | :kia
      | :lancia
      | :land_rover
      | :lexus
      | :man
      | :mazda
      | :mercedes_benz
      | :mini
      | :mitsubishi
      | :nissan
      | :opel
      | :peugeot
      | :porsche
      | :renault
      | :seat
      | :skoda
      | :smart
      | :subaru
      | :toyota
      | :volkswagen
      | :volvo_cars
      | :emulator
    ),
  business_errors: AutoApi.State.multiple_property(String.t()),
  calculated_energy_charged: AutoApi.State.property(AutoApi.UnitType.energy()),
  charging_cost: AutoApi.State.property(AutoApi.CustomType.charging_cost()),
  displayed_start_state_of_charge:
    AutoApi.State.property(AutoApi.CustomType.percentage()),
  displayed_state_of_charge:
    AutoApi.State.property(AutoApi.CustomType.percentage()),
  end_time: AutoApi.State.property(DateTime.t()),
  energy_charged: AutoApi.State.property(AutoApi.UnitType.energy()),
  location: AutoApi.State.property(AutoApi.CustomType.charging_location()),
  nonce: AutoApi.State.property(binary()),
  odometer: AutoApi.State.property(AutoApi.UnitType.length()),
  preconditioning_state:
    AutoApi.State.property(AutoApi.CustomType.active_state()),
  public_charging_points:
    AutoApi.State.multiple_property(AutoApi.CustomType.charging_point()),
  start_time: AutoApi.State.property(DateTime.t()),
  time_zone: AutoApi.State.property(String.t()),
  timestamp: AutoApi.State.property(DateTime.t()),
  total_charging_duration: AutoApi.State.property(AutoApi.UnitType.duration()),
  vehicle_signature: AutoApi.State.property(binary()),
  vin: AutoApi.State.property(String.t())
}

Specs

time_zone() :: String.t()

Specs

timestamp() :: DateTime.t()

Specs

vehicle_signature() :: binary()

Specs

vin() :: String.t()

Link to this section Functions

Specs

base() :: t()

Callback implementation for AutoApi.State.base/0.

Specs

from_bin(binary()) :: t()

Build state based on binary value

iex> bin = <<11, 0, 4, 1, 0, 1, 1>> iex> AutoApi.ChargingSessionState.from_bin(bin) %AutoApi.ChargingSessionState{preconditioning_state: %AutoApi.Property{data: :active}}

Link to this function

put(state, property, property_component_or_params)

View Source

Specs

put(struct(), atom(), AutoApi.Property.t() | keyword() | map()) :: struct()

Convenience function to build the State properties.

See AutoApi.State.put/3.

Examples

iex> state_base = AutoApi.DiagnosticsState.base()
iex> odometer = %{value: 10_921, unit: :kilometers}
iex> state_1 = AutoApi.DiagnosticsState.put(state_base, :odometer, data: odometer)
iex> state_2 = AutoApi.State.put(state_base, :odometer, data: odometer)
iex> state_1 === state_2
true

Specs

to_bin(t()) :: binary()

Parse state to bin

iex> state = %AutoApi.ChargingSessionState{preconditioning_state: %AutoApi.Property{data: :inactive}} iex> AutoApi.ChargingSessionState.to_bin(state) <<11, 0, 4, 1, 0, 1, 0>>