-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Use runtime_data in melcloud #148012
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 in melcloud #148012
Conversation
Hey there @erwindouna, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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 refactors the MelCloud integration to use the new entry.runtime_data
API instead of storing devices in hass.data
. It introduces a typed alias for the config entry, updates all platforms to pull from runtime_data
, and cleans up the unload logic.
- Define
MelCloudConfigEntry
alias and assign fetched devices toentry.runtime_data
- Update
async_setup_entry
in climate, sensor, water_heater, and diagnostics to useruntime_data
- Simplify
async_unload_entry
by removing manualhass.data
cleanup
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
__init__.py |
Add MelCloudConfigEntry alias; set and stop using hass.data ; simplify unload |
climate.py |
Update imports and async_setup_entry to use entry.runtime_data |
sensor.py |
Remove DOMAIN usage; update imports and setup to use runtime_data |
water_heater.py |
Update imports and async_setup_entry to consume entry.runtime_data |
diagnostics.py |
Switch diagnostics helper to accept MelCloudConfigEntry and drop ConfigEntry import |
Comments suppressed due to low confidence (2)
homeassistant/components/melcloud/water_heater.py:33
- The docstring mentions climate setup in the water_heater module. Update it to reflect water heater entity setup for clarity.
"""Set up MelCloud device climate based on config_entry."""
homeassistant/components/melcloud/water_heater.py:34
- Consider adding a test for
async_setup_entry
to verify thatentry.runtime_data
is correctly populated and consumed by the water heater platform.
mel_devices = entry.runtime_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.
Thanks, @epenet 👍
../Frenck
Proposed change
SSIA
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: