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 Swiss public transport via stations #115891
base: dev
Are you sure you want to change the base?
Conversation
Hey there @fabaff, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
new_unique_id = ( | ||
f"{config_entry.data[CONF_START]} {config_entry.data[CONF_DESTINATION]}" | ||
) | ||
new_unique_id = unique_id_from_config(config_entry.data) |
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.
This addition of via
should probably bump the config entry version again as it's not really backwards compatible.
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.
Do I understand correctly that it is forward compatible and does not need a migration but it going back will break. Is that correct? @gjohansson-ST
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 wonder if this doesn't need to bump the major version as with the addition of via
in the unique id I don't think it would work if a user goes backwards in versions.
I don't think bumping a minor version is enough.
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 not that familiar with this kind of policy within home assistant. Currently I only add via stations, but there are some more useful options in the api which will require another jump in the future. What would you suggest? Be on the save side and jump a major? @gjohansson-ST
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.
@gjohansson-ST We already had a discussion about that here: #107087 (comment)
My interpretation would be to make sure one cannot bump back to a prior version (1.2) as it would break and therefore switch the version bump to a major version to (2.1) instead of (1.3).
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 also extended the unit test for the migration to be able to test all different starting versions using parametrisation.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Add
via
stations to the config of the connections. Up to 5 via stations are allowed by the api.The legacy
import
viayaml
is left out, as it will get removed soon.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
..coveragerc
.To help with the load of incoming pull requests: