Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 39 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
name: CI
on: [push]
jobs:
mix_test:
name: mix test (Elixir ${{ matrix.elixir }} OTP ${{ matrix.otp }})
strategy:
matrix:
elixir: ['1.9.4', '1.10.4', '1.11.2']
include:
- elixir: '1.9.4'
otp: '22.x'
- elixir: '1.10.4'
otp: '22.3'
- elixir: '1.11.2'
otp: '23.1'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- uses: actions/cache@v3
with:
path: _build
key: build-elixir-${{ matrix.elixir }}-otp-${{ matrix.otp }}-mix-${{ hashFiles('mix.lock') }}
restore-keys: |
build-elixir-${{ matrix.elixir }}-otp-${{ matrix.otp }}-mix-
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Install Dependencies
run: mix deps.get
- name: Run Tests
run: mix test
- name: Run formatter
run: mix format --check-formatted
- name: Run credo
run: mix credo
- name: Run dialyzer
env:
MIX_ENV: test
run: mix dialyzer --halt-exit-status
mix_test:
name: mix test (Elixir ${{ matrix.elixir }} OTP ${{ matrix.otp }})
strategy:
matrix:
elixir: ['1.18.2']
include:
- elixir: '1.18.2'
otp: '27.2.4'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- uses: actions/cache@v3
with:
path: _build
key: build-elixir-${{ matrix.elixir }}-otp-${{ matrix.otp }}-mix-${{ hashFiles('mix.lock') }}
restore-keys: |
build-elixir-${{ matrix.elixir }}-otp-${{ matrix.otp }}-mix-
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Install Dependencies
run: mix deps.get
- name: Run Tests
run: mix test
- name: Run formatter
run: mix format --check-formatted
- name: Run credo
run: mix credo
- name: Run dialyzer
env:
MIX_ENV: test
run: mix dialyzer --halt-exit-status
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
elixir 1.18.2-otp-27
erlang 27.2.4
2 changes: 1 addition & 1 deletion lib/auto_api/capabilities/charging_capability.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule AutoApi.ChargingCapability do
iex> C.description
"Charging"
iex> length(C.properties)
81
84
iex> List.first(C.properties)
{0x02, :estimated_range}
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/auto_api/capabilities/maintenance_capability.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule AutoApi.MaintenanceCapability do
iex> M.description
"Maintenance"
iex> length(M.properties)
40
44
iex> List.first(M.properties)
{0x01, :days_to_next_service}
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/auto_api/capabilities/trips_capability.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule AutoApi.TripsCapability do
iex> T.description
"Trips"
iex> length(T.properties)
30
31
iex> List.first(T.properties)
{1, :type}
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/auto_api/capabilities/usage_capability.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule AutoApi.UsageCapability do
iex> U.description
"Usage"
iex> length(U.properties)
51
62
iex> List.first(U.properties)
{0x01, :average_weekly_distance}
"""
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
%{
"assertions": {:hex, :assertions, "0.19.0", "f177fcc22b55df6a41a58b151e430d189d0a1083dae3240522503dedaf8e1174", [:mix], [], "hexpm", "759bdbf977fe3e2d2b79f8a65d8674f29ac757781136a6cb4adf88f1574af1d8"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"credo": {:hex, :credo, "1.7.17", "f92b6aa5b26301eaa5a35e4d48ebf5aa1e7094ac00ae38f87086c562caf8a22f", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1eb5645c835f0b6c9b5410f94b5a185057bcf6d62a9c2b476da971cde8749645"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
"earmark": {:hex, :earmark, "1.4.15", "2c7f924bf495ec1f65bd144b355d0949a05a254d0ec561740308a54946a67888", [:mix], [{:earmark_parser, ">= 1.4.13", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "3b1209b85bc9f3586f370f7c363f6533788fb4e51db23aa79565875e7f9999ee"},
"earmark_parser": {:hex, :earmark_parser, "1.4.37", "2ad73550e27c8946648b06905a57e4d454e4d7229c2dafa72a0348c99d8be5f7", [:mix], [], "hexpm", "6b19783f2802f039806f375610faa22da130b8edc21209d0bff47918bb48360e"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.30.9", "d691453495c47434c0f2052b08dd91cc32bc4e1a218f86884563448ee2502dd2", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "d7aaaf21e95dc5cddabf89063327e96867d00013963eadf2c6ad135506a8bc10"},
"ex_guard": {:hex, :ex_guard, "1.6.1", "adcb30f379c8048b2cb1474052753adecfe9635b9db3bac1a4a4458c5826f735", [:mix], [{:fs, "~> 8.6.1", [hex: :fs, repo: "hexpm", optional: false]}], "hexpm", "14a4d261c9ce951f9ec2487730afc1a008c0f70c95b7fcc2f446b9d7a5346718"},
"ex_unit_notifier": {:hex, :ex_unit_notifier, "1.1.0", "a4d1a027d975a2ba84cec60200e3cb095fe1de6c6b63091ca0880e83830b09bb", [:mix], [], "hexpm", "12d78f3a62c521ee4c9f18bd01ea3b960a3200d5ca21a383b0707f4228486c4e"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"},
"fs": {:hex, :fs, "8.6.1", "7c9c0d0211e8c520e4e9eda63b960605c2711839f47285e6166c332d973be8ea", [:rebar3], [], "hexpm", "61ea2bdaedae4e2024d0d25c63e44dccf65622d4402db4a2df12868d1546503f"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"libgraph": {:hex, :libgraph, "0.16.0", "3936f3eca6ef826e08880230f806bfea13193e49bf153f93edcf0239d4fd1d07", [:mix], [], "hexpm", "41ca92240e8a4138c30a7e06466acc709b0cbb795c643e9e17174a178982d6bf"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
Expand Down
57 changes: 56 additions & 1 deletion specs/capabilities/charging.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"api": {
"intro": 2,
"update": 12
"update": 13
},
"getters": {},
"setters": [
Expand Down Expand Up @@ -680,6 +680,11 @@
"id": 1,
"name": "direct_current",
"name_pretty": "DC"
},
{
"id": 2,
"name": "wireless",
"name_pretty": "Wireless"
}
],
"examples": [
Expand Down Expand Up @@ -1855,6 +1860,18 @@
{
"id": 5,
"name": "active"
},
{
"id": 6,
"name": "initialising"
},
{
"id": 7,
"name": "fault"
},
{
"id": 8,
"name": "inactive"
}
],
"examples": [
Expand Down Expand Up @@ -2209,6 +2226,44 @@
"description": "State of health of the high-voltage battery is 90%."
}
]
},
{
"id": 81,
"name": "distance_since_charging",
"name_cased": "distanceSinceCharging",
"name_pretty": "Distance since charging",
"added": 13,
"type": "unit.length",
"size": 10,
"description": "The distance driven since the last charging session",
"examples": [
{
"data_component": "12044028cccccccccccd",
"value": {
"kilometers": 12.4
},
"description": "12.4km driven since the last charging session"
}
]
},
{
"id": 82,
"name": "charging_voltage",
"name_cased": "chargingVoltage",
"name_pretty": "Charging voltage",
"added": 13,
"type": "unit.electric_potential_difference",
"size": 10,
"description": "Charging electric voltage.",
"examples": [
{
"data_component": "0a004079000000000000",
"value": {
"volts": 400.0
},
"description": "Charging voltage is 400.0V."
}
]
}
]
}
90 changes: 90 additions & 0 deletions specs/capabilities/maintenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,96 @@
"description": "The distance to next vehicle check is 1350.4km."
}
]
},
{
"id": 37,
"name": "service_warning",
"name_cased": "serviceWarning",
"name_pretty": "Service warning",
"added": 13,
"type": "types.service_warning",
"description": "Represents the type of service required and how soon it must be performed.",
"examples": [
{
"data_component": "0000",
"values": {
"due": "no_service_required",
"reason": "unknown"
},
"description": "No service is required at this time."
},
{
"data_component": "0200",
"values": {
"due": "due",
"reason": "unknown"
},
"description": "Unknown service is due."
},
{
"data_component": "0103",
"values": {
"due": "almost",
"reason": "distance_driven"
},
"description": "Service is almost due because of distance driven."
}
]
},
{
"id": 38,
"name": "last_service_date",
"name_cased": "lastServiceDate",
"name_pretty": "Last service date",
"added": 13,
"type": "timestamp",
"size": 8,
"description": "Date of the last service performed on the vehicle.",
"examples": [
{
"data_component": "0000017fe45286dd",
"value": "2022-04-01T08:51:28.093Z",
"description": "Last service was on 1. April 2022 at 11:51:28 EEST."
}
]
},
{
"id": 39,
"name": "last_service_distance",
"name_cased": "lastServiceDistance",
"name_pretty": "Last service distance",
"added": 13,
"type": "unit.length",
"size": 10,
"description": "Distance reading at the time of the last service.",
"examples": [
{
"data_component": "120440f7590000000000",
"value": {
"kilometers": 95632.0
},
"description": "Distance reading at last service was 95'632km."
}
]
},
{
"id": 40,
"name": "next_inspection_distance",
"name_cased": "nextInspectionDistance",
"name_pretty": "Next inspection distance",
"added": 13,
"type": "unit.length",
"size": 10,
"description": "Distance reading at which the next inspection is due.",
"examples": [
{
"data_component": "120440e86a0000000000",
"value": {
"kilometers": 50000.0
},
"description": "Next inspection is due at 50'000km."
}
]
}
]
}
19 changes: 19 additions & 0 deletions specs/capabilities/trips.json
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,25 @@
"description": "Duration of trip was 123.0 minutes."
}
]
},
{
"id": 26,
"name": "average_electric_consumption",
"name_cased": "averageElectricConsumption",
"name_pretty": "Average electric consumption",
"added": 13,
"type": "unit.energy_efficiency",
"size": 10,
"description": "Average electric consumption during the trip",
"examples": [
{
"data_component": "0d00401d5c28f5c28f5c",
"value": {
"kilometers_per_kwh": 7.34
},
"description": "Average electric consumption during the trip was 7.34 km/kWh."
}
]
}
]
}
Loading
Loading