ha-area-picker: change "sorting_label" #28221
Open
+2
−1
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.
Breaking change
Proposed change
Currently in
ha-area-pickerareas are sorted by their names.Since
--areas may belong to floors,
--since we can set a "level" option for each floor aimed to define a physical position of a floor,
this PR proposes a different sorting order based on that "level" value (where applicable).
In the example below, we have 4 floors (cellar -> basement -> 1st floor -> 2 floor) with levels "-1, 0, 1, 2" (levels are manually assigned to floors by users).

Now these areas sorted from the "cellar" to "areas not assoc. to floors":
Warning:
This approach MAY conflict with #27986.
But in that #27986 - imho - the "level" property is not used, although I believed that exactly that "level" property should be used by users to define a physical location.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: