-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Tweak visibility config #98
Conversation
if ATTR_HIDDEN not in attr: | ||
attr[ATTR_HIDDEN] = bool(self.hidden) | ||
if _OVERWRITE_HIDDEN.get(self.entity_id, self.hidden): | ||
attr[ATTR_HIDDEN] = True |
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 is clever because it will prevent the "hidden: False" message from showing up in all the state cards for sensors and switches on the frontend. I like it.
I agree on all counts. As long as all entities inherit the Entity class, VisibiltyABC needs not to exist. The CONTRIBUTING.md file would need to be updated to reflect this, however. I put a note in there about the VisibilityABC class. Looks like the link I put in the visibility section is also a little messed up. |
After migrating group to use entity I was looking at the VisibilityABC class. In my opinion it fits better integrated into Entity instead of being a standalone class. Also figured that comparing to a string 'hide' should be part of the config parsing (bootstrap module) and not in the helper.
This pull request fixes both. Added some tests to make sure I didn't break anything.