Closed araines closed 11 months ago
When selecting a station with only a single calling point (the destination), the lovelace card fails.
I currently believe this is because the calling points are not a list when only one item (probably an XML parsing problem).
Single calling point journeys should work
nationalrail-times-card
YAML state
- Browser: Chrome - HA Version: 2023.10.5 - NationalRailTimes: 1.0.2
Comparing the calling points from WSU to SUO (single calling point):
Calling points locationName: Sutton (London) crs: SUO st: '22:14' et: '22:18'
Versus the calling points from SUO to LBG (multiple calling points):
Calling points - locationName: Carshalton Beeches crs: CSB st: '21:59' et: On time length: '5' - locationName: Wallington crs: WLT st: '22:01' et: On time length: '5' - locationName: Waddon crs: WDO st: '22:05' et: On time length: '5' - locationName: West Croydon crs: WCY st: '22:09' et: On time length: '5' - locationName: Norwood Junction crs: NWD st: '22:15' et: On time length: '5' - locationName: London Bridge crs: LBG st: '22:28' et: On time length: '5'
You can see the latter is a list, whereas the former is not.
I'm planning to take a look to see if I can provide a patch for this as well.
Requirements
Current Behavior
When selecting a station with only a single calling point (the destination), the lovelace card fails.
I currently believe this is because the calling points are not a list when only one item (probably an XML parsing problem).
Expected Behavior
Single calling point journeys should work
Steps To Reproduce
nationalrail-times-card
card in lovelaceContext
YAML state
Environment
Anything else?
Comparing the calling points from WSU to SUO (single calling point):
Versus the calling points from SUO to LBG (multiple calling points):
You can see the latter is a list, whereas the former is not.
I'm planning to take a look to see if I can provide a patch for this as well.