Bug fixes and some enhancements
Overview
Focus on flexible destination filtering, post-setup editing, richer sensor metadata, and earlier + clearer stop lookup service availability.
Changes
✨ New
- Destination (substring) filter replaces numeric direction selector; key name direction kept for backward compatibility.
- Options Flow: Edit line filter, destination filter, time window, refresh interval after setup. #4
- Stop lookup service available without sensors (add empty trafiklab: YAML stub to load early).
- last_update attribute on sensor (UTC ISO8601).
- Enhanced list: minutes_until, delay_minutes, formatted time, platform fallback.
🔧 Changes
- Config entry version 2: mutable keys moved from [data] → [options] (auto-migrated).
- Sensor titles capitalized (“Departures” / “Arrivals”).
- Logging tagged [Trafiklab] for service + setup diagnostics.
- Optional trafiklab: CONFIG_SCHEMA added for early load.
🐞 Fixes
- Destination (formerly direction) filtering now applied reliably #3
- Removed duplicate constant definitions.
- Refactored sensor/coordinator to eliminate structural/indent issues.
- Service registers even before first config entry (early + late startup paths).
- Unique ID generation improved to avoid clashes when filters differ.
🔄 Migration / Compatibility
- Automatic migration; no manual action.
- Old direction numeric values remain as plain strings; now treated as free-text (still accepted).
- To mimic old “both directions”, just leave destination filter empty.
🚀 Upgrade Steps
- Update files / pull via HACS.
- Restart Home Assistant.