Repository navigation
vNext: Find the config entry of a device with config_entry_id - #577
Merged
Merged
Conversation
DeviceEntry.config_entries is deprecated, because a device belongs to one config entry, and it stops working in Home Assistant 2027.10. The services now read DeviceEntry.config_entry_id, which exists in 2026.10 and later. New tests call both services on a loaded entry, on an unloaded entry and with an unknown device.
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.
Fixes a deprecation that @p-monteiro found on the Home Assistant dev branch:
It stops working in Home Assistant 2027.10.
Change
async_get_device_from_service_call()inservices.pyreads the one entry fromDeviceEntry.config_entry_idinstead of looping overconfig_entries. The errors stay the same:config_entry_not_foundwhen the entry is missing or belongs to another domain, andentry_not_loadedwhen it is not loaded.config_entry_idexists in Home Assistant 2026.10 and 2026.11 (checked inhomeassistant/helpers/device_registry.pyof both tags), so the minimum version of 2026.11 is fine.tests/config_flow/test_services.py: both services on a loaded entry (and noconfig_entrieswarning in the log), a device of an unloaded entry, and an unknown device ID. There were no service tests before.The other deprecation from the same run,
UNDEFINEDandUndefinedType, is not touched: its replacement does not exist in 2026.11 yet. That is tracked in #575.Testing
gree_custom.get_prop_valueswithPow,ModandSetTemreturns the values, with zero tracebacks. 2026.11.1 does not log this warning, so the real unit only proves that the service still works.