Enhance HafasClient with detailed departure information, line is currently NOT working
This commit is contained in:
parent
d0a67d5a18
commit
0c3d4f7653
2 changed files with 55 additions and 6 deletions
|
|
@ -66,10 +66,10 @@ def run_station_monitor(hafas: backend.HafasClient | None = None):
|
|||
inputBuffer.insert_text(f"\n {station[0]}")
|
||||
resultBuffer.text = f"Ergebnisse für: {results[0][1]}\n\n"
|
||||
station = results[0][1] if results else "Keine Ergebnisse gefunden."
|
||||
result = hafas.getArrDep(station, arrdep="ARR", count=3)
|
||||
inputBuffer.insert_line_below()
|
||||
for entry in result:
|
||||
resultBuffer.insert_text(f"\n {result[0]}")
|
||||
departures = hafas.getArrDep(station, arrdep="ARR", count=3)
|
||||
resultBuffer.text = "\n".join(
|
||||
[resultBuffer.text.rstrip()] + [f" {entry['departure_time']} {entry['line']} {entry['name']}" for entry in departures]
|
||||
)
|
||||
|
||||
else:
|
||||
app_state = "MONITOR"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue