View Source PorscheConnEx.Struct.Unit.Speed (porsche_conn_ex v0.1.0)

Structure representing units of speed.

Fields

  • celsius (atom) — units used, depends on locale
    • :km_per_hour — kilometres per hour (km/h)
    • :mi_per_hour — miles per hour (mph)
  • value (float) — value in above units
  • km_per_hour (float) — equivalent value in kilometres per hour

Like most units in this API, a normalised value (km_per_hour) is included, regardless of locale settings.

Given the numbers returned by the API, it's pretty clear that the values are stored in km/h (rounded to whole numbers), and are converted to miles per hour for imperial locales.

Summary

Types

@type t() :: %PorscheConnEx.Struct.Unit.Speed{
  km_per_hour: float(),
  unit: unit(),
  value: float()
}
@type unit() :: :km_per_hour | :mi_per_hour