-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Add config flow to NMBS #121548
Add config flow to NMBS #121548
Conversation
Hey there @thibmaek, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Is the liveboard a current available feature? |
Yes. By configuring the station live parameter in the configuration yaml you get the next train to depart as additional sensor. |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I still had some comments from a while back.
I still feel like liveboard shouldn't be its own entry and we can just combine that with the normal entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing a test:
- Where we try to setup an already set up entry that already exists, which should abort
- Where do the same but then with importing
Not clear at the moment if we can take updated unique ids right now, or later since now the localized names are used in the unique id. |
I did a test of this too. Having a setup between station A and B and the same between station A and B but now also with vias does not work. It says This also means one cannot configure two sensors for both direct and indirect trains. Must we not create both OR allow both to be created? Should unique id not contain if it is with vias? Another one is the functionality of the state of the sensor. Why do we keep duration? Isn't departure time including delays more relevant? |
True that, that was a problem before as well as both would make the same sensor anyway. I will look into it. |
Maybe such thing can be solved with config sub entries, which might land soon |
Breaking change
Removes support for configuration by
configuration.yml
file.The "name" and "station_live" options cannot longer be configured. The config flow will setup 2 disabled sensors for the "station_from" and "station_to" provided in the config flow. You can set a custom "name" after setting up the config flow.
Proposed change
Adds a config flow for nmbs integration. The
configuration.yml
had combined options allowing to specify a connection between 2 stations, additionally one can add a specific configuration option to have a sensor showing the next first departing train in a specific station.The config flow only supports the "connection" and setups 2 disabled "liveboard" for the "from" and "to" sensors. Here is a overview:
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: