mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +08:00
Use Mix.Project.config/0 to get version at compile time
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user