Use Mix.Project.config/0 to get version at compile time

This commit is contained in:
Adrian Kumpf
2021-03-13 21:06:12 +01:00
parent 323eb0dd26
commit 6d31adba00
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
defmodule TeslaApi do
use Tesla
@version Application.spec(:teslamate, :vsn)
@version Mix.Project.config()[:version]
adapter Tesla.Adapter.Finch, name: TeslaMate.HTTP, receive_timeout: 35_000
+2 -1
View File
@@ -10,8 +10,9 @@ defmodule TeslaApi.Auth do
@client_secret "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3"
@redirect_uri "https://auth.tesla.com/void/callback"
@version Mix.Project.config()[:version]
@default_headers [
{"user-agent", "TeslaMate/#{Application.spec(:teslamate, :vsn)}"},
{"user-agent", "TeslaMate/#{@version}"},
{"Accept", "*/*"},
{"Accept-Encoding", "gzip, deflate, br"},
{"Connection", "keep-alive"}
+1 -1
View File
@@ -1,7 +1,7 @@
defmodule TeslaMate.Locations.Geocoder do
use Tesla, only: [:get]
@version Application.spec(:teslamate, :vsn)
@version Mix.Project.config()[:version]
adapter Tesla.Adapter.Finch, name: TeslaMate.HTTP, receive_timeout: 30_000
+1 -1
View File
@@ -4,7 +4,7 @@ defmodule TeslaMate.Updater do
require Logger
@version Application.spec(:teslamate, :vsn)
@version Mix.Project.config()[:version]
@name __MODULE__
adapter Tesla.Adapter.Finch, name: TeslaMate.HTTP