Add train info in tooltip
This commit is contained in:
parent
7a7285106b
commit
c8416f1349
1 changed files with 5 additions and 3 deletions
|
@ -55,7 +55,7 @@ def get_destination(response) :
|
||||||
return s
|
return s
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
tooltip = ""
|
||||||
checked_in = response["checkedIn"]
|
checked_in = response["checkedIn"]
|
||||||
if checked_in or args.last_checkin is not None :
|
if checked_in or args.last_checkin is not None :
|
||||||
s = get_destination(response)
|
s = get_destination(response)
|
||||||
|
@ -64,8 +64,10 @@ if checked_in or args.last_checkin is not None :
|
||||||
st = f'{s["prefname"]} {s["humantime"]}'
|
st = f'{s["prefname"]} {s["humantime"]}'
|
||||||
if s["delay"] > 0 :
|
if s["delay"] > 0 :
|
||||||
st = st + " (+%d)" % s["delay"]
|
st = st + " (+%d)" % s["delay"]
|
||||||
|
if "train" in response :
|
||||||
|
train = response["train"]
|
||||||
|
tooltip = f'{train["type"]} {train["line"]} ({train["no"]})'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(json.dumps({"text": st, "tooltip": "", "class": "active", "percentage": ""}))
|
print(json.dumps({"text": st, "tooltip": tooltip, "class": "active", "percentage": ""}))
|
||||||
|
|
Loading…
Reference in a new issue