Skip to content

Add has_entity_name and translation keys to blebox entities#170089

Open
bkobus-bbx wants to merge 6 commits into
home-assistant:devfrom
bkobus-bbx:blebox/entity-naming
Open

Add has_entity_name and translation keys to blebox entities#170089
bkobus-bbx wants to merge 6 commits into
home-assistant:devfrom
bkobus-bbx:blebox/entity-naming

Conversation

@bkobus-bbx
Copy link
Copy Markdown
Contributor

@bkobus-bbx bkobus-bbx commented May 8, 2026

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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented May 8, 2026

Hey there @bbx-a, @swistakm, mind taking a look at this pull request as it has been labeled with an integration (blebox) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of blebox can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign blebox Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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_name behavior in the BleBox base entity and update platforms to use translation_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.

Comment thread homeassistant/components/blebox/strings.json Outdated
Comment thread homeassistant/components/blebox/strings.json Outdated
Comment thread homeassistant/components/blebox/strings.json Outdated
@bkobus-bbx bkobus-bbx mentioned this pull request May 8, 2026
21 tasks
@bkobus-bbx bkobus-bbx force-pushed the blebox/entity-naming branch from fe5a3b4 to 4bc69e3 Compare May 8, 2026 14:26
@bkobus-bbx bkobus-bbx marked this pull request as ready for review May 8, 2026 14:28
Copilot AI review requested due to automatic review settings May 8, 2026 14:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/blebox/light.py
Comment thread homeassistant/components/blebox/sensor.py
Comment thread homeassistant/components/blebox/binary_sensor.py
Copilot AI review requested due to automatic review settings May 12, 2026 11:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread homeassistant/components/blebox/binary_sensor.py Outdated
Comment thread homeassistant/components/blebox/binary_sensor.py Outdated
Comment thread homeassistant/components/blebox/strings.json Outdated
@home-assistant home-assistant Bot marked this pull request as draft May 13, 2026 08:49
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@bkobus-bbx bkobus-bbx marked this pull request as ready for review May 14, 2026 06:04
Copilot AI review requested due to automatic review settings May 14, 2026 06:04
@home-assistant home-assistant Bot requested a review from joostlek May 14, 2026 06:04
@bkobus-bbx bkobus-bbx force-pushed the blebox/entity-naming branch from e349508 to b5da46a Compare May 15, 2026 08:53
@bkobus-bbx
Copy link
Copy Markdown
Contributor Author

Is there anything more to fix/explain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants