-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Migrate Environment Canada to new entity naming style #75024
Conversation
Hey there @michaeldavie, mind taking a look at this pull request as it has been labeled with an integration ( |
I think adding device information is generally a good thing to do! It unlocks device automations as well (Don't forget to set device type to "service"). |
I’ve already coded the device info. I’ll submit a separate PR. Thanks!! |
I would add it into this one, as it requires name changes as well? |
I'm not clear on what is the right thing to do with the entity names. Should I pull the site name out of the name? So something such as |
Sounds like |
I guess what I still don't understand about the entity name change exercise is what happens when I have Edit: I'll let the code speak. I push the changes I think are in line with what the entity name change is trying to accomplish. |
Let's say you have a Z-Wave multi-sensor. It provides multiple data points (entities in the Home Assistant world). So, we have a device called, for example, "Multi-sensor" and two entities called "Temperature" & "Humidity". When the new naming style is enabled, Home Assistant will create the two following entities (and combines the device name and entity name for the entity ID):
Depending on which place the entities are shown, Home Assistant will show the entity differently. For example: If one is looking at the Device page, the title of that page would be "Multi-sensor" and show entities with just their own names: The "Temperature" & "Humidity entities. The device page already has context of the device you are looking at. (Although this already works on the device page in the old naming style, it currently relies on search/replacement of strings on the device page, which is kinda nasty :S) IN other places, Home Assistant adds context when needed (at this time, as usual, it shows the the combination of the device name and the entity name: "Multi-sensor Temperature" & "Multi-sensor Humidity". For the future, we can change/adjust the view to show less or more context when needed (e.g., entity selectors could show the device name + area as secondary line info). Right now, our goal is to untangle the "merged" device names into the entity names, resulting in each device, entity, area having their own names; Allowing Home Assistant to display them correctly depending on the context. |
Thanks, that was very helpful. I now understand the intent! My current PR matches that intent, I believe. Adding your reply to the blog post might help others. |
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
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.
Thanks, @gwww 👍
Proposed change
Migrate Environment Canada to new entity naming style.
This may not be correct as the names all have the weather station as part of the name. For example "Ottawa Radar". Is the right thing to add
device_info
(for a service) that has a name of the weather station and then remove the station from all of the entities? An example of the code here: https://github.com/home-assistant/core/blob/dev/homeassistant/components/environment_canada/sensor.py#L295Type 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: