-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Use runtime_data for Swiss Public Transport #128369
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
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
d32eea5
to
9e3560c
Compare
@gjohansson-ST There shouldn't be any direct imports anymore now. |
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.
Thanks @miaucl 👍
* use runtime_data instead of hass.data[<key>] * fix service response export type * reduce runtime_data to be just the coordinator * fix rebase * fix ruff * address reviews * address reviews * no general core import * no general config_entries import * fix also for services * remove untyped config entry * remove unneeded cast
Proposed change
Implement
config_entry.runtime_data
instead ofhass.data[<key>]
based on this post: https://developers.home-assistant.io/blog/2024/04/30/store-runtime-data-inside-config-entry/There was also a bug with the service call which returned a dict containing a
datetime
object instead ofJsonValueType
. This was overlooked as withhass.data
, the type isAny
. No it is typed and thereforemypy
raised an error.Now we cannot just return the dataclass but have to create a simpler dict only containing allowed value types.
--> Addressed in: #128391
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: