From bd3b93f29057252c8d784d3e90ec754a37116cfe Mon Sep 17 00:00:00 2001
From: Ryan Kraus <rmkraus@gmail.com>
Date: Wed, 22 Apr 2015 22:19:36 -0400
Subject: [PATCH] 1) Added visibility documentation to the CONTRIBUTING.md
 documentation. 2) Pylint fixes to homeassistant/helpers/entity.py

---
 CONTRIBUTING.md                 | 15 +++++++++++++++
 homeassistant/helpers/entity.py |  1 +
 2 files changed, 16 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 83b95535e0c..e6bc947d771 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,6 +31,21 @@ A state can have several attributes that will help the frontend in displaying yo
 
 These attributes are defined in [homeassistant.components](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/__init__.py#L25).
 
+## Proper Visibility Handling ##
+
+Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the [homeassistant.helpers.entity.Entity](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py] Class. If this is done, visibility will be handled for you. 
+You can set a suggestion for your entitie's visibility by setting the hidden property by doing something similar to the following.
+
+```python
+self.hidden = True
+```
+
+This will SUGGEST that the active frontend hide the entity. This requires that the active frontend support hidden cards (the default frontend does) and that the value of hidden be included in your attributes dictionary (see above). The Entity abstract class will take care of this for you.
+
+Remember: The suggestion set by your component's code will always be overwritten by manual settings in the configuration.yaml file. This is why you may set hidden to be False, but the property may remain True (or vice-versa).
+
+If you would not like to use the Entity Abstract Class, you may also inherity the Visibility Abstract Class which will include the logic for the hidden property but not automatically add the hidden property to the attributes dictionary. If you use this class, ensure that your class correctly adds the hidden property to the attributes.
+
 ## Working on the frontend
 
 The frontend is composed of Polymer web-components and compiled into the file `frontend.html`. During development you do not want to work with the compiled version but with the seperate files. To have Home Assistant serve the seperate files, set `development=1` for the http-component in your config.
diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py
index 737a0e5e359..07aaf9a234c 100644
--- a/homeassistant/helpers/entity.py
+++ b/homeassistant/helpers/entity.py
@@ -21,6 +21,7 @@ class VisibilityABC(object):
     hidden property must still be included in the attributes disctionary. The
     Entity class takes care of this automatically.
     """
+    # pylint: disable=too-few-public-methods
 
     entity_id = None
     visibility = {}
-- 
GitLab