-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
Bump area registry to version 1.9 and sort areas #157634
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
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 bumps the area registry storage version to 1.9 and implements case-insensitive alphabetical sorting of areas during migration. This fixes an issue where areas weren't properly sorted after manual sorting functionality was introduced in PR #156802, ensuring the frontend displays areas in the expected order.
Key changes:
- Bumps
STORAGE_VERSION_MINORfrom 8 to 9 in the area registry - Adds migration logic to sort existing areas alphabetically by name using case-insensitive comparison
- Adds comprehensive test coverage for the migration, verifying both runtime behavior and persisted storage
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/helpers/area_registry.py |
Bumps storage version to 1.9 and adds migration to sort areas by name using case-insensitive comparison |
tests/helpers/test_area_registry.py |
Enhances migration test with multiple areas to verify correct case-insensitive alphabetical sorting ("AAA", "bbb", "CCC") |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
piitaya
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.
The logic seems to be good according to previous front-end logic : alphabetic order
frenck
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.
Proposed change
Bump area registry to version 1.9 and sort areas
Sort order is:
Sorting existing areas was forgotten when allowing users to sort their areas manually in PR #156802; frontend now respects the sort order in the area registry which in most cases is not as expected. This PR does a minimal effort attempt of sorting existing areas.
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: