AutoApi.HomeChargerState (auto_api v13.2.0) View Source
HomeCharger 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
authentication_mechanism() :: :pin | :app
Specs
authentication_state() :: :unauthenticated | :authenticated
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
charging_status() :: :disconnected | :plugged_in | :charging
Specs
nonce() :: binary()
Specs
plug_type() :: :type_1 | :type_2 | :ccs | :chademo
Specs
t() :: %AutoApi.HomeChargerState{ authentication_mechanism: AutoApi.State.property(:pin | :app), authentication_state: AutoApi.State.property(:unauthenticated | :authenticated), 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_current: AutoApi.State.property(AutoApi.UnitType.electric_current()), charging_power: AutoApi.State.property(AutoApi.UnitType.power()), charging_power_kw: AutoApi.State.property(AutoApi.UnitType.power()), charging_status: AutoApi.State.property(:disconnected | :plugged_in | :charging), coordinates: AutoApi.State.property(AutoApi.CustomType.coordinates()), maximum_charge_current: AutoApi.State.property(AutoApi.UnitType.electric_current()), minimum_charge_current: AutoApi.State.property(AutoApi.UnitType.electric_current()), nonce: AutoApi.State.property(binary()), plug_type: AutoApi.State.property(:type_1 | :type_2 | :ccs | :chademo), price_tariffs: AutoApi.State.multiple_property(AutoApi.CustomType.price_tariff()), solar_charging: AutoApi.State.property(AutoApi.CustomType.active_state()), timestamp: AutoApi.State.property(DateTime.t()), vehicle_signature: AutoApi.State.property(binary()), vin: AutoApi.State.property(String.t()), wi_fi_hotspot_enabled: AutoApi.State.property(AutoApi.CustomType.enabled_state()), wi_fi_hotspot_password: AutoApi.State.property(String.t()), wi_fi_hotspot_security: AutoApi.State.property(AutoApi.CustomType.network_security()), wi_fi_hotspot_ssid: AutoApi.State.property(String.t()) }
Specs
timestamp() :: DateTime.t()
Specs
vehicle_signature() :: binary()
Specs
vin() :: String.t()
Specs
wi_fi_hotspot_password() :: String.t()
Specs
wi_fi_hotspot_ssid() :: String.t()
Link to this section Functions
Specs
base() :: t()
Callback implementation for AutoApi.State.base/0
.
Specs
Build state based on binary value
iex> AutoApi.HomeChargerState.from_bin(<<1, 4::integer-16, 1, 0, 1, 1>>) %AutoApi.HomeChargerState{charging_status: %AutoApi.Property{data: :plugged_in}}
Specs
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
Parse state to bin
iex> state = %AutoApi.HomeChargerState{charging_status: %AutoApi.Property{data: :plugged_in}} iex> AutoApi.HomeChargerState.to_bin(state) <<1, 4::integer-16, 1, 0, 1, 1>>