fix: HA 2026.8 compatibility - explicit config_entry + runtime_data migration#1448
Open
yuya4i wants to merge 1 commit intofuatakgun:masterfrom
Open
fix: HA 2026.8 compatibility - explicit config_entry + runtime_data migration#1448yuya4i wants to merge 1 commit intofuatakgun:masterfrom
yuya4i wants to merge 1 commit intofuatakgun:masterfrom
Conversation
…nd explicit DataUpdateCoordinator config_entry - Pass config_entry explicitly to DataUpdateCoordinator.__init__() to fix ContextVar deprecation warning (breaks in HA 2026.8) - Migrate from hass.data[DOMAIN][COORDINATOR] to config_entry.runtime_data for proper type safety and multi-entry support - Remove duplicate asyncio import in coordinator.py - Remove unused COORDINATOR constant from const.py - Update manifest.json: version bump to 8.3.0, update codeowners and URLs - Update config_flow.py reauth to use runtime_data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
thanks for doing this. |
fuatakgun
requested changes
Apr 8, 2026
| message = call.data.get("message") | ||
| _LOGGER.debug(f"{DOMAIN} - end_message - message: {message}") | ||
| await coordinator.send_message(message) | ||
| for entry in hass.config_entries.async_entries(DOMAIN): |
Owner
There was a problem hiding this comment.
you should extract coordinator here:
call.hass.config_entries.async_loaded_entries(DOMAIN).runtime_data
and we should fail here in case we cannot find the enrty with runtime_data, rather than being silent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the ContextVar deprecation that will break the integration in Home Assistant 2026.8 (ref: #1370), and modernizes data storage to use
config_entry.runtime_data.Changes
coordinator.py: Passconfig_entryexplicitly toDataUpdateCoordinator.__init__()— fixes the ContextVar deprecation warning__init__.py: Migrate fromhass.data[DOMAIN][COORDINATOR]toconfig_entry.runtime_datapattern (recommended since HA 2024.4)camera.py,sensor.py,switch.py, etc.): Updated coordinator access fromhass.data[DOMAIN][COORDINATOR]toconfig_entry.runtime_dataconfig_flow.py: Updated reauth flow to useruntime_dataconst.py: Removed unusedCOORDINATORconstantmanifest.json: Version bump to 8.3.0asyncioimportWhy this matters
config_entryis not explicitly passed toDataUpdateCoordinator(currently shows deprecation warning)runtime_dataprovides type safety and proper cleanup on unloadTesting
py_compilesyntax checkhass.data[DOMAIN][COORDINATOR]orCOORDINATORconstantTest plan
🤖 Generated with Claude Code