-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Add unique id to emoncms integration #117911
Closed
alexandrecuer
wants to merge
8
commits into
home-assistant:dev
from
alexandrecuer:emoncms-integration-add-unique-id
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
28d7396
adding unique id to emoncms integration
alexandrecuer d613818
Merge branch 'dev' into emoncms-integration-add-unique-id
alexandrecuer c8ca108
Merge branch 'home-assistant:dev' into emoncms-integration-add-unique-id
alexandrecuer a72cc6e
remove name and tag from the unique identifier.
alexandrecuer e7e941f
type hints
alexandrecuer 84b160c
Merge branch 'dev' into emoncms-integration-add-unique-id
alexandrecuer 5bafb38
Merge branch 'home-assistant:dev' into emoncms-integration-add-unique-id
alexandrecuer 2d412d4
Merge branch 'home-assistant:dev' into emoncms-integration-add-unique-id
alexandrecuer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Names cannot be part of a unique identifier.
See also our developer documentation around this, which lists the requirements: https://developers.home-assistant.io/docs/entity_registry_index/#unique-id
../Frenck
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.
tag and name removed from the unique id
emoncms API does not provide mac address at the moment, so I've kept sensor id, feed id and emoncms user_id
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.
Are these unique across different installations?
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.
sensor id must be unique as specified in the doc :
cf https://www.home-assistant.io/integrations/emoncms/#id
unless I'm mistaken, I understand it is what you call
unique id of last resort
in the doc ?https://developers.home-assistant.io/docs/entity_registry_index/#unique-id-of-last-resort
I've seen it used like that in the modbus integration
core/homeassistant/components/modbus/binary_sensor.py
Line 152 in d33068d
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.
No, that is not the ID @ emoncms, that is the UUID of the config flow entry. As this integration doesn't have a configuration flow, it means there is no unique ID of last resort available.
In that case, this integration first needs to be migrated to a config flow (and thus UI configuration).
../Frenck
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.
OK sorry, I was misled when I saw that the modbus did that way without having a flow config.
So going to close that PR, there is more work than expected