-
-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Replace hass.data[DATA_ENOCEAN] by config_entry.runtime_data #161997
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
base: dev
Are you sure you want to change the base?
Replace hass.data[DATA_ENOCEAN] by config_entry.runtime_data #161997
Conversation
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.
Pull request overview
This PR migrates the EnOcean integration away from using hass.data[...] storage and instead uses ConfigEntry.runtime_data to hold the dongle instance, aligning the integration with current Home Assistant patterns.
Changes:
- Removed legacy
hass.datakeys/constants previously used for EnOcean runtime storage. - Added a typed
EnOceanConfigEntryandEnOceanConfigRuntimeDatacontainer forruntime_data. - Updated
async_setup_entry/async_unload_entryto store and retrieve the dongle viaconfig_entry.runtime_data.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/components/enocean/const.py |
Removes now-unneeded hass.data storage constants. |
homeassistant/components/enocean/config_entry.py |
Introduces typed config entry runtime data definitions for the integration. |
homeassistant/components/enocean/__init__.py |
Switches setup/unload logic from hass.data to config_entry.runtime_data. |
|
This is a first (minor) step towards my larger PR #161251 |
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.
A new module for this is not useful
Just keep them at the top of __init__.py
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
…home-assistant-core into use-config-runtime-data
epenet
left a comment
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.
Or maybe you don't even need the class if it has only one property...
Proposed change
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: