Repository navigation
No-bus days, school-year pause, any account vehicle per profile (v0.6.0) - #5
Conversation
- Until the bus moves that day (faster than 2 m/s, or 200 m from where it was parked), poll once a minute. If it hasn't moved by the arrival time plus the late tolerance, stop for the day (status not_running). - "Running late" and "no GPS fix" only after the bus has moved that day, so holidays and snow days stay silent. - Each profile has a "School year ends" date (the coming June 30; existing profiles get one via a 2.1 -> 2.2 migration). After it the profile pauses (status season_over) and a Repairs notice asks the parent to confirm the new schedule. Saving a future date reactivates it. - "Forget recorded trips and relearn the route" option on Edit a bus profile; trips past the 60-day retention are now also dropped when loaded. - The Bus list offers every vehicle the Traccar login or Bouncie account can see, so a new bus next year is just an edit. - Status stays idle until the bus moves; docs record the measured Bouncie cadence (a new position every ~15 s, ~7 s old), so no webhooks are needed. 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: 87d5e9943d
ℹ️ 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".
| self.reset(now.date()) | ||
| # keep the latest fix so a stale fix isn't re-processed as new | ||
| self.last_fix, self.last_pos, self.prev = fix, pos, prev | ||
| self.day_origin = pos # where the bus was parked overnight |
There was a problem hiding this comment.
Establish today's parked origin before inferring movement
When a normal school day is followed by a holiday, the retained position is typically the previous arrival at the child's stop: the coordinator stops fetching positions after arrival. Carrying that position into day_origin means a fresh stationary fix at the depot more than 200 m away sets moved_today=True, even though the bus has not moved during today's window. This reproducibly re-enables running-late alerts and fast polling and prevents the holiday give-up logic from taking effect. Establish an appropriate current-day baseline rather than treating the last observed arrival as the overnight parking location.
Useful? React with 👍 / 👎.
Summary
Set-and-forget handling for days without a bus and for the new school year. Neither Traccar nor Bouncie knows about routes, so BusMonitor goes by whether the vehicle moves.
not_running.season_over), and a Repairs notice asks the parent to confirm the schedule and set the next end date.docs/bouncie.mdrecords the measured Bouncie cadence from two real trips. While driving, every 15 s poll returned a new position that was about 7 s old, so webhooks aren't needed.Test plan
pytest(121 passed): newtests/test_no_service.py, plus a test for switching to a bus that wasn't picked at setupruff checknot_runningafter the give-up time🤖 Generated with Claude Code