home-assistant.io/source/developers/component_visibility.markdown
Fabian Affolter 777a8aa1a8
Fix style
2017-01-28 21:45:36 +01:00

1.2 KiB

layout title description date sidebar comments sharing footer
page Handling visibility Instructions how to handle visibility with your component. 2016-07-01 20:00 true false true true

Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the homeassistant.helpers.entity.Entity class. If this is done, visibility will be handled for you. You can set a suggestion for your entity's visibility by setting the hidden property by doing something similar to the following.

self.hidden = True

This will SUGGEST that the active frontend hides 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 user 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).