Closed clearminds closed 2 years ago
This looks very promising. However there are some changes I would like to have implemented.
According to current dev there is some handling (and ignoring) of walking results in the trip planner. So; walking is not counted as a transfer (as it is at SL), and also when destination and origin it is the stops.
See line 275 of haslworker/init.py for inspration on possible solution.
#Add shortcuts to info in the first trip if it exists
firstLegFirstTrip = next((x for x in newdata['trips'][0]['legs'] if x["category"] != "WALK"), [])
lastLegLastTrip = next((x for x in reversed(newdata['trips'][0]['legs']) if x["category"] != "WALK"), [])
newdata['transfers'] = sum(p["category"] != "WALK" for p in newdata['trips'][0]['legs'])-1 or 0
More handling is also on line 240. There are some changes that you did not capture from dev in regards to the attributes returned also. Looking very promising and will merge if the above changes are completed.
Will now close due to inactivity and new conflicts.
Hello @clearminds! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
custom_components/hasl3/haslworker/__init__.py
: