config added

This commit is contained in:
manuel83 2018-11-16 21:48:57 +01:00
parent 7a82e20e85
commit 58a3a0ded3
16 changed files with 255 additions and 292 deletions

View file

@ -2,7 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1a245e6a-2e43-4348-8759-dc1b63a4c9c8" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs_src/source/index.rst" afterPath="$PROJECT_DIR$/docs_src/source/index.rst" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -73,11 +73,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="index.rst" pinned="false" current-in-tab="false">
<file leaf-file-name="index.rst" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/docs_src/source/index.rst">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="267">
<caret line="20" column="0" lean-forward="false" selection-start-line="20" selection-start-column="0" selection-end-line="21" selection-end-column="20" />
<state relative-caret-position="105">
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
<folding />
</state>
</provider>
@ -167,12 +167,12 @@
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="true">
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="75">
<caret line="5" column="5" lean-forward="false" selection-start-line="5" selection-start-column="5" selection-end-line="5" selection-end-column="5" />
<caret line="5" column="8" lean-forward="false" selection-start-line="5" selection-start-column="8" selection-end-line="5" selection-end-column="8" />
<folding />
</first_editor>
<second_editor />
@ -287,6 +287,7 @@
<option value="$PROJECT_DIR$/core/extension/dummy/__init__.py" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/docs_src/source/index.rst" />
</list>
</option>
</component>
@ -342,6 +343,24 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="craftbeerpi4" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="docs_src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="source" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
@ -1128,14 +1147,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/index.rst">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="267">
<caret line="20" column="0" lean-forward="false" selection-start-line="20" selection-start-column="0" selection-end-line="21" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/actor.rst">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="227">
@ -1216,12 +1227,20 @@
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="75">
<caret line="5" column="5" lean-forward="false" selection-start-line="5" selection-start-column="5" selection-end-line="5" selection-end-column="5" />
<caret line="5" column="8" lean-forward="false" selection-start-line="5" selection-start-column="8" selection-end-line="5" selection-end-column="8" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/index.rst">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

BIN
docs/_images/picture.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -1,11 +1,31 @@
Actor API
Actor
=========
Test
^^^^
Architecture
^^^^^^^^^^^^
HELLO WORLD
.. image:: picture.jpeg
:scale: 50%
ActorController
^^^^^^^^^^^^^^^
.. automodule:: core.controller.actor_controller
:members:
:members:
Custom Actor
^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/dummy/__init__.py
:caption: __init__.py
:name: __init__-py
:language: python
:linenos:
config.yaml
.. literalinclude:: ../../core/extension/dummy/config.yaml
:language: yaml
:linenos:

View file

@ -6,27 +6,6 @@
Welcome to CraftBeerPi's documentation!
=======================================
Documentation
^^^^^^^^^^^^^
.. automodule:: core.craftbeerpi
:members:
.. automodule:: core.controller.notification_controller
:members:
Example Component
^^^^^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/comp/__init__.py
:language: python
Config YAML
^^^^^^^^^^^
.. literalinclude:: ../../core/extension/comp/config.yaml
:language: yaml
.. toctree::
:maxdepth: 1

View file

@ -1,2 +1,16 @@
Sensor API
==========
Sensor
==========
Architecture
^^^^
SensorController
^^^^^^^^^^^^^^^^
.. automodule:: core.controller.sensor_controller
:members:
Custom Sensor
^^^^^^^^^^^^^

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Actor API &#8212; CraftBeerPi 4.0 documentation</title>
<title>Actor &#8212; CraftBeerPi 4.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@ -16,7 +16,7 @@
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Sensor API" href="sensor.html" />
<link rel="next" title="Sensor" href="sensor.html" />
<link rel="prev" title="Welcome to CraftBeerPis documentation!" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -34,12 +34,15 @@
<div class="body" role="main">
<div class="section" id="actor-api">
<h1>Actor API<a class="headerlink" href="#actor-api" title="Permalink to this headline"></a></h1>
<div class="section" id="test">
<h2>Test<a class="headerlink" href="#test" title="Permalink to this headline"></a></h2>
<p>HELLO WORLD</p>
<span class="target" id="module-core.controller.actor_controller"></span><dl class="class">
<div class="section" id="actor">
<h1>Actor<a class="headerlink" href="#actor" title="Permalink to this headline"></a></h1>
<div class="section" id="architecture">
<h2>Architecture<a class="headerlink" href="#architecture" title="Permalink to this headline"></a></h2>
<a class="reference internal image-reference" href="_images/picture.jpeg"><img alt="_images/picture.jpeg" src="_images/picture.jpeg" style="width: 512.0px; height: 326.5px;" /></a>
</div>
<div class="section" id="module-core.controller.actor_controller">
<span id="actorcontroller"></span><h2>ActorController<a class="headerlink" href="#module-core.controller.actor_controller" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="core.controller.actor_controller.ActorController">
<em class="property">class </em><code class="descclassname">core.controller.actor_controller.</code><code class="descname">ActorController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.actor_controller.ActorController" title="Permalink to this definition"></a></dt>
<dd><p>The main actor controller</p>
@ -85,6 +88,137 @@
</dd></dl>
</div>
<div class="section" id="custom-actor">
<h2>Custom Actor<a class="headerlink" href="#custom-actor" title="Permalink to this headline"></a></h2>
<div class="literal-block-wrapper docutils container" id="init-py">
<div class="code-block-caption"><span class="caption-text">__init__.py</span><a class="headerlink" href="#init-py" title="Permalink to this code"></a></div>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">from</span> <span class="nn">core.api</span> <span class="kn">import</span> <span class="n">CBPiActor</span><span class="p">,</span> <span class="n">Property</span><span class="p">,</span> <span class="n">action</span><span class="p">,</span> <span class="n">background_task</span>
<span class="k">class</span> <span class="nc">CustomActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Number</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="s2">&quot;Test&quot;</span><span class="p">)</span>
<span class="n">name1</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Text</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="s2">&quot;Test&quot;</span><span class="p">)</span>
<span class="n">name2</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Kettle</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="s2">&quot;Test&quot;</span><span class="p">)</span>
<span class="nd">@background_task</span><span class="p">(</span><span class="s2">&quot;s1&quot;</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="n">async</span> <span class="k">def</span> <span class="nf">bg_job</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;WOOH BG&quot;</span><span class="p">)</span>
<span class="nd">@action</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="n">parameters</span><span class="o">=</span><span class="p">{})</span>
<span class="k">def</span> <span class="nf">myAction</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">pass</span>
<span class="k">def</span> <span class="nf">state</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">state</span><span class="p">()</span>
<span class="k">def</span> <span class="nf">off</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;OFF&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">state</span> <span class="o">=</span> <span class="bp">False</span>
<span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">power</span><span class="o">=</span><span class="mi">100</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;ON&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">state</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cbpi</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="k">if</span> <span class="n">cbpi</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;INIT MY ACTOR111111&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cfg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">load_config</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span>
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;########WOOHOO MY ACTOR&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cbpi</span> <span class="o">=</span> <span class="n">cbpi</span>
<span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">cbpi</span><span class="p">):</span>
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> This method is called by the server during startup </span>
<span class="sd"> Here you need to register your plugins at the server</span>
<span class="sd"> </span>
<span class="sd"> :param cbpi: the cbpi core </span>
<span class="sd"> :return: </span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="n">cbpi</span><span class="o">.</span><span class="n">plugin</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="s2">&quot;CustomActor&quot;</span><span class="p">,</span> <span class="n">CustomActor</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
</div>
<p>config.yaml</p>
<div class="highlight-yaml notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Manuel</span>
<span class="l l-Scalar l-Scalar-Plain">version</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">4</span>
</pre></div>
</td></tr></table></div>
</div>
</div>
@ -106,8 +240,8 @@
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>
@ -116,7 +250,7 @@
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to CraftBeerPis documentation!</a></li>
<li>Next: <a href="sensor.html" title="next chapter">Sensor API</a></li>
<li>Next: <a href="sensor.html" title="next chapter">Sensor</a></li>
</ul></li>
</ul>
</div>

View file

@ -40,10 +40,8 @@
<a href="#A"><strong>A</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#I"><strong>I</strong></a>
| <a href="#N"><strong>N</strong></a>
| <a href="#O"><strong>O</strong></a>
| <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a>
</div>
<h2 id="A">A</h2>
@ -58,14 +56,10 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#module-core.controller.actor_controller">core.controller.actor_controller (module)</a>
</li>
<li><a href="index.html#module-core.controller.notification_controller">core.controller.notification_controller (module)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#module-core.craftbeerpi">core.craftbeerpi (module)</a>
</li>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi">CraftBeerPi (class in core.craftbeerpi)</a>
<li><a href="sensor.html#module-core.controller.sensor_controller">core.controller.sensor_controller (module)</a>
</li>
</ul></td>
</tr></table>
@ -78,18 +72,6 @@
</ul></td>
</tr></table>
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#core.controller.notification_controller.NotificationController">NotificationController (class in core.controller.notification_controller)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi.notify">notify() (core.craftbeerpi.CraftBeerPi method)</a>
</li>
</ul></td>
</tr></table>
<h2 id="O">O</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
@ -102,24 +84,6 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController.register">register() (core.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi.register">(core.craftbeerpi.CraftBeerPi method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi.register_background_task">register_background_task() (core.craftbeerpi.CraftBeerPi method)</a>
</li>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi.register_http_endpoints">register_http_endpoints() (core.craftbeerpi.CraftBeerPi method)</a>
</li>
</ul></td>
</tr></table>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#core.craftbeerpi.CraftBeerPi.setup">setup() (core.craftbeerpi.CraftBeerPi method)</a>
</li>
</ul></td>
</tr></table>
@ -143,8 +107,8 @@
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>

View file

@ -16,7 +16,7 @@
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Actor API" href="actor.html" />
<link rel="next" title="Actor" href="actor.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -35,163 +35,13 @@
<div class="section" id="welcome-to-craftbeerpi-s-documentation">
<h1>Welcome to CraftBeerPis documentation!<a class="headerlink" href="#welcome-to-craftbeerpi-s-documentation" title="Permalink to this headline"></a></h1>
<div class="section" id="module-core.craftbeerpi">
<span id="documentation"></span><h2>Documentation<a class="headerlink" href="#module-core.craftbeerpi" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="core.craftbeerpi.CraftBeerPi">
<em class="property">class </em><code class="descclassname">core.craftbeerpi.</code><code class="descname">CraftBeerPi</code><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi" title="Permalink to this definition"></a></dt>
<dd><p>This is a Hello class docstring</p>
<dl class="method">
<dt id="core.craftbeerpi.CraftBeerPi.notify">
<code class="descname">notify</code><span class="sig-paren">(</span><em>key</em>, <em>message</em>, <em>type='info'</em><span class="sig-paren">)</span><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi.notify" title="Permalink to this definition"></a></dt>
<dd><p>This is a convinience method to send notification to the client</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>key</strong> notification key</li>
<li><strong>message</strong> notification message</li>
<li><strong>type</strong> notification type (info,warning,danger,successs)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.craftbeerpi.CraftBeerPi.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>obj</em>, <em>url_prefix=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi.register" title="Permalink to this definition"></a></dt>
<dd><p>This method parses the provided object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>obj</strong> the object wich will be parsed for registration</li>
<li><strong>url_prefix</strong> that prefix for HTTP Endpoints</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.craftbeerpi.CraftBeerPi.register_background_task">
<code class="descname">register_background_task</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi.register_background_task" title="Permalink to this definition"></a></dt>
<dd><p>This method parses all method for the &#64;background_task decorator and registers the background job
which will be launched during start up of the server</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>obj</strong> the object to parse</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.craftbeerpi.CraftBeerPi.register_http_endpoints">
<code class="descname">register_http_endpoints</code><span class="sig-paren">(</span><em>obj</em>, <em>url_prefix=None</em><span class="sig-paren">)</span><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi.register_http_endpoints" title="Permalink to this definition"></a></dt>
<dd><p>This method parses the provided object for &#64;request_mapping decorator</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>obj</strong> the object which will be analyzed</li>
<li><strong>url_prefix</strong> the prefix which will be used for the all http endpoints of the object</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.craftbeerpi.CraftBeerPi.setup">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.craftbeerpi.CraftBeerPi.setup" title="Permalink to this definition"></a></dt>
<dd><p>This method will start the server</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<span class="target" id="module-core.controller.notification_controller"></span><dl class="class">
<dt id="core.controller.notification_controller.NotificationController">
<em class="property">class </em><code class="descclassname">core.controller.notification_controller.</code><code class="descname">NotificationController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.notification_controller.NotificationController" title="Permalink to this definition"></a></dt>
<dd><p>This the notification controller</p>
</dd></dl>
</div>
<div class="section" id="example-component">
<h2>Example Component<a class="headerlink" href="#example-component" title="Permalink to this headline"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">core.api.decorator</span> <span class="kn">import</span> <span class="n">on_event</span>
<span class="kn">from</span> <span class="nn">core.api.extension</span> <span class="kn">import</span> <span class="n">CBPiExtension</span>
<span class="k">class</span> <span class="nc">MyComp</span><span class="p">(</span><span class="n">CBPiExtension</span><span class="p">):</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cbpi</span><span class="p">):</span>
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Initializer</span>
<span class="sd"> </span>
<span class="sd"> :param cbpi: </span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cbpi</span> <span class="o">=</span> <span class="n">cbpi</span>
<span class="c1"># register for bus events</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cbpi</span><span class="o">.</span><span class="n">register_events</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="nd">@on_event</span><span class="p">(</span><span class="n">topic</span><span class="o">=</span><span class="s2">&quot;actor/#&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">listen</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;Test&quot;</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">cbpi</span><span class="p">):</span>
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Setup method is invoked during startup</span>
<span class="sd"> </span>
<span class="sd"> :param cbpi: the cbpi core object</span>
<span class="sd"> :return: </span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="c1"># regsiter the component to the core</span>
<span class="n">cbpi</span><span class="o">.</span><span class="n">plugin</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="s2">&quot;MyComp&quot;</span><span class="p">,</span> <span class="n">MyComp</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="config-yaml">
<h2>Config YAML<a class="headerlink" href="#config-yaml" title="Permalink to this headline"></a></h2>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Manuel</span>
<span class="l l-Scalar l-Scalar-Plain">version</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">4</span>
</pre></div>
</div>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>
</div>
</div>
</div>
@ -212,8 +62,8 @@ which will be launched during start up of the server</p>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>
@ -221,7 +71,7 @@ which will be launched during start up of the server</p>
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="actor.html" title="next chapter">Actor API</a></li>
<li>Next: <a href="actor.html" title="next chapter">Actor</a></li>
</ul></li>
</ul>
</div>

Binary file not shown.

View file

@ -60,12 +60,7 @@
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="index.html#module-core.controller.notification_controller"><code class="xref">core.controller.notification_controller</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="index.html#module-core.craftbeerpi"><code class="xref">core.craftbeerpi</code></a></td><td>
<a href="sensor.html#module-core.controller.sensor_controller"><code class="xref">core.controller.sensor_controller</code></a></td><td>
<em></em></td></tr>
</table>
@ -87,8 +82,8 @@
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>

View file

@ -82,8 +82,8 @@
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>

View file

@ -1 +1 @@
Search.setIndex({docnames:["actor","index","sensor","step"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":1,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["actor.rst","index.rst","sensor.rst","step.rst"],objects:{"core.controller":{actor_controller:[0,0,0,"-"],notification_controller:[1,0,0,"-"]},"core.controller.actor_controller":{ActorController:[0,1,1,""]},"core.controller.actor_controller.ActorController":{init:[0,2,1,""],off:[0,2,1,""],register:[0,2,1,""]},"core.controller.notification_controller":{NotificationController:[1,1,1,""]},"core.craftbeerpi":{CraftBeerPi:[1,1,1,""]},"core.craftbeerpi.CraftBeerPi":{notify:[1,2,1,""],register:[1,2,1,""],register_background_task:[1,2,1,""],register_http_endpoints:[1,2,1,""],setup:[1,2,1,""]},core:{craftbeerpi:[1,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"class":[0,1],"import":1,"new":0,"return":[0,1],The:0,__init__:1,actor:1,actor_control:0,actorcontrol:0,all:[0,1],analyz:1,api:1,background:1,background_task:1,bus:1,cbpi:[0,1],cbpiextens:1,clazz:0,client:1,control:[0,1],convini:1,core:[0,1],creat:0,danger:1,decor:1,def:1,docstr:1,dure:[0,1],endpoint:1,event:1,extens:1,from:1,hello:[0,1],http:1,info:1,init:0,initi:[0,1],instanc:0,invok:1,job:1,kei:1,kwarg:[0,1],launch:1,listen:1,main:0,manuel:1,messag:1,method:[0,1],mycomp:1,name:[0,1],none:[0,1],notif:1,notifi:1,notification_control:1,notificationcontrol:1,obj:1,object:1,off:0,on_ev:1,param:[0,1],paramet:[0,1],pars:1,plugin:1,prefix:1,print:1,provid:1,regist:[0,1],register_background_task:1,register_ev:1,register_http_endpoint:1,registr:1,regsit:1,request_map:1,self:1,send:1,sensor:1,server:1,setup:1,start:1,startup:[0,1],step:1,successs:1,test:1,thi:[0,1],topic:1,type:[0,1],url_prefix:1,used:1,version:1,warn:1,which:1,wich:1,world:0},titles:["Actor API","Welcome to CraftBeerPi\u2019s documentation!","Sensor API","Step API"],titleterms:{actor:0,api:[0,2,3],compon:1,config:1,craftbeerpi:1,document:1,exampl:1,sensor:2,step:3,test:0,welcom:1,yaml:1}})
Search.setIndex({docnames:["actor","index","sensor","step"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":1,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["actor.rst","index.rst","sensor.rst","step.rst"],objects:{"core.controller":{actor_controller:[0,0,0,"-"],sensor_controller:[2,0,0,"-"]},"core.controller.actor_controller":{ActorController:[0,1,1,""]},"core.controller.actor_controller.ActorController":{init:[0,2,1,""],off:[0,2,1,""],register:[0,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"class":0,"import":0,"new":0,"return":0,"super":0,"true":0,The:0,__file__:0,__init__:0,action:0,actor111111:0,actor:1,actor_control:0,all:0,api:[0,1],async:0,background_task:0,basicconfig:0,bg_job:0,call:0,cbpi:0,cbpiactor:0,cfg:0,clazz:0,config:0,control:0,core:0,creat:0,customactor:0,def:0,dure:0,fals:0,from:0,getlogg:0,here:0,info:0,init:0,initi:0,instanc:0,interv:0,kei:0,kettl:0,kwarg:0,label:0,level:0,load_config:0,log:0,logger:0,main:0,manuel:0,method:0,myaction:0,name1:0,name2:0,name:0,need:0,none:0,number:0,off:0,param:0,paramet:0,pass:0,plugin:0,power:0,print:0,properti:0,regist:0,self:0,sensor:1,server:0,setup:0,startup:0,state:0,step:1,test:0,text:0,thi:0,type:0,version:0,wooh:0,woohoo:0,yaml:0,you:0,your:0},titles:["Actor","Welcome to CraftBeerPi\u2019s documentation!","Sensor","Step API"],titleterms:{actor:0,actorcontrol:0,api:3,architectur:[0,2],craftbeerpi:1,custom:[0,2],document:1,sensor:2,sensorcontrol:2,step:3,welcom:1}})

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sensor API &#8212; CraftBeerPi 4.0 documentation</title>
<title>Sensor &#8212; CraftBeerPi 4.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@ -17,7 +17,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Step API" href="step.html" />
<link rel="prev" title="Actor API" href="actor.html" />
<link rel="prev" title="Actor" href="actor.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -34,8 +34,17 @@
<div class="body" role="main">
<div class="section" id="sensor-api">
<h1>Sensor API<a class="headerlink" href="#sensor-api" title="Permalink to this headline"></a></h1>
<div class="section" id="sensor">
<h1>Sensor<a class="headerlink" href="#sensor" title="Permalink to this headline"></a></h1>
<div class="section" id="architecture">
<h2>Architecture<a class="headerlink" href="#architecture" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-core.controller.sensor_controller">
<span id="sensorcontroller"></span><h2>SensorController<a class="headerlink" href="#module-core.controller.sensor_controller" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="custom-sensor">
<h2>Custom Sensor<a class="headerlink" href="#custom-sensor" title="Permalink to this headline"></a></h2>
</div>
</div>
@ -56,8 +65,8 @@
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Step API</a></li>
</ul>
@ -65,7 +74,7 @@
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="actor.html" title="previous chapter">Actor API</a></li>
<li>Previous: <a href="actor.html" title="previous chapter">Actor</a></li>
<li>Next: <a href="step.html" title="next chapter">Step API</a></li>
</ul></li>
</ul>

View file

@ -16,7 +16,7 @@
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Sensor API" href="sensor.html" />
<link rel="prev" title="Sensor" href="sensor.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -55,8 +55,8 @@
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor API</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a></li>
<li class="toctree-l1"><a class="reference internal" href="sensor.html">Sensor</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Step API</a></li>
</ul>
@ -64,7 +64,7 @@
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="sensor.html" title="previous chapter">Sensor API</a></li>
<li>Previous: <a href="sensor.html" title="previous chapter">Sensor</a></li>
</ul></li>
</ul>
</div>

View file

@ -6,27 +6,6 @@
Welcome to CraftBeerPi's documentation!
=======================================
Documentation
^^^^^^^^^^^^^
.. automodule:: core.craftbeerpi
:members:
.. automodule:: core.controller.notification_controller
:members:
Example Component
^^^^^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/comp/__init__.py
:language: python
Config YAML
^^^^^^^^^^^
.. literalinclude:: ../../core/extension/comp/config.yaml
:language: yaml
.. toctree::
:maxdepth: 1