-
Notifications
You must be signed in to change notification settings - Fork 123
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
Update entities to respect new enable/visibility principles #273
Update entities to respect new enable/visibility principles #273
Conversation
dermotduffy
commented
Jun 4, 2022
- Closes Hide some entities by default #256
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 1452 1447 -5
=========================================
- Hits 1452 1447 -5
Continue to review full report at Codecov.
|
@@ -71,6 +71,7 @@ def __init__( | |||
self._obj_name = obj_name | |||
self._is_on = False | |||
self._frigate_config = frigate_config | |||
self._attr_entity_registry_visible_default = obj_name != "all" |
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.
So if this is false then it is hidden
or disabled
by default?
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.
It will be default enabled, and default visible (unless it's the all
, and then it'll be enabled and hidden). This should be as described here, but let me know if you spot anything to be contrary.
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.
Right, I was mostly unsure what _attr_entity_registry_visible_default = false
would do but that makes sense 👍
Awesome, definitely clean and glad to see this coming together. Do you think this should be a pre-release until frigate 0.11 is fully released? |
Since there'll be behavior in the next new build that depends on 0.11 (e.g. motion), I think what you describe makes sense -- i.e. we do a new major build, but keep it pre-release until 0.11 is out. |
Yeah definitely, sounds good |
Experimenting with this on my home instance and running into a few small issues (one was a bug with the rename logic -- now fixed). One unexpected behavior is that when an entity is marked as hidden by the integration, the user doesn't seem to be able to disable it or mark is visible at all (the radio buttons are just disabled intentionally, source). This is problematic, as it means every entity we mark hidden cannot be later disabled. |
Oh wow that's really weird, might want to report to HA devs, I can't think of why that would be forced. Unless there's a separate attr that can be changed 🤔 |
Bug filed. This will go one of three ways:
As I do want to get these changes in for the next major Frigate release (which is probably before that), it may make sense to avoid the use of hidden for now. By default all hidden would move to visible/enabled, as all of them are probably too widely used to disable. |
I am curious if properties act different, seems interesting that the disabled property worked smoothly but this attr doesn't allow any changes. Do you have the link to the bug? Curious to follow along |
It's a frontend issue, so the use of property or not won't matter. You can see the code here specifically disables the checkbox if the entity is hidden by the integration, but yet leaves the checkbox enabled if the entity is disabled by the integration, i.e. disabling works as we expected, but hiding doesn't.
|
Very interesting 🤔 |
I'll revert |