mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-09-17 16:52:47 +00:00
transitous rewrite: set vc status to next_station
This commit is contained in:
+4
-2
@@ -3,13 +3,15 @@
|
||||
"token": "",
|
||||
"server": ,
|
||||
"vc": ,
|
||||
"lang": "de"
|
||||
"lang": "de",
|
||||
"formatting": "┇",
|
||||
"emojis": true
|
||||
},
|
||||
"connections": {
|
||||
"stations": [
|
||||
""
|
||||
"Berlin Hauptbahnhof",
|
||||
"Amsterdam",
|
||||
"Helsinki"
|
||||
],
|
||||
"blacklist": [],
|
||||
"min_duration": 5,
|
||||
|
||||
@@ -123,7 +123,7 @@ def get_random_stop_id() -> str | None:
|
||||
|
||||
stop_ids_list = list(stop_ids.keys())
|
||||
if len(stop_ids_list) > 1:
|
||||
logger(f"No station associated as '{assigned_station}', choosing random from similar named station")
|
||||
logger(f"No station associated as '{assigned_station}', choosing random from similar named stations")
|
||||
logger(f"Run `python run main.py stations` to get exact station names")
|
||||
chosen_stop_id, chosen_station = random.choice(list(stop_ids.items()))
|
||||
logger(f"Assigned Station: {chosen_station}")
|
||||
@@ -235,8 +235,8 @@ def get_trip_details(random_connection: dict | None) -> dict | None:
|
||||
"to": goes_to,
|
||||
"agency": legs["agencyName"],
|
||||
"route_color": legs.get("routeColor"),
|
||||
"duration": legs["duration"],
|
||||
"departure": departure_dt.strftime("%H:%M"),
|
||||
"departure_dt": departure_dt,
|
||||
"arrival": arrival_dt.strftime("%H:%M"),
|
||||
"arrival_dt": arrival_dt,
|
||||
"mode": mode,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
channel:
|
||||
status: "Ankunft um {arrival}"
|
||||
long_name:
|
||||
train_from: "{train_name} nach {goes_to} von {train_from}"
|
||||
train_via: "{train_name} nach {goes_to} über {from_station}"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
channel:
|
||||
status: "Ankunft um {arrival}"
|
||||
long_name:
|
||||
train_from: "{train_name} to {goes_to} from {train_from}"
|
||||
train_via: "{train_name} to {goes_to} via {from_station}"
|
||||
|
||||
@@ -110,9 +110,15 @@ OPERATORS = {
|
||||
"GVB": {
|
||||
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/BSicon_LOGO_GVB.svg/960px-BSicon_LOGO_GVB.svg.png",
|
||||
"color": 0x2B62AF
|
||||
},
|
||||
"Berliner Verkehrsbetriebe": {
|
||||
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/BVG_Logo_07.2021.svg/960px-BVG_Logo_07.2021.svg.png",
|
||||
"color": 0xEFD13C
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
OPERATOR_ALIASES = {
|
||||
"Arverio Bayern GmbH": OPERATORS["Arverio Bayern"],
|
||||
"DB Regio AG Baden-Württemberg": OPERATORS["db_bawü"],
|
||||
|
||||
@@ -15,7 +15,6 @@ class LongName:
|
||||
|
||||
@dataclass
|
||||
class Channel:
|
||||
status: str
|
||||
long_name: LongName
|
||||
|
||||
|
||||
|
||||
@@ -157,7 +157,6 @@ def get_next_station(stops: dict, train_from: str) -> dict | None:
|
||||
"name": name,
|
||||
"arrival": arrival_dt
|
||||
}
|
||||
|
||||
return None
|
||||
|
||||
def format_via_list(stops: dict, via_and: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user