tobiasehlert / teslamateapi

TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON
MIT License
94 stars 22 forks source link

Ability to use custom API endpoint #307

Open jlestel opened 3 weeks ago

jlestel commented 3 weeks ago

As already discussed #255 #292 the official Tesla API will be the only way to send commands.

Using third-party Tesla API providers (or a self-hosted commands proxy) would allow command endpoints to be preserved.

I added an environment variable to allow users to choose their API provider.

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

tobiasehlert commented 1 week ago

hi @jlestel,

Thanks for your pull request!

Just of curiosity, is this to be able to send the requests through MyTeslamate towards the Fleet API endpoint or what is the goal? I'm considering either removing the commands section from TeslaMateAPI or yeah.. try to change it so that it can be used with the Fleet API directly (even though I don't use the commands endpoints anymore).

Kind regards, Tobias

jlestel commented 1 week ago

Two things regarding this pull request, what do you think?

  1. I prefer use the same environment variable names as used in the TeslaMate project for reusability within the setup (pushed in 5b32d3e).
  2. Would be good to have some info-message at startup that says that the TESLA_API_HOST environment variable is set and therefore is overriding the API command calls.

Other than that it looks good to me :)

Agree on both bullets.

jlestel commented 1 week ago

hi @jlestel,

Thanks for your pull request!

Just of curiosity, is this to be able to send the requests through MyTeslamate towards the Fleet API endpoint or what is the goal? I'm considering either removing the commands section from TeslaMateAPI or yeah.. try to change it so that it can be used with the Fleet API directly (even though I don't use the commands endpoints anymore).

Kind regards, Tobias

no I already send commands via myteslamate. the goal is rather to propose an oss mobile application for teslamate via teslamateapi.

so if it allows users who have their api command to use it to send commands with teslamateapi.