Add has_entity_name and translation keys to blebox entities#170089
Add has_entity_name and translation keys to blebox entities#170089bkobus-bbx wants to merge 6 commits into
Conversation
|
Hey there @bbx-a, @swistakm, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the BleBox integration to Home Assistant’s has_entity_name + translation_key naming pattern, updating entity implementations and corresponding tests so entity names are derived from device names and translated entity labels (with optional indexing for multi-instance features).
Changes:
- Set a shared
has_entity_namebehavior in the BleBox base entity and update platforms to usetranslation_key/ translated names (or device-name-only where appropriate). - Add entity translation keys (and config-flow field descriptions) to
strings.json. - Update and extend BleBox tests to validate new entity IDs and naming behavior (including multi-instance suffixes and feature-provided names).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/blebox/entity.py | Enables has_entity_name for all BleBox entities and adjusts update-error logging. |
| homeassistant/components/blebox/strings.json | Adds config-flow data_description plus entity translation_key name mappings with {index} placeholders. |
| homeassistant/components/blebox/sensor.py | Adds translation_key to sensor descriptions and applies optional per-device-class indexing via translation placeholders. |
| homeassistant/components/blebox/light.py | Uses a translated “channel” name for indexed light features and updates error messages to reference feature identifiers. |
| homeassistant/components/blebox/switch.py | Implements naming rules for relays: feature name wins, otherwise translated “relay” with optional index or device-name-only. |
| homeassistant/components/blebox/binary_sensor.py | Adds translation keys and naming rules: feature name wins, otherwise translated name with optional index. |
| homeassistant/components/blebox/cover.py | Sets cover entities to device-name-only naming under has_entity_name. |
| homeassistant/components/blebox/climate.py | Sets climate entities to device-name-only naming under has_entity_name. |
| homeassistant/components/blebox/button.py | Sets button entities to device-name-only naming under has_entity_name. |
| tests/components/blebox/test_sensor.py | Updates expected entity IDs/names and adds coverage for multi-sensor indexing behavior. |
| tests/components/blebox/test_light.py | Updates expected entity IDs/names and adds coverage for multi-channel light naming. |
| tests/components/blebox/test_switch.py | Updates expected entity IDs/names and adds coverage for feature-provided switch names. |
| tests/components/blebox/test_binary_sensor.py | Updates expected entity IDs/names and adds coverage for indexed and feature-named binary sensors. |
| tests/components/blebox/test_cover.py | Updates expected cover entity IDs and names for device-name-only naming. |
| tests/components/blebox/test_climate.py | Updates expected climate entity IDs and names for device-name-only naming. |
| tests/components/blebox/test_button.py | Updates expected button entity IDs and names for device-name-only naming. |
fe5a3b4 to
4bc69e3
Compare
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
e349508 to
b5da46a
Compare
|
Is there anything more to fix/explain? |
Breaking change
Proposed change
Migrates the blebox integration to the has_entity_name pattern. All entity types now use translation_key with {index} placeholders in strings.json for proper naming. Multi-instance entities (e.g. multiple relays, channels, or sensors of the same device class) get a numbered suffix. Single-instance entities expose only the device name.
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: