Merge remote-tracking branch 'origin/current' into next

This commit is contained in:
Paulus Schoutsen 2017-11-23 12:43:37 -08:00
commit dfe09b8aae
28 changed files with 307 additions and 129 deletions

View file

@ -61,6 +61,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
1. Extend entity from component, e.g. `class HueLight(Light)`
2. Do not call `update()` in constructor, use `add_devices(devices, True)` instead.
3. Do not do any I/O inside properties. Cache values inside `update()` instead.
4. The state and/or attributes should not contain relative time since something happened. Instead it should store UTC timestamps.
### {% linkable_title 6. Communication with devices/services %}

View file

@ -20,15 +20,15 @@ Use `hassio` to speak with the internal API.
## {% linkable_title Home Assistant %}
An add-on can speak to the [Home Assistant API][hass-api] with our internal proxy. That makes it very easy to communicate with the API without knowing the password, port or any other information of the Home Assistant instance. Use this URL: `http://hassio/homeassistant/api` and internal communication is redirected to the right place. The next stept is to add `homeassistant_api: true` to `config.json`.
An add-on can speak to the [Home Assistant API][hass-api] with our internal proxy. That makes it very easy to communicate with the API without knowing the password, port or any other information of the Home Assistant instance. Use this URL: `http://hassio/homeassistant/api` and internal communication is redirected to the right place. The next stept is to add `homeassistant_api: true` to `config.json` and read the environment variable `API_TOKEN` and use this as Home-Assistant password.
It is also possible to speak direct to the Home Assistant instance which is named `homeassistant` over our internal network. But you need to know the configuration that is used by the running instance.
We have severals services for Hass.io inside Home Assistant to execute tasks. To send data over STDIN to an add-on.l simply use `hassio.addon_stdin`.
We have severals services for Hass.io inside Home Assistant to execute tasks. To send data over STDIN to an add-on use the simply `hassio.addon_stdin` service.
## {% linkable_title Hass.io API %}
To enables calls to the [Hass.io API][hassio-api], add `hassio_api: true` to `config.json`. Now you can use the API over the URL: `http://hassio/`.
To enables calls to the [Hass.io API][hassio-api], add `hassio_api: true` to `config.json` and read the environment variable `API_TOKEN`. Now you can use the API over the URL: `http://hassio/`. Use the `API_TOKEN` with header `X-HASSIO-KEY`.
[hass-api]: https://home-assistant.io/developers/rest_api/
[hassio-api]: https://github.com/home-assistant/hassio/blob/master/API.md