-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Shelly channel names (if available) #40119
Conversation
Only missing the calculation of channel number for switch ( hardcoded 1 for the moment) Simone |
IMO we still have an inconsistency here. If the device has one channel, we don't use the channel name, and if the device has more than one channel, we use the channel names. |
Partially true:
BTW, we still miss channel name for 3EM/EM; it's missing for firmware so before adding the node "emeters/name" I want to wait and see exactly how it will be implemented. |
So maybe we should wait with the channel names until the situation clears up. IMO channel names should be used in all cases or not at all. |
I perfectly understand the idea to have a unique naming policy, but we should also take care of how the device works. So channel name -> device name -> hostname is the best name preference we can up with. Simone |
But we're not making copy of the Shelly app. I think that the opinion of someone from the HA Team is needed here. |
:-)
Agree Simone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to remove "-" only between channel and name for sensors we leave the "-"
3 green lights, time to merge ;-) Simone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branch used isn't clean. It contains 44 commits, of which the larger part is unrelated. Please start with a fresh branch based on the upstream dev
when creating a new feature. In this case, a git rebase can clean it up.
For information on how to handle upstream changes and keeping your fork up 2 date: https://developers.home-assistant.io/docs/development_catching_up
Integration doc page should be updated to inform how naming works and how to update device/channel name for end user.
Your PR description points out the need to adjust the documentation, however, I don't see a documentation PR linked up?
Handle devices with 0 channels
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Done.
We will provide info on how to name device in the doc, but nothing mandatory imho. Simone |
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Update Shelly entities naming as implemented in PR: home-assistant/core#40119
Doc PR linked, we should be on track for a merge now. Simone |
Update Shelly entities naming as implemented in PR: home-assistant/core#40119
Update Shelly entities naming as implemented in PR: home-assistant/core#40119
Update Shelly entities naming as implemented in PR: home-assistant/core#40119
@@ -20,6 +20,33 @@ def temperature_unit(block_info: dict) -> str: | |||
return TEMP_CELSIUS | |||
|
|||
|
|||
def shelly_naming(self, block, entity_type: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's standard to use a verb in imperative as first word in function names. I'd rename this to name_shelly
.
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Proposed change
Current code handle only device name; this PR handle also channels name when they are available.
Integration doc page should be updated to inform how naming works and how to update device/channel name for end user.
Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: