Vehicle HA: add position support via device_tracker entities#28113
Vehicle HA: add position support via device_tracker entities#28113Turbo87 wants to merge 2 commits intoevcc-io:masterfrom
device_tracker entities#28113Conversation
There was a problem hiding this comment.
Sorry @Turbo87, your pull request is larger than the review limit of 150000 diff characters
Add position tracking to the Home Assistant vehicle by reading `latitude`/`longitude` attributes from `device_tracker.*` entities. This enables geofencing for the `vehicle-api` charger.
fb314bb to
2140426
Compare
yeah... I had to regenerate the vehicle decorator file with the new position field, which is causing the diff to be quite huge. is there a way to avoid that? |
|
This adds 14k lines of code due to the way the code generation works. Imho that is not a good tradeoff, more so since evcc does not have geofencing atm. |
yeah, I would tend to agree. is all of the code gen really necessary though? as mentioned above, my Go knowledge is limited :D |
|
It's what we've decided to do for "optional" interfaces. May not have been the best choice :O. Sometimes we can group them like "read phases" being dependent on "set phases". For vehicle unfortunately I couldn't find any logical grouping to reduce combinatoric complexity and not better technical approach to reduce the LoC. |
I had Claude Code take a look at alternatives and it came up with #28116. As the PR description mentions, feel free to tell me that this is completely wrong and I should stop opening such PRs :) |
I'm currently using a HomeAssistant vehicle with the vehicle API charger. The latter supports geofencing, but the HA vehicle so far did not. This PR is my attempt to fix that.
I've tried this change locally and it appears to work as expected, but I'm new to the codebase and my Go knowledge is also fairly limited, so thorough review might be appropriate... 😅