Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add meaningful device info. #6

Merged
merged 4 commits into from
Jun 15, 2023

Conversation

danielrheinbay
Copy link
Contributor

@danielrheinbay danielrheinbay commented Jun 14, 2023

This PR adds device information which shows up in the device page in Home Assistant, including a link to each sensor's configuration page at pixometer.io.
This configuration page of the the pixometer.io portal allows to set labels ("Kurzbezeichnung") for each sensor. While these labels don't show up in the free Android app, they do show up in the API.

If available, this PR uses these labels as the device name. If no labels have been set, this PR will fall back to the previous naming scheme based on the location (which is the only attribute show in the free Android app).
For the individual sensor entities, this PR changes the naming to meet Home Assistant requirements, which will result in the entity's name to be equal to the device's name:
https://developers.home-assistant.io/docs/core/entity/#has_entity_name-true-mandatory-for-new-integrations

This implementation is backwards-compatible: if you are not using labels, the implementation will give the same name as before. If you use a label, it will use that instead.

@danielrheinbay danielrheinbay mentioned this pull request Jun 14, 2023
@myTselection myTselection merged commit 5024b51 into myTselection:master Jun 15, 2023
@danielrheinbay danielrheinbay deleted the add-device-info branch June 15, 2023 10:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants