-
-
Notifications
You must be signed in to change notification settings - Fork 35k
Deprecate DeviceEntry.suggested_area #149730
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
Conversation
A github code search for The search query above, filtered for false positives, suggests it's used by: |
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 deprecates the DeviceEntry.suggested_area
property in Home Assistant. The property was not stored persistently, making its behavior unpredictable and unreliable. It was primarily used in tests with only one exception being device analytics dump functionality.
Key changes:
- Deprecates the
suggested_area
property with a deprecation warning - Updates all tests to use
area_id
instead ofsuggested_area
- Removes
suggested_area
from snapshot test outputs
Reviewed Changes
Copilot reviewed 128 out of 128 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/syrupy.py | Adds removal of _suggested_area from serialization for snapshots |
tests/helpers/test_device_registry.py | Adds deprecation test and updates existing tests to use area_id |
Multiple test snapshot files | Removes suggested_area from expected device output |
Various integration test files | Updates tests to use area_id and area registry instead of suggested_area |
Comments suppressed due to low confidence (1)
tests/helpers/test_device_registry.py:2512
- There is a typo in the variable name: 'witout' should be 'without'.
orig_kitchen_light_without_suggested_area = device_registry.async_update_device(
I think we should have a breaking change for MQTT in advance of this one. Marking the YAML options as deprecated, and explaining this no longer works. This will prevent unexpected results. I think the deprecation deadline is okay BTW. |
It should probably be more clear that this is only deprecating reading the property not actually suggesting an area |
This PR does not deprecate the suggested_area functionality, it just removed the suggested_area attribute from the |
Ah, I misunderstood. I'll discuss with @emontnemery about the MQTT feature in this. |
Tagged for 2025.8.0 to prevent merge conflicts with #149758 |
Proposed change
Deprecate
DeviceEntry.suggested_area
.Note:
Setting
suggested_area
inDeviceInfo
, and passingsuggested_area
toDeviceRegistry.async_get_or_create
is still supported and influences the area of craeted devices, although that may change in the future.Rationale:
DeviceEntry.suggested_area
was not stored, meaning its behavior was unpredictable. Moreover, was used almost only in tests, the one exception being device analytics dump.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: