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

Vehicle Module Priority - Preference local BLE over API #598

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

ngardiner
Copy link
Owner

@ngardiner ngardiner commented Dec 12, 2024

The idea of this branch is to introduce module priorities, which would allow us to overlap the TeslaBLE module over the top of the TeslaAPI module, so that commands like start/stop charging, wake, set charge limit etc would first be sent out via BT, and we'd look for indications in the response that confirm that the command was sent.

If this fails, it would fall back to the next priority module, the API. It's possible we could slot another module in-between these for the Tesla Fleet API - eventually the owner-api will go away and it will just be a no-op, this is my view of how we can untangle / stack technologies as Tesla deprecates the API we've depended on for a while now.

  • Implement prototype static module priorities to create initial priority order
  • Implement prototype fallback code for calling start/stop charging via this logic
  • Track the performance of modules to allow us to visualise how this is operating
  • Implement a better way of showing the statistics
  • Consider if instead of just falling back to the next priority down, we might be able to do something like assign a multiple for retry logic - eg every 10 priority = 1 retry in the event of failure.
  • Find a more appropriate way to implement this - perhaps a proxy Class which automatically routes methods in priority order
  • Replace functions outside of start/stop charge

Regressions:

  • Changes to car_api_available to replace charge argument with task needs to be updated in other locations

Tests:

  • Backwards compatibility (what happens if BLE is not loaded?)

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.

1 participant