Rename range sliders to lower/upper + friendlier new-profile defaults

Device page sorts entities alphabetically by name, so 'Min/Max …' always
listed max above min ('a' < 'i'). Rename the four range numbers to
'Brightness lower/upper' and 'Color temp lower/upper' so each quantity's
lower bound sorts first. Pin suggested_object_id to the field key so new
profiles keep slugging number.<profile>_min_brightness etc., identical to
profiles created before the rename; existing entity_ids are registry-
preserved via unchanged unique_ids.

New-profile defaults: brightness 5-100% -> 10-90% (5% proved too dim on
gloomy days; 90% leaves manual-boost headroom), min color temp 2200K ->
2000K (deeper warm tone won in practice). Existing profiles unaffected —
saved options and restored slider values take precedence.

Specs synced: runtime-range-controls naming table + scenarios,
output-sensors collision references. Two new tests cover the slug pin
and the lower/upper friendly-name composition.
This commit is contained in:
Casey 2026-06-05 10:49:40 +02:00
commit ada3538449
8 changed files with 73 additions and 27 deletions

View file

@ -139,7 +139,7 @@ The resulting friendly names SHALL follow this table for a profile named `Dining
| Output-color-temp sensor | `"Output color temp"` | `Dining MVP Output color temp` |
| Sun-elevation sensor | `"Sun elevation"` | `Dining MVP Sun elevation` |
The chosen role labels SHALL NOT collide with any existing entity's `_attr_name` on the same device (specifically: not `"Brightness"`, which is the adapt-brightness switch's role per `add-runtime-range-controls`, and not `"Min color temp"` / `"Max color temp"`, which are the range-number roles).
The chosen role labels SHALL NOT collide with any existing entity's `_attr_name` on the same device (specifically: not `"Brightness"`, which is the adapt-brightness switch's role per `add-runtime-range-controls`, and not `"Color temp lower"` / `"Color temp upper"`, which are the range-number roles).
#### Scenario: Friendly names compose from device name + sensor role
@ -155,7 +155,7 @@ The chosen role labels SHALL NOT collide with any existing entity's `_attr_name`
- **WHEN** all ten entities' friendly names are inspected
- **THEN** no two entities SHALL share the same friendly name
- **AND** specifically the adapt-brightness switch ("Dining MVP Brightness") and the output-brightness sensor ("Dining MVP Output brightness") SHALL be distinguishable strings
- **AND** the output-color-temp sensor ("Dining MVP Output color temp") SHALL be distinguishable from the "Min color temp" and "Max color temp" number entities
- **AND** the output-color-temp sensor ("Dining MVP Output color temp") SHALL be distinguishable from the "Color temp lower" and "Color temp upper" number entities
### Requirement: Ambient lux sensor mirrors the configured lux sensor's reading

View file

@ -116,10 +116,12 @@ The resulting friendly names SHALL follow this table for a profile named `Dining
| Master switch | `None` | `Dining MVP` |
| Adapt-brightness switch | `"Brightness"` | `Dining MVP Brightness` |
| Adapt-color switch | `"Color"` | `Dining MVP Color` |
| Min brightness number | `"Min brightness"` | `Dining MVP Min brightness` |
| Max brightness number | `"Max brightness"` | `Dining MVP Max brightness` |
| Min color temp number | `"Min color temp"` | `Dining MVP Min color temp` |
| Max color temp number | `"Max color temp"` | `Dining MVP Max color temp` |
| Min brightness number | `"Brightness lower"` | `Dining MVP Brightness lower` |
| Max brightness number | `"Brightness upper"` | `Dining MVP Brightness upper` |
| Min color temp number | `"Color temp lower"` | `Dining MVP Color temp lower` |
| Max color temp number | `"Color temp upper"` | `Dining MVP Color temp upper` |
The range numbers use "lower/upper" wording (not "Min/Max") so the HA device page — which sorts entities alphabetically by friendly name — lists each quantity's lower bound before its upper bound. The number entities SHALL additionally pin `suggested_object_id` to their field key (`min_brightness`, `max_brightness`, `min_color_temp`, `max_color_temp`) so newly created profiles slug the same entity_ids as profiles created before the rename.
Existing `unique_id`s SHALL remain unchanged; the entity registry SHALL preserve existing `entity_id`s for any deployed install.
@ -130,7 +132,8 @@ Existing `unique_id`s SHALL remain unchanged; the entity registry SHALL preserve
- **THEN** the master switch's friendly name SHALL be exactly "Dining MVP"
- **AND** the adapt-brightness switch's friendly name SHALL be exactly "Dining MVP Brightness"
- **AND** the adapt-color switch's friendly name SHALL be exactly "Dining MVP Color"
- **AND** the four range number entities' friendly names SHALL be "Dining MVP Min brightness", "Dining MVP Max brightness", "Dining MVP Min color temp", "Dining MVP Max color temp"
- **AND** the four range number entities' friendly names SHALL be "Dining MVP Brightness lower", "Dining MVP Brightness upper", "Dining MVP Color temp lower", "Dining MVP Color temp upper"
- **AND** the four range number entities' entity_ids SHALL slug from the field keys (e.g. `number.dining_mvp_min_brightness`), not from the display names
#### Scenario: Existing entity_ids survive the rename