Repository navigation
Add Bouncie as a second vehicle-tracking provider (v0.5.0) - #1
Merged
Merged
Conversation
Parents choose Traccar or Bouncie when adding Bus Monitor; add it once per account to use both. Bouncie signs in with OAuth (Application Credentials) and is polled via GET /v1/vehicles. Device ids are now strings; v1 Traccar entries migrate to v2 with their entities, profiles and settings intact. Includes scripts/bouncie_probe.py to measure how often Bouncie positions refresh during a drive, and docs/bouncie.md for setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2cd552fa0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Move the Bouncie developer-portal and redirect URLs into description placeholders, and drop the shared OAuth abort strings that Home Assistant translates itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An InvalidAuth during polling (e.g. Bouncie API 401, changed Traccar password) now raises ConfigEntryAuthFailed instead of UpdateFailed, so Home Assistant shows the Reauthenticate prompt rather than retrying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Parents can now choose where a bus's position comes from: a Traccar server (as before) or a Bouncie OBD-II tracker. To use both, add Bus Monitor once per account; each bus profile follows one vehicle from its own entry.
https://my.home-assistant.io/redirect/oauth. Positions are polled fromGET /v1/vehicles: every 30 s by default, 15 s minimum. Reauth reruns the OAuth flow and rejects a different Bouncie account.providers/:base.pyholds the sharedDevicetype, errors andProviderprotocol,traccar.pyis the moved client, andbouncie.pyis new.traccar_client.pystays as a re-export soscripts/probe.pystill works.provider: traccarand turns stored ids into strings. Entity unique_ids ({entry}_{id}_…) don't change, so existing installs keep their entities, profiles and settings.docs/bouncie.mdcovers setup, the README is updated, andscripts/bouncie_probe.pymeasures how often Bouncie positions refresh during a drive.Why
The goal is to support one or more tracking providers as inputs. Bouncie is the first addition after Traccar.
Reviewer notes
stats.locationrefreshes mid-trip, the units of RESTspeed(mph assumed, matching the webhook docs), or any rate limits. Runscripts/bouncie_probe.pyon a drive before relying on the alerts. If positions refresh slowly,tripDatawebhooks (on the roadmap) become the priority.BouncieOAuth2Implementation._token_requestoverrides HA's form post. It reuses HA's privateconfig_entry_oauth2_flow._raise_mapped_token_errorso error handling matches HA's (4xx → reauth, 429/5xx → retry). A future HA release could rename or remove that function.(DOMAIN, id): HA 2026.10 (our minimum) already scopes them per config entry, and a test confirms a Traccar and a Bouncie vehicle with the same raw id stay separate.main(v0.4.0). Upstream's new street and time checkpoint code needed only thestrid change.Tests
ruff check .is clean andpytestpasses (92 tests). The new tests:tests/test_bouncie.py: parsing, mph → m/s, name fallbacks, paging, HTTP and refresh error mapping, and a check that the token request is JSON.tests/test_bouncie_ha.py: the full OAuth config flow, a Bouncie entry tracking and alerting, Traccar and Bouncie entries side by side, and the v1 → v2 migration keeping entities.🤖 Generated with Claude Code