Site updated at 2015-10-27 04:59:24 UTC

This commit is contained in:
Paulus Schoutsen 2015-10-26 21:59:24 -07:00
parent 0dec4860da
commit adcde053bb
220 changed files with 226724 additions and 6116 deletions

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>
@ -107,8 +107,7 @@
<hr class="divider">
<p>Home Assistant offers <a href="/components/">built-in components</a> but it
is easy to built your own. If you are the kind of person that likes to learn from code rather then guide then head over to the <a href="https://github.com/balloob/home-assistant/tree/master/config/custom_components"><code>config/custom_components</code></a> folder in the repository for two example components.</p>
<p>Home Assistant offers <a href="/components/">built-in components</a> but it is easy to built your own. If you are the kind of person that likes to learn from code rather then guide then head over to the <a href="https://github.com/balloob/home-assistant/tree/master/config/custom_components"><code>config/custom_components</code></a> folder in the repository for two example components.</p>
<p>The first is <a href="https://github.com/balloob/home-assistant/blob/master/config/custom_components/hello_world.py">hello_world.py</a>, which is the classic Hello World example for Home Assistant. The second one is <a href="https://github.com/balloob/home-assistant/blob/master/config/custom_components/example.py">example.py</a> which showcases various ways you can tap into Home Assistant to be notified when certain events occur.</p>
@ -153,18 +152,11 @@ Home Assistant will use the directory that contains your config file as the dire
<h2><a class='title-link' name='dependencies' href='#dependencies'></a> Dependencies</h2>
<p>Home Assistant allows components and platforms to specify their dependencies and requirements using the variables
<code>DEPENDENCIES</code> and <code>REQUIREMENTS</code>. Both are lists that contain strings.</p>
<p>Home Assistant allows components and platforms to specify their dependencies and requirements using the variables <code>DEPENDENCIES</code> and <code>REQUIREMENTS</code>. Both are lists that contain strings.</p>
<p>Dependencies are other Home Assistant components that should be setup before the platform is loaded.
An example is the MQTT sensor component, which requires an active connection to an MQTT broker. If
Home Assistant is unable to load and setup the MQTT component, it will not setup the MQTT sensor
component.</p>
<p>Dependencies are other Home Assistant components that should be setup before the platform is loaded. An example is the MQTT sensor component, which requires an active connection to an MQTT broker. If Home Assistant is unable to load and setup the MQTT component, it will not setup the MQTT sensor component.</p>
<p>Requirements are Python libraries that you would normally install using <code>pip</code>. Each entry in a
requirement list is a pip compatible string. For example, the media player Cast platform depends
on the Python package PyChromecast thus <code>REQUIREMENTS = ['pychromecast==0.6.12']</code>. If Home
Assistant is unable to install the package or verify it is installed, the component will fail to
<p>Requirements are Python libraries that you would normally install using <code>pip</code>. Each entry in a requirement list is a pip compatible string. For example, the media player Cast platform depends on the Python package PyChromecast thus <code>REQUIREMENTS = ['pychromecast==0.6.12']</code>. If Home Assistant is unable to install the package or verify it is installed, the component will fail to
load.</p>
<h2><a class='title-link' name='initializing-components' href='#initializing-components'></a> Initializing components</h2>
@ -230,7 +222,7 @@ load.</p>
</span></code></pre></td></tr></table></div></figure>
<p>Then in the setup-method of your component you will be able to refer to <code>config['example']['host']</code> to get the value <code>paulusschoutsen.nl</code>.</p>
<p>Then in the setup method of your component you will be able to refer to <code>config['example']['host']</code> to get the value <code>paulusschoutsen.nl</code>.</p>
</article>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>
@ -157,6 +157,7 @@
<li><a href="https://github.com/Zyell">Michael Gilbert</a></li>
<li><a href="https://github.com/miniconfig">miniconfig</a></li>
<li><a href="https://github.com/nkgilley">Nolan Gilley</a></li>
<li><a href="https://github.com/bachp">Pascal Bach</a></li>
<li><a href="https://github.com/persandstrom">Per Sandström</a></li>
<li><a href="https://github.com/Piratonym">Piratonym</a></li>
<li><a href="https://github.com/mikegrb">Rev Michael Greb</a></li>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>
@ -107,9 +107,7 @@
<hr class="divider">
<p>Home Assistant is build from the ground-up to be easily extensible by other developers using
components. It uses <a href="https://www.python.org/">Python 3</a> for the backend and
<a href="https://www.polymer-project.org/">Polymer (Webcomponents)</a> for the frontend.</p>
<p>Home Assistant is build from the ground-up to be easily extensible by other developers using components. It uses <a href="https://www.python.org/">Python 3</a> for the backend and <a href="https://www.polymer-project.org/">Polymer (Webcomponents)</a> for the frontend.</p>
<p>Home Assistant is open-source and MIT licensed. The source can be found here:</p>
@ -122,8 +120,7 @@ components. It uses <a href="https://www.python.org/">Python 3</a> for the backe
<h3><a class='title-link' name='starting-development' href='#starting-development'></a> Starting development</h3>
<p>You will need to setup a development environment if you want to start developing a new feature or
component for Home Assistant perform theses steps</p>
<p>You will need to setup a development environment if you want to start developing a new feature or component for Home Assistant perform theses steps</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
@ -142,12 +139,13 @@ component for Home Assistant perform theses steps</p>
requests.</p>
<ol>
<li>Go to <a href="https://github.com/balloob/home-assistant">the Home Assistant repository</a>
and click fork in the top right.</li>
<li>Go to <a href="https://github.com/balloob/home-assistant">the Home Assistant repository</a> and click fork in the top right.</li>
<li>Follow steps in the previous section but with your forked repository.</li>
<li>Create a new branch to hold your changes<br>
<code>git checkout -b some-feature</code></li>
<li>Make the changes you want</li>
<li>Check your changes for style violations<br>
<code>./script/lint</code></li>
<li>Commit the changes<br>
<code>git add .</code><br>
<code>git commit -m "Added some-feature"</code></li>
@ -161,18 +159,12 @@ pull request.</li>
<h3><a class='title-link' name='further-reading' href='#further-reading'></a> Further reading</h3>
<ul>
<li><a href="/developers/architecture.html">
Home Assistant Architecture
</a></li>
<li><a href="/developers/frontend.html">Frontend development</a></li>
<li><a href="/developers/creating_components.html">
Creating a custom component
</a></li>
<li><a href="/developers/add_new_platform.html">
Adding support for a new platform
</a></li>
<li><a href="/developers/api.html">Rest API</a></li>
<li><a href="/developers/website.html">Website </a></li>
<li><a href="/developers/architecture.html">Home Assistant Architecture</a></li>
<li><a href="/developers/frontend.html">Frontend development</a></li>
<li><a href="/developers/creating_components.html">Creating a custom component</a></li>
<li><a href="/developers/add_new_platform.html">Adding support for a new platform</a></li>
<li><a href="/developers/api.html">Rest API</a></li>
<li><a href="/developers/website.html">Website</a></li>
</ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>
@ -143,7 +143,7 @@
<h3><a class='title-link' name='get-details-about-servies-and-events' href='#get-details-about-servies-and-events'></a> Get details about servies and events</h3>
<p>Similar to the output in the &ldquo;Developer Tools&rdquo; of the frontend</p>
<p>Similar to the output in the &ldquo;Developer Tools&rdquo; of the frontend.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
@ -236,9 +236,11 @@
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">homeassistant.remote</span> <span class="kn">as</span> <span class="nn">remote</span>
</span><span class='line'><span class="kn">from</span> <span class="nn">homeassistant.const</span> <span class="kn">import</span> <span class="n">STATE_ON</span>
</span><span class='line'>
</span><span class='line'><span class="n">api</span> <span class="o">=</span> <span class="n">remote</span><span class="o">.</span><span class="n">API</span><span class="p">(</span><span class="s">&#39;host&#39;</span><span class="p">,</span> <span class="s">&#39;password&#39;</span><span class="p">)</span>
</span><span class='line'><span class="n">remote</span><span class="o">.</span><span class="n">set_state</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="s">&#39;sensor.office_temperature&#39;</span><span class="p">,</span> <span class="n">new_state</span><span class="o">=</span><span class="mi">123</span><span class="p">)</span>
</span><span class='line'><span class="n">remote</span><span class="o">.</span><span class="n">set_state</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="s">&#39;switch.livingroom_pin_2&#39;</span><span class="p">,</span> <span class="n">new_state</span><span class="o">=</span><span class="n">STATE_ON</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>
@ -258,9 +260,11 @@
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">time</span>
</span><span class='line'><span class="kn">import</span> <span class="nn">homeassistant.remote</span> <span class="kn">as</span> <span class="nn">remote</span>
</span><span class='line'>
</span><span class='line'><span class="n">api</span> <span class="o">=</span> <span class="n">remote</span><span class="o">.</span><span class="n">API</span><span class="p">(</span><span class="s">&#39;host&#39;</span><span class="p">,</span> <span class="s">&#39;password&#39;</span><span class="p">)</span>
</span><span class='line'><span class="n">domain</span> <span class="o">=</span> <span class="s">&#39;switch&#39;</span>
</span><span class='line'>
</span><span class='line'><span class="n">remote</span><span class="o">.</span><span class="n">call_service</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="s">&#39;turn_on&#39;</span><span class="p">)</span>
@ -271,7 +275,7 @@
<h3><a class='title-link' name='control-a-single-entity' href='#control-a-single-entity'></a> Control a single entity</h3>
<p>To turn on or off a single switch, the ID of the entity is needed as attribute.</p>
<p>To turn on or off a single switch. The ID of the entity is needed as attribute.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
@ -282,9 +286,11 @@
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">time</span>
</span><span class='line'><span class="kn">import</span> <span class="nn">homeassistant.remote</span> <span class="kn">as</span> <span class="nn">remote</span>
</span><span class='line'>
</span><span class='line'><span class="n">api</span> <span class="o">=</span> <span class="n">remote</span><span class="o">.</span><span class="n">API</span><span class="p">(</span><span class="s">&#39;host&#39;</span><span class="p">,</span> <span class="s">&#39;password&#39;</span><span class="p">)</span>
</span><span class='line'><span class="n">domain</span> <span class="o">=</span> <span class="s">&#39;switch&#39;</span>
</span><span class='line'><span class="n">switch_name</span> <span class="o">=</span> <span class="s">&#39;switch.livingroom_pin_2&#39;</span>
</span><span class='line'>
@ -294,6 +300,27 @@
</span></code></pre></td></tr></table></div></figure>
<h3><a class='title-link' name='send-a-notification' href='#send-a-notification'></a> Send a notification</h3>
<p>The example uses the jabber notification platform to send a single message to the given recipient in the <code>configuration.yaml</code> file.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">homeassistant.remote</span> <span class="kn">as</span> <span class="nn">remote</span>
</span><span class='line'>
</span><span class='line'><span class="n">api</span> <span class="o">=</span> <span class="n">remote</span><span class="o">.</span><span class="n">API</span><span class="p">(</span><span class="s">&#39;host&#39;</span><span class="p">,</span> <span class="s">&#39;password&#39;</span><span class="p">)</span>
</span><span class='line'><span class="n">domain</span> <span class="o">=</span> <span class="s">&#39;notify&#39;</span>
</span><span class='line'><span class="n">data</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;title&quot;</span><span class="p">:</span><span class="s">&quot;Test&quot;</span><span class="p">,</span> <span class="s">&quot;message&quot;</span><span class="p">:</span><span class="s">&quot;A simple test message from HA.&quot;</span><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="n">remote</span><span class="o">.</span><span class="n">call_service</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="s">&#39;jabber&#39;</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>
<p>For more details please check the source of <a href="https://github.com/balloob/home-assistant/blob/master/homeassistant/remote.py">homeassistant.remote</a>.</p>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>

View file

@ -58,9 +58,9 @@
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
<li><a href='/getting-started/automation.html'>Automation</a></li>
<li><a href='/cookbook'>Configuration cookbook</a></li>
<li><a href='/components/'>Component overview</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
<li>
<a href="/developers/">Developers</a>
<ul>