Skip to content

Add MTA Next Train community ability#227

Open
chadnewbry wants to merge 7 commits intoopenhome-dev:devfrom
chadnewbry:add-mta-next-train
Open

Add MTA Next Train community ability#227
chadnewbry wants to merge 7 commits intoopenhome-dev:devfrom
chadnewbry:add-mta-next-train

Conversation

@chadnewbry
Copy link
Copy Markdown

What does this Ability do?

🚇 Adds MTA Next Train, a voice-first NYC subway arrivals ability for OpenHome. Users can save one default station for the fastest demo path, then ask things like "when's my next train?" or get more specific with line and station filters.

Suggested Trigger Words

  • next train
  • next subway
  • when's my next train
  • subway arrivals
  • mta
  • mta next train

Type

  • New community Ability
  • Improvement to existing Ability
  • Bug fix
  • Documentation update

External APIs

  • No external APIs
  • Uses external API(s): SubwayInfo.nyc for station search + live arrivals. No API key required.

Testing

  • Tested in OpenHome Live Editor
  • All exit paths tested (local ability flow and harness exit cases)
  • Error scenarios tested (invalid station / no matches / remote fetch handling)

Local Verification

🚉 Fixture tests

  • python3 -m unittest discover -s community/mta-next-train/tests -v

🚉 Ability validation

  • python3 validate_ability.py community/mta-next-train

🚉 Local harness

  • python3 community/mta-next-train/test_harness.py --phrase "when is the next northbound 6 train at astor place"

🚉 Live no-key endpoint check

  • python3 community/mta-next-train/test_harness.py --live --phrase "next 6 train at astor place"

Example live output when tested locally:

At Astor Pl, next trains: southbound 6 in 1 minute, then 4 minutes; northbound 6 in 3 minutes, then 7 minutes.

Checklist

  • Files are in community/mta-next-train/
  • main.py follows SDK pattern (extends MatchingCapability, has register_capability + call)
  • README.md included with description, suggested triggers, and setup
  • resume_normal_flow() called on every exit path
  • No print() in the ability runtime code — using editor_logging_handler
  • No hardcoded API keys — using a no-key provider
  • No blocked imports (redis, user_config)
  • No asyncio.sleep() or asyncio.create_task() — using session_tasks
  • Error handling on all external calls
  • Tested in OpenHome Live Editor

Anything else?

🚆 Review route map:

  • main.py keeps the OpenHome voice flow thin
  • mta_next_train_core.py holds the query parsing, station matching, and SubwayInfo client
  • test_harness.py gives a quick way to demo both fixture mode and live mode

🛤️ Fun demo path for review:

  1. Install the ability
  2. Say set my default station to Astor Place
  3. Say when's my next train?

If this lands, it feels like a very clean subway-on-speakers demo: fast, specific, and zero setup friction for the user.

@chadnewbry chadnewbry requested a review from a team as a code owner March 27, 2026 21:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✅ Community PR Path Check — Passed

All changed files are inside the community/ folder. Looks good!

@github-actions github-actions bot added the community-ability Community-contributed ability label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

🔀 Branch Merge Check

PR direction: add-mta-next-traindev

Passedadd-mta-next-traindev is a valid merge direction

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✅ Ability Validation Passed

📋 Validating: community/mta-next-train
  ⚠️  Found 5 classes — only one class per main.py is recommended
  ✅ All checks passed!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

🔍 Lint Results

🔧 Auto-formatted

Some files were automatically cleaned and formatted with autoflake + autopep8 and committed.

  • Unused imports removed (autoflake)
  • Unused variables removed (autoflake)
  • PEP8 formatting applied (autopep8)

__init__.py — Empty as expected

Files linted: community/mta-next-train/main.py

✅ Flake8 — Passed

✅ All checks passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant