Skip to content

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Dec 6, 2025

Proposed change

Use "Output" instead of "Switch" for Shelly RPC sub-device names to match Shelly's own device UI naming convention.

Previously, multi-channel switch devices like the Power Strip Gen4 would create sub-devices named "Switch 0", "Switch 1", etc. However, the Shelly device UI labels these as "Output (0)", "Output (1)", etc. This change aligns Home Assistant's naming with Shelly's terminology for better consistency.

Before

Screenshot 2025-12-06 at 4 33 00 PM

After

Screenshot 2025-12-06 at 4 42 49 PM

Shelly device UI

Screenshot 2025-12-06 at 4 34 32 PM

Type of change

  • Bugfix (non-breaking change which fixes an issue)

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to frontend pull request:

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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Dec 6, 2025

Hey there @bieniu, @thecode, @chemelli74, mind taking a look at this pull request as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shelly can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign shelly Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@bdraco bdraco marked this pull request as ready for review December 6, 2025 22:46
@bdraco bdraco requested a review from bieniu as a code owner December 6, 2025 22:46
Copilot AI review requested due to automatic review settings December 6, 2025 22:46
Copy link
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 updates the naming convention for Shelly RPC switch sub-devices from "Switch" to "Output" to align with Shelly's official device UI terminology. This improves consistency for users who interact with both Home Assistant and the Shelly app.

Key Changes

  • Modified get_rpc_sub_device_name() function to return "Output" instead of "Switch" for switch components
  • Added comprehensive test coverage for the get_rpc_sub_device_name() function including edge cases

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
homeassistant/components/shelly/utils.py Added special case handling for "switch" component to use "Output" naming instead of the default titlecase naming
tests/components/shelly/test_utils.py Added new test function with parametrized test cases covering all component types including switches, covers, lights, and energy meters, plus tests for custom names and emeter phases

@bdraco bdraco marked this pull request as draft December 7, 2025 16:16
@bdraco bdraco marked this pull request as ready for review December 7, 2025 16:28
@bdraco
Copy link
Member Author

bdraco commented Dec 7, 2025

thanks

@bdraco bdraco merged commit 2550575 into dev Dec 7, 2025
36 checks passed
@bdraco bdraco deleted the shelly_power_strip_output branch December 7, 2025 17:33
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants