Skip to content
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

Merged
merged 4 commits into from
Apr 23, 2015
Merged

Tweak visibility config #98

merged 4 commits into from
Apr 23, 2015

Conversation

balloob
Copy link
Member

@balloob balloob commented Apr 23, 2015

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 62.7% when pulling 8f36cf3 on chore-tweak-visibility-config into 1dd26fc on dev.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 62.7% when pulling 8f36cf3 on chore-tweak-visibility-config into 1dd26fc on dev.

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
Copy link
Contributor

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.

@rmkraus
Copy link
Contributor

rmkraus commented Apr 23, 2015

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 62.7% when pulling 968de05 on chore-tweak-visibility-config into 1dd26fc on dev.

balloob added a commit that referenced this pull request Apr 23, 2015
@balloob balloob merged commit 44cd5ca into dev Apr 23, 2015
@balloob balloob deleted the chore-tweak-visibility-config branch April 23, 2015 17:21
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants