hasl-sensor / integration

Swedish Public Transport Sensor (HASL). Formerly named HomeAssistant SL Sensor
https://hasl.sorlov.com
Apache License 2.0
36 stars 8 forks source link

Problem with multiple stops at the same bus stop #48

Open mrtnrth opened 2 years ago

mrtnrth commented 2 years ago

In some odd cases, a bus makes multiple stops during a route at the same bus stop (same site id). This is the case for me where my bus makes a first stop and then comes back a few minutes later after turning around. Both stops are on the same route (same direction and same siteid) and the stop name is the same. The siteid in my case is 7037.

In cases like this, I would only want to display the second stop the bus makes since that's the one I need to time things for.

When making a manual request to the SL API, it seems like these stops can be separated by looking at the StopPointNumber attribute in the json response. It doesn't seem like this attribute is parsed though so can't figure out how to filter on it.

Would it be possible to have an option to include additional attributes in the parsed data perhaps, so I can do some manual filtering on this? Or would it be better to use a RESTful sensor in odd cases like this one?

DSorlov commented 2 years ago

This sounds absolutely like a attribute that can be added. I will add this hopefully in two releases as I currently already locked the next release from adding features.

DSorlov commented 2 years ago

Also; perhaps you could already now use the Resrobot option? (It's available in the now beta and soon-to-be released next version).