home-assistant-ecosystem / python-opendata-transport

Python client for interacting with transport.opendata.ch
MIT License
11 stars 9 forks source link

Show only direct connections #19

Open nbarrientos opened 6 months ago

nbarrientos commented 6 months ago

Hi,

Sorry for posting here stuff about the HA integration but I thought it'd be faster to reach you :)

Would it be feasible to patch the HA integration to configure a given connection to only show direct connections? This lib and the API seem to support it.

It does not seem complicated: maybe an extra user_input in config_flow which would enable the direct parameter in the OpendataTransport object. I don't have much experience touching the HA codebase but I can try.

What do you think?

nbarrientos commented 6 months ago

Maybe I spoke too fast: https://github.com/OpendataCH/Transport/issues/216

nbarrientos commented 6 months ago

So yeah, according to the reply in the ticket above the direct parameter (and many more) are not supported anymore.

There's still the chance to keep the parameter in the library and do the filtering at this stage to kind of simulate the missing functionality in the API. Would you be willing to review a patch to do so?

nbarrientos commented 6 months ago

Ping @miaucl

miaucl commented 6 months ago

Hey guys, as you might know, it takes some time to integrate into HA and as it was a old integration, the focus lies first on clean up before new features are considered. But yes, this is already on my radar 👍

nbarrientos commented 6 months ago

Great, if I can help somehow here I am. I'm specially interested in being able to filter out non-direct connections, preferably at HA level. I've seen a patch of yours has been recently merged in HA to have separate entities per departure. If each departure_x had the transfers attribute it'd be easy to filter in templates, for instance.