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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add device name to sensor name for mobile_app #31756
Add device name to sensor name for mobile_app #31756
Conversation
Hey there @robbiet480, mind taking a look at this pull request as its been labeled with a integration ( |
CC: @balloob there was some discussion in #devs_apps about this on discord so wanted your opinion on this change too |
@@ -58,7 +60,7 @@ def should_poll(self) -> bool: | |||
@property | |||
def name(self): | |||
"""Return the name of the mobile app sensor.""" | |||
return self._config[ATTR_SENSOR_NAME] | |||
return self._name |
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.
For the name, I think the format Sensor Name (Device Name) works better too. That's a suggestion, not a directive, so i'm open to leaving it as is.
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 think that we should Device Name Sensor Name, since we've been adding logic to strip off start of names if they match the container name. (ie Living Room area card will rename Living Room Lights -> Lights)
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.
Also we have a unique ID, let the user do their thing :)
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.
Yup I agree we not only have unique ID but we also have the entity registered to the device so its not too difficult to find from device page. I think users are just confused by the generic name it gets when the sensor gets registered.
So the format I chose is good? Not sure if we have a official format to follow :)
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.
What Paulus says goes, i'm fine with it.
Would also close home-assistant/iOS#478 |
Also close home-assistant/android#381 |
Breaking change
Not a breaking change because once the entity is registered and rename this won't impact it.
Proposed change
Add the device name to the sensor name so they are easy to distinguish. Especially useful when you are logging into more than 1 device at a time because the sensor names will be like
sensor.battery_level
andsensor.battery_level_2
. We will still hit the same issue if the device name is the same but it should help clear up some confusion about what device it is.Fixes home-assistant/iOS#478
Fixes home-assistant/android#381
Type of change
Example entry for
configuration.yaml
:Additional information
Checklist
black --fast homeassistant tests
)The integration reached or maintains the following Integration Quality Scale: