Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restriction of the mode of transport #18

Open
lkazarin opened this issue Aug 18, 2023 · 3 comments
Open

Restriction of the mode of transport #18

lkazarin opened this issue Aug 18, 2023 · 3 comments

Comments

@lkazarin
Copy link

At one of the public transport stop, I would like to see only one view, for example, only buses.

What could I change in this code?

SCR-20230818-kewy
@vas3k
Copy link
Owner

vas3k commented Aug 20, 2023

Right now the component doesn't have a filter function, but you can add one.

For example, like this (open for discussion):

filters:
  - type: bus,tram
  - name: M27,N117

Next you will need to write code that will take this configuration variable into account and store only the necessary departures. Somewhere here: https://github.com/vas3k/home-assistant-berlin-transport/blob/main/custom_components/berlin_transport/sensor.py#L161

@lkazarin lkazarin reopened this Aug 21, 2023
@lkazarin
Copy link
Author

Thank you, but I'm not a real welder, I just found a mask in the trash :)

@Jellymath
Copy link

I think you can do something like this with existing component:

sensor:
  - platform: berlin_transport
    departures:
      - name: "S+U Schönhauser Allee"
        stop_id: 900110001
        bus: true # not really needed as true is default, but added for clarity
        suburban: false
        subway: false
        tram: false
        ferry: false
        express: false
        regional: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants