Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] Add Teslamate integration #35

Merged
merged 4 commits into from
Aug 5, 2024
Merged

[CORE] Add Teslamate integration #35

merged 4 commits into from
Aug 5, 2024

Conversation

Zegorax
Copy link
Contributor

@Zegorax Zegorax commented Jul 22, 2024

Ciao,

Hope you're doing well!

You can find in this PR an integration with Teslamate in addition to Teslalogger. It's using the Factory pattern and interface extensions to have a clean code and working regardless of what the backend provider is.

I made a little modification regarding the distance mechanism. I've changed the check and instead of relying on the distance, it will check whether there is a "fixed" lat/long in the shared link DB (The form allows the creation without one). Therefore, if there is nothing, it will use the destination set in the Tesla.

Feel free to review it and don't hesitate to ask me if you have any question :)

And of course, please test it extensively!

@flosoft
Copy link
Owner

flosoft commented Jul 23, 2024

Awesome stuff! Thanks for your work on this!
I'll give it a test with my TeslaLogger later today and if all works well, I'll merge and build.

Copy link
Owner

@flosoft flosoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor changes, but otherwise looks good to go.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this file. We could instead add a docker-compose.yml.teslamate example including TeslaETA.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it was used for my development only and got committed by mistake.

elif name == "teslamate":
return teslamate.TeslamateBackendProvider(base_url, car_id)
else:
raise Exception(f"Unknown backend provider : {name}. Available choices are 'teslalogger' or 'teslamagte'.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch with the typo, will fix it.

@flosoft flosoft merged commit cbf7dcd into flosoft:master Aug 5, 2024
flosoft added a commit that referenced this pull request Aug 5, 2024
@Zegorax
Copy link
Contributor Author

Zegorax commented Aug 5, 2024

Sorry I just received the notification about it being merged. Thanks!

Zegorax added a commit to Zegorax/TeslaETA that referenced this pull request Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants