Skip to content

Commit

Permalink
Add client_options param to pass to API client (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyu authored Sep 10, 2020
1 parent 4facc2a commit 6cdd653
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tesla_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def initialize(
client_id: ENV['TESLA_CLIENT_ID'],
client_secret: ENV['TESLA_CLIENT_SECRET'],
retry_options: nil,
base_uri: nil
base_uri: nil,
client_options: {}
)
@email = email
@base_uri = base_uri || BASE_URI
Expand All @@ -26,7 +27,9 @@ def initialize(

@api = Faraday.new(
@base_uri + '/api/1',
headers: { 'User-Agent' => "github.com/timdorr/tesla-api v:#{VERSION}" }
{
headers: { 'User-Agent' => "github.com/timdorr/tesla-api v:#{VERSION}" }
}.merge(client_options)
) do |conn|
conn.request :json
conn.response :json
Expand Down

0 comments on commit 6cdd653

Please sign in to comment.