-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Validate unique_id in entity registry #114648
Conversation
_validate_item( | ||
self.hass, domain, entity["platform"], entity["unique_id"] | ||
) | ||
except (TypeError, ValueError): |
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.
Could we add a test for this part?
Co-authored-by: Shay Levy <levyshay1@gmail.com>
84e1c2b
to
72dba26
Compare
Testing this now on production |
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.
), | ||
entity["entity_id"], | ||
entity["platform"], | ||
str(err), |
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.
Exceptions have a string magic method so we don't need to copy them to a string.
Proposed change
Validate
unique_id
in entity registry to avoid crashing core if theunique_id
is not hashableNote: This does not fix a new regression, but we keep getting reports about integrations breaking core startup because of invalid entity ids
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: