Site updated at 2016-08-22 08:21:42 UTC
This commit is contained in:
parent
f9d65cbe57
commit
4acb07bf8e
559 changed files with 18878 additions and 21688 deletions
|
@ -102,7 +102,7 @@ Diagram showing interaction between components and the Home Assistant core.
|
|||
|
||||
<p>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.</p>
|
||||
|
||||
<p>For example, one of the built-in components is the <code>switch</code> component. This component is responsible for interaction with different types of switches.</p>
|
||||
<p>For example, one of the built-in components is the <code class="highlighter-rouge">switch</code> component. This component is responsible for interaction with different types of switches.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
|
@ -112,31 +112,22 @@ Diagram showing interaction between components and the Home Assistant core.
|
|||
|
||||
<p>These components provide small pieces of home automation logic or services that do common tasks within your house.</p>
|
||||
|
||||
<p>For example the <a href="/components/device_sun_light_trigger/"><code>device_sun_light_trigger</code> component</a> tracks the state of devices and the sun to make sure that the lights are turned on when it gets dark and there are people home. The component uses logic along the following lines:</p>
|
||||
<p>For example the <a href="/components/device_sun_light_trigger/"><code class="highlighter-rouge">device_sun_light_trigger</code> component</a> tracks the state of devices and the sun to make sure that the lights are turned on when it gets dark and there are people home. The component uses logic along the following lines:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre> In the event that device 'Paulus Nexus 5' changes to the 'Home' state:
|
||||
<pre><code class="language-plain"> In the event that device 'Paulus Nexus 5' changes to the 'Home' state:
|
||||
If the sun has set and the lights are not on:
|
||||
Turn on the lights
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</code></pre>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre> In the event that the combined state of all tracked devices changes to 'Not Home':
|
||||
<pre><code class="language-plain"> In the event that the combined state of all tracked devices changes to 'Not Home':
|
||||
If the lights are on:
|
||||
Turn off the lights
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</code></pre>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre> In the event of the sun setting:
|
||||
<pre><code class="language-plain"> In the event of the sun setting:
|
||||
If the lights are off and the combined state of all tracked device equals 'Home':
|
||||
Turn on the lights
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</code></pre>
|
||||
|
||||
<p>An extended example of a home automation component can be found <a href="https://github.com/home-assistant/home-assistant/blob/master/config/custom_components/example.py">here</a>.</p>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue