Site updated at 2018-01-28 22:02:31 UTC

This commit is contained in:
Travis CI 2018-01-28 22:02:31 +00:00
parent 57a21e9eb0
commit 01b474f87c
268 changed files with 412 additions and 412 deletions

View file

@ -96,7 +96,7 @@ Not all existing platforms follow the requirements in this checklist. This canno
<h3><a class="title-link" name="3-componentplatform-communication" href="#3-componentplatform-communication"></a> 3. Component/platform communication</h3>
<ol>
<li>If you need to share global data with platforms, use the dictionary <code class="highlighter-rouge">hass.data</code>. <code class="highlighter-rouge">hass.data[DATA_XY]</code> while <code class="highlighter-rouge">XY</code> is the component is preferred over <code class="highlighter-rouge">hass.data[DOMAIN]</code>.</li>
<li>If the component fetches data that causes its related platform entities to update, you can notify them using the dispatcher code in <code class="highlighter-rouge">homeassistant.helpers.dispatcher</code>.</li>
<li>If the component fetches data that causes its related platform entities to update, you can notify them using the dispatcher code in <code class="highlighter-rouge">homeassistant.helpers.dispatcher</code>.</li>
</ol>
</article>
</div>

View file

@ -76,7 +76,7 @@
<hr class="divider">
<p>There are different ways to communication between add-ons inside Home Assistant.</p>
<h2><a class="title-link" name="network" href="#network"></a> Network</h2>
<p>We use a internal network. That allow to speak with every add-on or from Home Assistant to add-on by name or alias. Only the add-ons which runs on the host network are a bit limited. They can speak with all internal add-ons over their name but all other add-on cant address the add-on in question with its name. But using an alias work well. Thus the name/alias is used to communicate inside Hass.io. The name have the following format <code class="highlighter-rouge"><span class="p">{</span><span class="err">REPO</span><span class="p">}</span><span class="err">-</span><span class="p">{</span><span class="err">SLUG</span><span class="p">}</span></code>, e.g. <code class="highlighter-rouge">local-xy</code> or <code class="highlighter-rouge">3283fh-myaddon</code>.</p>
<p>We use an internal network. That allow to speak with every add-on or from Home Assistant to add-on by name or alias. Only the add-ons which runs on the host network are a bit limited. They can speak with all internal add-ons over their name but all other add-on cant address the add-on in question with its name. But using an alias work well. Thus the name/alias is used to communicate inside Hass.io. The name have the following format <code class="highlighter-rouge"><span class="p">{</span><span class="err">REPO</span><span class="p">}</span><span class="err">-</span><span class="p">{</span><span class="err">SLUG</span><span class="p">}</span></code>, e.g. <code class="highlighter-rouge">local-xy</code> or <code class="highlighter-rouge">3283fh-myaddon</code>.</p>
<p>Use <code class="highlighter-rouge">hassio</code> to speak with the internal API.</p>
<h2><a class="title-link" name="home-assistant" href="#home-assistant"></a> Home Assistant</h2>
<p>An add-on can speak to the <a href="https://home-assistant.io/developers/rest_api/">Home Assistant API</a> 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: <code class="highlighter-rouge">http://hassio/homeassistant/api</code> and internal communication is redirected to the right place. The next stept is to add <code class="highlighter-rouge">homeassistant_api: true</code> to <code class="highlighter-rouge">config.json</code> and read the environment variable <code class="highlighter-rouge">HASSIO_TOKEN</code> and use this as Home-Assistant password.</p>

View file

@ -327,7 +327,7 @@ CMD [ "/run.sh" ]
</tbody>
</table>
<h3><a class="title-link" name="options--schema" href="#options--schema"></a> Options / Schema</h3>
<p>The <code class="highlighter-rouge">options</code> dictionary contains all available options and their default value. Set the default value to <code class="highlighter-rouge">null</code> if the value is required to be given by the user before the add-on can start, and it show it inside default values. Only nested arrays and dictionaries are supported with a deep of two size. If you want make a option optional, put <code class="highlighter-rouge">?</code> to the end of data type, otherwise it will be a required value.</p>
<p>The <code class="highlighter-rouge">options</code> dictionary contains all available options and their default value. Set the default value to <code class="highlighter-rouge">null</code> if the value is required to be given by the user before the add-on can start, and it show it inside default values. Only nested arrays and dictionaries are supported with a deep of two size. If you want make an option optional, put <code class="highlighter-rouge">?</code> to the end of data type, otherwise it will be a required value.</p>
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom things"</span><span class="p">,</span><span class="w">
</span><span class="nt">"logins"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

View file

@ -74,7 +74,7 @@
</h1>
</header>
<hr class="divider">
<p>An add-on repository can contain one or more add-ons. Each add-on is stored in its own unique folder. To be indentified as a repository, the repository must contain a configuration file.</p>
<p>An add-on repository can contain one or more add-ons. Each add-on is stored in its own unique folder. To be indentified as a repository, the repository must contain a configuration file.</p>
<p>Check the <a href="https://github.com/home-assistant/hassio-addons-example">Example add-on repository</a> for further details.</p>
<h2><a class="title-link" name="installing-a-repository" href="#installing-a-repository"></a> Installing a repository</h2>
<p>A user can add a repository by going to the Hass.io panel in Home Assistant, clicking on the store icon in the top right, copy/paste the URL of your repostory into the repository textarea and click on <strong>Save</strong>.</p>

View file

@ -77,7 +77,7 @@
<p>The fastest way to develop add-ons is by adding them to your local add-on repository. To access your local add-on repository, install either the <a href="/addons/samba/">Samba add-on</a> or <a href="/addons/ssh/">SSH add-on</a>.</p>
<p>Right now add-ons will work with images that are stored on Docker Hub (using <code class="highlighter-rouge">image</code> from add-on config). Without <code class="highlighter-rouge">image</code> inside local add-ons repository it to be built on the device.</p>
<h2><a class="title-link" name="local-build" href="#local-build"></a> Local build</h2>
<p>You can build an try the addon on your developer machine also. Move all addon stuff into a temp folder. If you use <code class="highlighter-rouge">FROM $BUILD_FROM</code> you need set a base image with build args. Normally you can use follow base images:</p>
<p>You can build and try the addon on your developer machine also. Move all addon stuff into a temp folder. If you use <code class="highlighter-rouge">FROM $BUILD_FROM</code> you need set a base image with build args. Normally you can use follow base images:</p>
<ul>
<li>armhf: <code class="highlighter-rouge">homeassistant/armhf-base:latest</code></li>
<li>aarch64: <code class="highlighter-rouge">homeassistant/aarch64-base:latest</code></li>

View file

@ -104,7 +104,7 @@
</li>
<li>Client or server disconnects session.</li>
</ol>
<p>During the command phase, the client attaches a unique identifier to each message. The server will add this identifier to each message so that the client can link each message to its origin.</p>
<p>During the command phase, the client attaches a unique identifier to each message. The server will add this identifier to each message so that the client can link each message to its origin.</p>
<h2><a class="title-link" name="message-format" href="#message-format"></a> Message format</h2>
<p>Each API message is a JSON serialized object containing a <code class="highlighter-rouge">type</code> key. After the authentication phase messages also must contain an <code class="highlighter-rouge">id</code>, an integer that contains the number of interactions.</p>
<p>Example of an auth message:</p>