-
-
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
Fix mutable objects in group registry class #115797
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
I'm not convinced this is a valid fix for the test failures in #111968, I think it just hides the underlying problem. Maybe the solution is to index |
If the test failes then it is caused by a mismatch between an |
But that doesn't solve the underlying problem in a real setup with both locks and covers; depending on if lock or cover sets up first, group behavior will be different. |
To be clear, I think the changes in this PR are OK; they just don't solve the problem introduced by #111968 |
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.
LGTM, thanks @jbouwh 👍
I'd like a second opinion on if the mutable class attributes serve a purpose before we merge this.
There's no reason to have mutable class attributes if the class is only instantiated once. We only need mutable class attributes if we have multiple instances of a class and we want all instances of the class to see changes in the mutable attribute. Normally it's very rare that that is the case and that we want that. |
sounds reasonable to me given we now have domain/namespace conflicts. It should still fallback to the default top level values if the domain/namespace isn’t registered |
It seems that with mixed domain groups, the group status can only be The additional tests should be first applied to |
The new seem to run fine, is okay to merge this one? |
Proposed change
Fix mutable objects in group registry class. These mutable objects cause tests to become flakey.
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: