-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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 time and offset config to Swiss public transport connections #120357
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
|
Wouldn't it be better if we allow timestamp sensors in general to add a trigger with an offset. I've been looking at this problem for a while. I've seen other integrations with timestamps also implementing this kind of functionality. |
Are you sure we are talking about the same thing? This aims to get information from an api using an offset related to that external api, not the homeassistant timestamps. The information is loaded instantaneously and not by an offset. @tsvi |
Ok, so this is information coming from the API. My bad. |
Not to my knowledge as the docs are generated using the strings.json about the fields to be configured. |
Wouldn't this use case be covered by service calls? I am just a bit scared that this will end up with a lot of extra configuration options in the future |
There is currently no possibility to get the connections at time X or in Y minutes. Only instantly. This applies for sensors and services. There a minimum set of options to specify in a transport app: location, via, time/date and transportation mode. If you have a better idea how to specify that bedsides the config or service call params, I am all ear. But being able to factor in the duration of path to a station and discard impossible connections is really useful. @joostlek |
That's not the case @miaucl, although it's an interesting idea to do that. |
This comment was marked as outdated.
This comment was marked as outdated.
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.
Some initial remarks
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
This comment was marked as outdated.
This comment was marked as outdated.
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.
Some minor remarks 👍
The last video posted 2 days ago does not reflect the code...
Thanks @gjohansson-ST, here is the up-to-date video. Bildschirmaufnahme.2024-11-08.um.14.09.08.mp4 |
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.
LGTM 👍
Proposed change
Instead of only getting connections departing now, this PR adds functionality to choose between departure and arrival, a fixed time of day and a moving offset.
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: