<divclass="code-block-caption"><spanclass="caption-text">__init__.py</span><aclass="headerlink"href="#init-py"title="Permalink to this code">¶</a></div>
<spanclass="n">logger</span><spanclass="o">.</span><spanclass="n">error</span><spanclass="p">(</span><spanclass="s2">"Failed to load RPi.GPIO. Using Mock"</span><spanclass="p">)</span>
<spanclass="n">logger</span><spanclass="o">.</span><spanclass="n">info</span><spanclass="p">(</span><spanclass="s2">"ACTOR </span><spanclass="si">%s</span><spanclass="s2"> OFF "</span><spanclass="o">%</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">id</span><spanclass="p">)</span>
<spanclass="c1"># Custom property which can be configured by the user</span>
<spanclass="n">gpio</span><spanclass="o">=</span><spanclass="n">Property</span><spanclass="o">.</span><spanclass="n">Select</span><spanclass="p">(</span><spanclass="s2">"GPIO"</span><spanclass="p">,</span><spanclass="n">options</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="mi">0</span><spanclass="p">,</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">5</span><spanclass="p">,</span><spanclass="mi">6</span><spanclass="p">,</span><spanclass="mi">7</span><spanclass="p">,</span><spanclass="mi">8</span><spanclass="p">,</span><spanclass="mi">9</span><spanclass="p">,</span><spanclass="mi">10</span><spanclass="p">,</span><spanclass="mi">11</span><spanclass="p">,</span><spanclass="mi">12</span><spanclass="p">,</span><spanclass="mi">13</span><spanclass="p">,</span><spanclass="mi">14</span><spanclass="p">,</span><spanclass="mi">15</span><spanclass="p">,</span><spanclass="mi">16</span><spanclass="p">,</span><spanclass="mi">17</span><spanclass="p">,</span><spanclass="mi">18</span><spanclass="p">,</span><spanclass="mi">19</span><spanclass="p">,</span><spanclass="mi">20</span><spanclass="p">,</span><spanclass="mi">21</span><spanclass="p">,</span><spanclass="mi">22</span><spanclass="p">,</span><spanclass="mi">23</span><spanclass="p">,</span><spanclass="mi">24</span><spanclass="p">,</span><spanclass="mi">25</span><spanclass="p">,</span><spanclass="mi">26</span><spanclass="p">,</span><spanclass="mi">27</span><spanclass="p">],</span><spanclass="n">description</span><spanclass="o">=</span><spanclass="s2">"GPIO to which the actor is connected"</span><spanclass="p">)</span>
<spanclass="k">raise</span><spanclass="n">CBPiException</span><spanclass="p">(</span><spanclass="s2">"FAILD TO INIT ACTOR"</span><spanclass="p">)</span>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s2">"GPIO ON </span><spanclass="si">%s</span><spanclass="s2">"</span><spanclass="o">%</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">gpio</span><spanclass="p">))</span>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s2">"GPIO OFF </span><spanclass="si">%s</span><spanclass="s2">"</span><spanclass="o">%</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">gpio</span><spanclass="p">))</span>
<spanclass="c1"># Custom property which can be configured by the user</span>
<spanclass="n">gpio</span><spanclass="o">=</span><spanclass="n">Property</span><spanclass="o">.</span><spanclass="n">Select</span><spanclass="p">(</span><spanclass="s2">"GPIO"</span><spanclass="p">,</span><spanclass="n">options</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="mi">0</span><spanclass="p">,</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">5</span><spanclass="p">,</span><spanclass="mi">6</span><spanclass="p">,</span><spanclass="mi">7</span><spanclass="p">,</span><spanclass="mi">8</span><spanclass="p">,</span><spanclass="mi">9</span><spanclass="p">,</span><spanclass="mi">10</span><spanclass="p">,</span><spanclass="mi">11</span><spanclass="p">,</span><spanclass="mi">12</span><spanclass="p">,</span><spanclass="mi">13</span><spanclass="p">,</span><spanclass="mi">14</span><spanclass="p">,</span><spanclass="mi">15</span><spanclass="p">,</span><spanclass="mi">16</span><spanclass="p">,</span><spanclass="mi">17</span><spanclass="p">,</span><spanclass="mi">18</span><spanclass="p">,</span><spanclass="mi">19</span><spanclass="p">,</span><spanclass="mi">20</span><spanclass="p">,</span><spanclass="mi">21</span><spanclass="p">,</span><spanclass="mi">22</span><spanclass="p">,</span><spanclass="mi">23</span><spanclass="p">,</span><spanclass="mi">24</span><spanclass="p">,</span><spanclass="mi">25</span><spanclass="p">,</span><spanclass="mi">26</span><spanclass="p">,</span><spanclass="mi">27</span><spanclass="p">],</span><spanclass="n">description</span><spanclass="o">=</span><spanclass="s2">"GPIO to which the actor is connected"</span><spanclass="p">)</span>
<spanclass="k">raise</span><spanclass="n">CBPiException</span><spanclass="p">(</span><spanclass="s2">"FAILD TO INIT ACTOR"</span><spanclass="p">)</span>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s2">"GPIO ON </span><spanclass="si">%s</span><spanclass="s2">"</span><spanclass="o">%</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">gpio</span><spanclass="p">))</span>
<spanclass="k">print</span><spanclass="p">(</span><spanclass="s2">"GPIO OFF </span><spanclass="si">%s</span><spanclass="s2">"</span><spanclass="o">%</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">gpio</span><spanclass="p">))</span>
<emclass="property">class </em><codeclass="descclassname">cbpi.api.</code><codeclass="descname">Property</code><aclass="headerlink"href="#cbpi.api.Property"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Actor</code><spanclass="sig-paren">(</span><em>label</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Actor"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Kettle</code><spanclass="sig-paren">(</span><em>label</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Kettle"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Number</code><spanclass="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=None</em>, <em>unit=''</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Number"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Select</code><spanclass="sig-paren">(</span><em>label</em>, <em>options</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Select"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Sensor</code><spanclass="sig-paren">(</span><em>label</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Sensor"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descname">Text</code><spanclass="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=''</em>, <em>description=''</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cbpi.api.Property.Text"title="Permalink to this definition">¶</a></dt>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.