Skip to content

Add support for live London Underground and DLR departures#156

Closed
omega1119 wants to merge 4 commits into
chrisys:mainfrom
omega1119:feat/live-tube-times
Closed

Add support for live London Underground and DLR departures#156
omega1119 wants to merge 4 commits into
chrisys:mainfrom
omega1119:feat/live-tube-times

Conversation

@omega1119

Copy link
Copy Markdown

This pull request introduces a major new feature: support for live London Underground and DLR departures using the TfL Unified API, selectable via a new mode environment variable. It also updates configuration, documentation, and display logic to support this new mode, while maintaining compatibility with the existing National Rail departures. Below are the most important changes:

New Feature: TfL Underground/DLR Departures

  • Added support for live London Underground and DLR arrivals using the TfL Unified API, enabled by setting mode to tube. The display now renders an Underground-style next-train board with arrival order, destination, and a live countdown, as well as a scrolling status line showing platform and live train location. No API key is required for TfL, but an optional tflAppKey can be provided to increase rate limits. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Configuration and Environment Variables

  • Updated balena.yml and documentation to add new environment variables: mode, tubeLine, tubeDirection, and tflAppKey. These allow selection of data source, filtering by line or direction, and configuration for both National Rail and TfL modes. [1] [2] [3] [4] [5] [6]

Display and Rendering Logic

  • Added new rendering functions and logic in main.py to support the TfL board layout, including destination, countdown, and a scrolling status line. The startup screen now displays "Powered by Transport for London" when in tube mode. [1] [2] [3] [4] [5] [6]

Documentation Updates

  • Updated README.md and configuration docs to describe the new TfL mode, clarify which API keys are required, and provide instructions and notes for using tube mode, including differences in filtering and display compared to National Rail. [1] [2] [3] [4]

Versioning

  • Bumped version to 0.8.0 to reflect the addition of the new feature. [1] [2]…ied API

Simon White added 4 commits June 9, 2026 09:30
- Only recreate viewports when data actually changes
- Reuse existing viewport between refresh cycles
- Separates data refresh from rendering for smooth animations
- Includes tube disruption message support and direction filtering
- tubeDirection='westbound' now correctly maps to direction='inbound' in API
- tubeDirection='eastbound' maps to direction='outbound'
- Fixes issue where compass direction filters were never matching
- When westbound service is available, it will now display correctly
@omega1119 omega1119 closed this Jun 13, 2026
@omega1119 omega1119 deleted the feat/live-tube-times branch June 13, 2026 10:36
@omega1119 omega1119 restored the feat/live-tube-times branch June 13, 2026 10:38
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