-
-
Notifications
You must be signed in to change notification settings - Fork 29k
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 serial_number to device registry entries #77713
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
Related arch discussion |
"entry_type": "service", | ||
"hw_version": "hw_version", | ||
"id": "abcdefghijklm", | ||
"identifiers": [["serial", "12:34:56:AB:CD:EF"]], |
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.
"serial"
here is just a coincidence, right? It's not a requirement of this PR, right?
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.
That's indeed just a concidence 馃憤
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.
This should have rang a bell IMHO, as a serial number IS an identifier.
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 don't remember if we agreed that this was ok besides the related architecture discussion. Code looks good.
We agreed this was OK. |
I'm confused by this comment @emontnemery, so your are saying MAC addresses could be just picked up by the frontend from the identifiers... Why isn't serial in the identifiers as well in that case? That comment, just made this PR invalid IMHO. |
@@ -90,6 +90,7 @@ class DeviceEntry: | |||
model: str | None = attr.ib(default=None) | |||
name_by_user: str | None = attr.ib(default=None) | |||
name: str | None = attr.ib(default=None) | |||
serial_number: str | None = attr.ib(default=None) |
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.
A serial number IS an identifier, for which we already have a property.
This reverts commit cba3b6a.
Proposed change
Add
serial_number
to device registry entriesThe serial number can be displayed in the device card in frontend
The "identifiers" set which is part of device registry entries can't be used for this purpose because:
Developer documentation: home-assistant/developers.home-assistant#1477
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: