craftbeerpi4-pione/docs/index.html

268 lines
13 KiB
HTML
Raw Normal View History

2018-11-16 20:59:19 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to CraftBeerPis documentation! &#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>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<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="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<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="step.html">Step API</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="#">CraftBeerPi</a></h1>
<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="step.html">Step API</a></li>
</ul>
<div class="relations">
<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>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2018, Manuel Fritsch.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/index.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
2018-11-16 20:48:01 +01:00
</html>