Link to more things

This commit is contained in:
Josh Nichols 2016-08-28 20:58:32 -04:00
parent c7a198fcec
commit 9f7923e827
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ sharing: true
footer: true
---
Components that interact with devices are called Entity Components. They are structured in core- and platform logic. This allows the same logic to handle a light to be used by different brands.
Components that interact with devices are called [Entity Components](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/helpers/entity_component.py). They are structured in core- and platform logic. This allows the same logic to handle a light to be used by different brands.
For example, the built-in `switch` component consists of various platform in [`homeassistant/components/switch/`](https://github.com/home-assistant/home-assistant/tree/master/homeassistant/components/switch). The file `__init__.py` contains the core logic of all platform and the `vendor_name.py` files only the relevant platform code.
@ -22,11 +22,11 @@ If you are planning to add support for a new type of device to an existing compo
One of the rules for Home Assistant is that platform logic should never interface directly with devices but use a third-party Python 3 library to do so. This way Home Assistant is able to share code with the Python community and we can keep the project maintainable.
To integrate the third-party library you create an Entity class for your device. Entities are Home Assistant's representation of lights, switches, sensors, etc. and are derived from the [Entity Abstract Class](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/entity.py). This abstract class contains logic for integrating most standard features into your entities, such as visibility, entity IDs, updates, and much more.
To integrate the third-party library you create an [Entity class](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/helpers/entity.py) for your device. Entities are Home Assistant's representation of lights, switches, sensors, etc. and are derived from the [Entity Abstract Class](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/entity.py). This abstract class contains logic for integrating most standard features into your entities, such as visibility, entity IDs, updates, and much more.
### {% linkable_title Requirements and dependencies %}
Platforms can specify dependencies and requirements the same way as a component does.
Platforms can specify dependencies and requirements [the same way as a component does](/developers/component_deps_and_reqs):
```python
REQUIREMENTS = ['some-package==2.0.0', 'some-other-package==2.5.0']

View File

@ -22,7 +22,7 @@ We can differentiate between two different types of components within Home Assis
These components will track devices within a specific domain and consist of a core part and platform-specific logic. These components make their information available via the State Machine and the Event Bus. The component will also register services in the Service Registry to expose control of the devices.
For example, one of the built-in components is the `switch` component. This component is responsible for interaction with different types of switches.
For example, one of the built-in components is the [`switch` component](/components/switch/). This component is responsible for interaction with different types of switches.
A platform provides support for a particular kind/brand of device. For example, a switch could use a WeMo or Orvibo platform, and a light component might interact with the Hue or LiFX platform.