AutoApi.ChargingState (auto_api v13.2.0) View Source

Keeps Charging 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

acoustic_limit() :: :no_action | :automatic | :unlimited | :limited

Specs

battery_charge_type() ::
  :no_charge
  | :normal
  | :accelerated
  | :fast
  | :quick
  | :ultra_fast
  | :not_used
  | :vehicle_to_home
  | :vehicle_to_grid

Specs

battery_led() ::
  :no_colour
  | :white
  | :yellow
  | :green
  | :red
  | :yellow_pulsing
  | :green_pulsing
  | :red_pulsing
  | :green_red_pulsing
  | :green_flashing
  | :initialising
  | :error

Specs

battery_status() ::
  :inactive
  | :active
  | :balancing
  | :external_load
  | :load
  | :error
  | :initialising
  | :conditioning
Link to this type

battery_temperature_control_demand()

View Source

Specs

battery_temperature_control_demand() ::
  :high_cooling
  | :medium_cooling
  | :low_cooling
  | :no_temperature_requirement
  | :low_heating
  | :medium_heating
  | :high_heating
  | :circulation_requirement

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

charge_mode() ::
  :immediate | :timer_based | :inductive | :conductive | :push_button

Specs

charging_end_reason() ::
  :unknown
  | :goal_reached
  | :requested_by_driver
  | :connector_removed
  | :powergrid_failed
  | :hv_system_failure
  | :charging_station_failure
  | :parking_lock_failed
  | :no_parking_lock
  | :signal_invalid

Specs

charging_phases() :: :no_charging | :one | :two | :three
Link to this type

charging_time_display()

View Source

Specs

charging_time_display() ::
  :no_display | :display_duration | :no_display_duration
Link to this type

charging_window_chosen()

View Source

Specs

charging_window_chosen() :: :not_chosen | :chosen

Specs

current_type() :: :alternating_current | :direct_current
Link to this type

departure_time_display()

View Source

Specs

departure_time_display() :: :no_display | :reachable | :not_reachable

Specs

nonce() :: binary()

Specs

plug_type() :: :type_1 | :type_2 | :ccs | :chademo

Specs

plugged_in() :: :disconnected | :plugged_in | :plugged_in_both_sides
Link to this type

preconditioning_error()

View Source

Specs

preconditioning_error() ::
  :no_change
  | :not_possible_low
  | :not_possible_finished
  | :available_after_engine_restart
  | :general_error
Link to this type

smart_charging_option()

View Source

Specs

smart_charging_option() :: :price_optimized | :renewable_energy | :co2_optimized
Link to this type

smart_charging_status()

View Source

Specs

smart_charging_status() ::
  :wallbox_is_active | :scc_is_active | :peak_setting_active
Link to this type

starter_battery_state()

View Source

Specs

starter_battery_state() :: :red | :yellow | :green | :orange | :green_yellow

Specs

status() ::
  :not_charging
  | :charging
  | :charging_complete
  | :initialising
  | :charging_paused
  | :charging_error
  | :cable_unplugged
  | :slow_charging
  | :fast_charging
  | :discharging
  | :foreign_object_detected
  | :conditioning
  | :flap_open

Specs

t() :: %AutoApi.ChargingState{
  acoustic_limit:
    AutoApi.State.property(:no_action | :automatic | :unlimited | :limited),
  auxiliary_power: AutoApi.State.property(AutoApi.UnitType.power()),
  battery_capacity: AutoApi.State.property(AutoApi.UnitType.energy()),
  battery_charge_type:
    AutoApi.State.property(
      :no_charge
      | :normal
      | :accelerated
      | :fast
      | :quick
      | :ultra_fast
      | :not_used
      | :vehicle_to_home
      | :vehicle_to_grid
    ),
  battery_cooling_temperature:
    AutoApi.State.property(AutoApi.UnitType.temperature()),
  battery_current: AutoApi.State.property(AutoApi.UnitType.electric_current()),
  battery_current_ac:
    AutoApi.State.property(AutoApi.UnitType.electric_current()),
  battery_current_dc:
    AutoApi.State.property(AutoApi.UnitType.electric_current()),
  battery_energy: AutoApi.State.property(AutoApi.UnitType.energy()),
  battery_energy_chargable: AutoApi.State.property(AutoApi.UnitType.energy()),
  battery_led:
    AutoApi.State.property(
      :no_colour
      | :white
      | :yellow
      | :green
      | :red
      | :yellow_pulsing
      | :green_pulsing
      | :red_pulsing
      | :green_red_pulsing
      | :green_flashing
      | :initialising
      | :error
    ),
  battery_level: AutoApi.State.property(AutoApi.CustomType.percentage()),
  battery_level_at_departure:
    AutoApi.State.property(AutoApi.CustomType.percentage()),
  battery_max_available: AutoApi.State.property(AutoApi.UnitType.energy()),
  battery_status:
    AutoApi.State.property(
      :inactive
      | :active
      | :balancing
      | :external_load
      | :load
      | :error
      | :initialising
      | :conditioning
    ),
  battery_temperature: AutoApi.State.property(AutoApi.UnitType.temperature()),
  battery_temperature_control_demand:
    AutoApi.State.property(
      :high_cooling
      | :medium_cooling
      | :low_cooling
      | :no_temperature_requirement
      | :low_heating
      | :medium_heating
      | :high_heating
      | :circulation_requirement
    ),
  battery_temperature_extremes:
    AutoApi.State.property(AutoApi.CustomType.temperature_extreme()),
  battery_tempretature_extremes:
    AutoApi.State.property(AutoApi.CustomType.temperature_extreme()),
  battery_voltage:
    AutoApi.State.property(AutoApi.UnitType.electric_potential_difference()),
  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
    ),
  charge_limit: AutoApi.State.property(AutoApi.CustomType.percentage()),
  charge_mode:
    AutoApi.State.property(
      :immediate
      | :timer_based
      | :inductive
      | :conductive
      | :push_button
    ),
  charge_port_state: AutoApi.State.property(AutoApi.CustomType.position()),
  charger_voltage:
    AutoApi.State.property(AutoApi.UnitType.electric_potential_difference()),
  charger_voltage_ac:
    AutoApi.State.property(AutoApi.UnitType.electric_potential_difference()),
  charger_voltage_dc:
    AutoApi.State.property(AutoApi.UnitType.electric_potential_difference()),
  charging_complete_lock:
    AutoApi.State.property(AutoApi.CustomType.active_state()),
  charging_current: AutoApi.State.property(AutoApi.UnitType.electric_current()),
  charging_end_reason:
    AutoApi.State.property(
      :unknown
      | :goal_reached
      | :requested_by_driver
      | :connector_removed
      | :powergrid_failed
      | :hv_system_failure
      | :charging_station_failure
      | :parking_lock_failed
      | :no_parking_lock
      | :signal_invalid
    ),
  charging_phases: AutoApi.State.property(:no_charging | :one | :two | :three),
  charging_rate: AutoApi.State.property(AutoApi.UnitType.power()),
  charging_rate_kw: AutoApi.State.property(AutoApi.UnitType.power()),
  charging_single_immediate:
    AutoApi.State.property(AutoApi.CustomType.active_state()),
  charging_time_display:
    AutoApi.State.property(
      :no_display
      | :display_duration
      | :no_display_duration
    ),
  charging_window_chosen: AutoApi.State.property(:not_chosen | :chosen),
  current_limit: AutoApi.State.property(AutoApi.UnitType.electric_current()),
  current_type: AutoApi.State.property(:alternating_current | :direct_current),
  departure_time_display:
    AutoApi.State.property(:no_display | :reachable | :not_reachable),
  departure_times:
    AutoApi.State.multiple_property(AutoApi.CustomType.departure_time()),
  driving_mode_phev:
    AutoApi.State.property(AutoApi.CustomType.driving_mode_phev()),
  estimated_range: AutoApi.State.property(AutoApi.UnitType.length()),
  estimated_range_target: AutoApi.State.property(AutoApi.UnitType.length()),
  flap_lock_status: AutoApi.State.property(AutoApi.CustomType.lock_state()),
  fully_charged_end_times:
    AutoApi.State.property(AutoApi.CustomType.weekday_time()),
  limit_status: AutoApi.State.property(AutoApi.CustomType.active_state()),
  max_charging_current:
    AutoApi.State.property(AutoApi.UnitType.electric_current()),
  max_range: AutoApi.State.property(AutoApi.UnitType.length()),
  min_charging_current:
    AutoApi.State.property(AutoApi.UnitType.electric_current()),
  nonce: AutoApi.State.property(binary()),
  plug_lock_status: AutoApi.State.property(AutoApi.CustomType.lock_state()),
  plug_type: AutoApi.State.property(:type_1 | :type_2 | :ccs | :chademo),
  plugged_in:
    AutoApi.State.property(:disconnected | :plugged_in | :plugged_in_both_sides),
  preconditioning_departure_enabled:
    AutoApi.State.property(AutoApi.CustomType.enabled_state()),
  preconditioning_departure_status:
    AutoApi.State.property(AutoApi.CustomType.active_state()),
  preconditioning_error:
    AutoApi.State.property(
      :no_change
      | :not_possible_low
      | :not_possible_finished
      | :available_after_engine_restart
      | :general_error
    ),
  preconditioning_immediate_status:
    AutoApi.State.property(AutoApi.CustomType.active_state()),
  preconditioning_remaining_time:
    AutoApi.State.property(AutoApi.UnitType.duration()),
  preconditioning_scheduled_time:
    AutoApi.State.property(AutoApi.CustomType.time()),
  reduction_times:
    AutoApi.State.multiple_property(AutoApi.CustomType.reduction_time()),
  restriction:
    AutoApi.State.property(AutoApi.CustomType.charging_restriction()),
  smart_charging_option:
    AutoApi.State.property(
      :price_optimized
      | :renewable_energy
      | :co2_optimized
    ),
  smart_charging_status:
    AutoApi.State.property(
      :wallbox_is_active
      | :scc_is_active
      | :peak_setting_active
    ),
  starter_battery_state:
    AutoApi.State.property(:red | :yellow | :green | :orange | :green_yellow),
  status:
    AutoApi.State.property(
      :not_charging
      | :charging
      | :charging_complete
      | :initialising
      | :charging_paused
      | :charging_error
      | :cable_unplugged
      | :slow_charging
      | :fast_charging
      | :discharging
      | :foreign_object_detected
      | :conditioning
      | :flap_open
    ),
  time_to_complete_charge: AutoApi.State.property(AutoApi.UnitType.duration()),
  timers: AutoApi.State.multiple_property(AutoApi.CustomType.timer()),
  timestamp: AutoApi.State.property(DateTime.t()),
  vehicle_signature: AutoApi.State.property(binary()),
  vin: AutoApi.State.property(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 = <<23, 0, 4, 1, 0, 1, 8>> iex> AutoApi.ChargingState.from_bin(bin) %AutoApi.ChargingState{status: %AutoApi.Property{data: :fast_charging}}

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.ChargingState{status: %AutoApi.Property{data: :fast_charging}} iex> AutoApi.ChargingState.to_bin(state) <<23, 0, 4, 1, 0, 1, 8>>