Added documentation about ISY994 platform. Also added documentation about creating entities by using the Entity base class.

This commit is contained in:
Ryan Kraus 2015-04-24 23:13:32 -04:00
parent 66db921c8e
commit 5f84b4ad66
10 changed files with 189 additions and 3 deletions

View file

@ -61,3 +61,29 @@ The Discovery component is capable of setting up your components before firing t
<p class='note warning'>
This option is currently limited to built-in components.
</p>
### {% linkable_title Creating Entities %}
Home Assistant will call a function with the following signature to initialize
your new component. This function must exist in the component module you
create.
```python
def setup_platform(hass, config, add_devices, discovery_info=None)
```
In this function, your component should create the appropriate entities and
register them with the Home Assistant core. Entities are Home Assistant's
representation of lights, switches, sensors, etc. It is best practice for all
new entities to inherit the
[Entity Abstract Class](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py#L18).
This abstract class contains logic for integrating most standard features into
your entities, such as visibility, entity IDs, updates, and many more. That is
why it is best practice to reference the existing class.
A list of entities can be registered with Home Assitant using the *add_devices*
function that is provided as an input to *setup_platform*. Once entities are
registered with with Home Assistant their updates will be provided to the core
and the core will have control over them. For more information on how Entites
can be customized, take a look at the [Entity Abstract
Class](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py#L18).