Skip to content

"Announce as" name per profile; say vehicle names naturally (v0.5.3) - #4

Merged
aniceberg merged 1 commit into
mainfrom
announce-as
Oct 29, 2026
Merged

aniceberg merged 1 commit into
mainfrom
announce-as

Conversation

@aniceberg

Copy link
Copy Markdown
Owner

What

  • "Announce as" (optional) on Add / Edit a bus profile. When set, every spoken text for that profile uses it:

    • checkpoint, street, late, arrived and offline alerts (message, plus the event's bus)
    • describe_location ("where is the bus?")
    • the map panel's bus label.

    So "Daniel – morning" and "Daniel – afternoon" can both announce "Daniel's bus".

  • Vehicle names sound natural. Without Announce as, the vehicle's name is used, but "Bus" is now only added before a route number:

    • 12 → "Bus 12" and 18 Orange → "Bus 18 Orange", as before.
    • Oleg's bus, Carpool van and Bus 7 are said as is.

    Before, every name not starting with "bus" got the prefix, giving "Bus Oleg's bus is about 5 minutes away."

  • Profile names are unique across all Bus Monitor entries, not just within one. The services (describe_location, reset_trip, suggest_checkpoints) and the map look a profile up by id across entries. Two "Morning" profiles in a Traccar and a Bouncie entry would have been ambiguous: the first one found would win.

Implementation

announce_as is stored in the profile and loaded into the existing BusConfig.bus_name. The coordinator only fills bus_name from the vehicle when it's empty. Every speaker already reads bus_name, so the override needed no other changes.

Reviewer notes

  • Behavior change for Traccar users: a vehicle named with letters first, without "bus" (e.g. Orange), is no longer said as "Bus Orange". Announce as restores any wording someone wants.
  • Existing duplicates: if two entries already share a profile id, nothing changes until one of them is added or edited. The check only blocks new clashes.

Tests

ruff, pytest (103 tests) and hassfest (run locally in Docker) all pass. New and updated tests:

  • bus_label cases (route numbers, "Oleg's bus", "Carpool van", "12 bus")
  • Announce as in alert bus/message and in describe_location
  • Edit sets, trims and clears it, falling back to the vehicle name
  • a name used by another entry is rejected.

🤖 Generated with Claude Code

- Optional "Announce as" on Add/Edit a bus profile: alerts, their
  message, and "where is the bus?" use it, e.g. "Daniel's bus".
- Without it the vehicle name is used, and "Bus" is only added before a
  route number ("12" -> "Bus 12"), so "Oleg's bus" is no longer
  "Bus Oleg's bus".
- Profile names must be unique across all Bus Monitor entries, since
  services and the map find a profile by id across entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T15:08:37.927908Z 4346311 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@aniceberg
aniceberg merged commit fae1f0e into main Oct 29, 2026
6 checks passed
@aniceberg
aniceberg deleted the announce-as branch October 29, 2026 16:34
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