documentation updated

This commit is contained in:
manuel83 2019-01-05 23:27:29 +01:00
parent b4640b477a
commit 7923c76523
27 changed files with 1403 additions and 738 deletions

View file

@ -2,8 +2,15 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="1a245e6a-2e43-4348-8759-dc1b63a4c9c8" name="Default" comment="Lots of changes"> <list default="true" id="1a245e6a-2e43-4348-8759-dc1b63a4c9c8" name="Default" comment="Lots of changes">
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" /> <change beforePath="$PROJECT_DIR$/config/config.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/config/config.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/craftbeerpi.db" beforeDir="false" afterPath="$PROJECT_DIR$/craftbeerpi.db" afterDir="false" /> <change beforePath="$PROJECT_DIR$/docs_src/source/actor.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/actor.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/index.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/index.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/install.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/install.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/kettle_controller.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/kettle_controller.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/properties.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/properties.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/sensor.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/sensor.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs_src/source/step.rst" beforeDir="false" afterPath="$PROJECT_DIR$/docs_src/source/step.rst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -26,7 +33,7 @@
<SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_tests_test_actor.coverage" NAME="pytest for tests.test_actor Coverage Results" MODIFIED="1546724758047" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_tests_test_actor.coverage" NAME="pytest for tests.test_actor Coverage Results" MODIFIED="1546724758047" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/craftbeerpi4$pytest_in_tests.coverage" NAME="pytest in tests Coverage Results" MODIFIED="1546717215007" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$pytest_in_tests.coverage" NAME="pytest in tests Coverage Results" MODIFIED="1546717215007" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/craftbeerpi4$test_app.coverage" NAME="test_app Coverage Results" MODIFIED="1546525009502" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" /> <SUITE FILE_PATH="coverage/craftbeerpi4$test_app.coverage" NAME="test_app Coverage Results" MODIFIED="1546525009502" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/tests" />
<SUITE FILE_PATH="coverage/craftbeerpi4$run.coverage" NAME="run Coverage Results" MODIFIED="1546724751793" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$run.coverage" NAME="run Coverage Results" MODIFIED="1546724951675" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_test_kettle_KettleTestCase.coverage" NAME="pytest for test_kettle.KettleTestCase Coverage Results" MODIFIED="1546357864696" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_test_kettle_KettleTestCase.coverage" NAME="pytest for test_kettle.KettleTestCase Coverage Results" MODIFIED="1546357864696" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/craftbeerpi4$py_test_in_tests.coverage" NAME="py.test in tests Coverage Results" MODIFIED="1544486432317" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" /> <SUITE FILE_PATH="coverage/craftbeerpi4$py_test_in_tests.coverage" NAME="py.test in tests Coverage Results" MODIFIED="1544486432317" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
<SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_test_config_ConfigTestCase.coverage" NAME="pytest for test_config.ConfigTestCase Coverage Results" MODIFIED="1546212760017" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/craftbeerpi4$pytest_for_test_config_ConfigTestCase.coverage" NAME="pytest for test_config.ConfigTestCase Coverage Results" MODIFIED="1546212760017" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
@ -65,86 +72,54 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/tests/test_actor.py"> <entry file="file://$PROJECT_DIR$/docs_src/source/install.rst">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="restructured-text-editor" />
<state relative-caret-position="60">
<caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/extension/dummyactor/config.yaml"> <entry file="file://$PROJECT_DIR$/docs_src/source/kettle_controller.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/docs_src/source/properties.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/docs_src/source/sensor.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/docs_src/source/webapis.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/docs_src/build/html/index.html">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/extension/dummyactor/__init__.py"> <entry file="file://$PROJECT_DIR$/docs/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor" />
<state relative-caret-position="-191">
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/cli.py"> <entry file="file://$PROJECT_DIR$/docs_src/source/index.rst">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="restructured-text-editor" />
<state relative-caret-position="204">
<caret line="37" column="4" selection-start-line="37" selection-start-column="4" selection-end-line="38" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/http_endpoints/http_sensor.py"> <entry file="file://$PROJECT_DIR$/docs_src/source/actor.rst">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="restructured-text-editor" />
<state relative-caret-position="161">
<caret line="165" column="54" selection-start-line="165" selection-start-column="54" selection-end-line="165" selection-end-column="54" />
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="4" selection-start-line="7" selection-start-column="4" selection-end-line="7" selection-end-column="4" />
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/controller/actor_controller.py"> <entry file="file://$PROJECT_DIR$/docs_src/source/step.rst">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="restructured-text-editor" />
<state relative-caret-position="45">
<caret line="3" column="29" selection-start-line="3" selection-start-column="29" selection-end-line="3" selection-end-column="29" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cbpi/controller/crud_controller.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-117">
<caret line="6" column="6" selection-start-line="6" selection-start-column="6" selection-end-line="6" selection-end-column="6" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
</file> </file>
</leaf> </leaf>
@ -158,8 +133,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>runng</find>
<find>is_next</find>
<find>S NEXT</find> <find>S NEXT</find>
<find>rwing</find> <find>rwing</find>
<find>next</find> <find>next</find>
@ -188,6 +161,8 @@
<find>basicConfig</find> <find>basicConfig</find>
<find>cbp</find> <find>cbp</find>
<find>HALLOOOOOOO</find> <find>HALLOOOOOOO</find>
<find>It's im</find>
<find>cbpi</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace /> <replace />
@ -210,15 +185,6 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/build/lib/cbpi/craftbeerpi.py" />
<option value="$PROJECT_DIR$/build/lib/cbpi/controller/config_controller.py" />
<option value="$APPLICATION_CONFIG_DIR$/consoles/.datagrid/cell" />
<option value="$PROJECT_DIR$/test.py" />
<option value="$PROJECT_DIR$/cbpi/controller/notification_controller.py" />
<option value="$PROJECT_DIR$/cbpi/controller/plugin_controller.py" />
<option value="$PROJECT_DIR$/cbpi/controller/system_controller.py" />
<option value="$PROJECT_DIR$/cbpi/extension/dummylogic/__init__.py" />
<option value="$PROJECT_DIR$/cbpi/extension/dummysensor/__init__.py" />
<option value="$PROJECT_DIR$/cbpi/extension/dummystep/__init__.py" /> <option value="$PROJECT_DIR$/cbpi/extension/dummystep/__init__.py" />
<option value="$PROJECT_DIR$/cbpi/http_endpoints/http_login.py" /> <option value="$PROJECT_DIR$/cbpi/http_endpoints/http_login.py" />
<option value="$PROJECT_DIR$/cbpi/http_endpoints/http_curd_endpoints.py" /> <option value="$PROJECT_DIR$/cbpi/http_endpoints/http_curd_endpoints.py" />
@ -239,7 +205,6 @@
<option value="$PROJECT_DIR$/cbpi/http_endpoints/http_step.py" /> <option value="$PROJECT_DIR$/cbpi/http_endpoints/http_step.py" />
<option value="$PROJECT_DIR$/cbpi/config/plugin_list.txt" /> <option value="$PROJECT_DIR$/cbpi/config/plugin_list.txt" />
<option value="$PROJECT_DIR$/cfg/plugin_list.txt" /> <option value="$PROJECT_DIR$/cfg/plugin_list.txt" />
<option value="$PROJECT_DIR$/config/config.yaml" />
<option value="$PROJECT_DIR$/requirements.txt" /> <option value="$PROJECT_DIR$/requirements.txt" />
<option value="$PROJECT_DIR$/cbpi/controller/config_controller.py" /> <option value="$PROJECT_DIR$/cbpi/controller/config_controller.py" />
<option value="$PROJECT_DIR$/cbpi/extension/comp/__init__.py" /> <option value="$PROJECT_DIR$/cbpi/extension/comp/__init__.py" />
@ -254,13 +219,23 @@
<option value="$PROJECT_DIR$/app.log" /> <option value="$PROJECT_DIR$/app.log" />
<option value="$PROJECT_DIR$/tests/test_config.py" /> <option value="$PROJECT_DIR$/tests/test_config.py" />
<option value="$PROJECT_DIR$/cbpi/controller/step_controller.py" /> <option value="$PROJECT_DIR$/cbpi/controller/step_controller.py" />
<option value="$PROJECT_DIR$/setup.py" />
<option value="$PROJECT_DIR$/cbpi/controller/sensor_controller.py" /> <option value="$PROJECT_DIR$/cbpi/controller/sensor_controller.py" />
<option value="$PROJECT_DIR$/cbpi/cli.py" /> <option value="$PROJECT_DIR$/cbpi/cli.py" />
<option value="$PROJECT_DIR$/cbpi/http_endpoints/http_sensor.py" /> <option value="$PROJECT_DIR$/cbpi/http_endpoints/http_sensor.py" />
<option value="$PROJECT_DIR$/tests/test_actor.py" /> <option value="$PROJECT_DIR$/tests/test_actor.py" />
<option value="$PROJECT_DIR$/cbpi/controller/actor_controller.py" /> <option value="$PROJECT_DIR$/cbpi/controller/actor_controller.py" />
<option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/setup.py" />
<option value="$PROJECT_DIR$/config/config.yaml" />
<option value="$PROJECT_DIR$/docs_src/source/step.rst" />
<option value="$PROJECT_DIR$/docs_src/source/actor.rst" />
<option value="$PROJECT_DIR$/docs_src/source/kettle_controller.rst" />
<option value="$PROJECT_DIR$/docs_src/source/properties.rst" />
<option value="$PROJECT_DIR$/docs_src/source/sensor.rst" />
<option value="$PROJECT_DIR$/docs_src/source/restapi.rst" />
<option value="$PROJECT_DIR$/docs_src/source/webapis.rst" />
<option value="$PROJECT_DIR$/docs_src/source/index.rst" />
<option value="$PROJECT_DIR$/docs_src/source/install.rst" />
</list> </list>
</option> </option>
</component> </component>
@ -286,13 +261,18 @@
<path> <path>
<item name="craftbeerpi4" type="b2602c69:ProjectViewProjectNode" /> <item name="craftbeerpi4" type="b2602c69:ProjectViewProjectNode" />
<item name="craftbeerpi4" type="462c0819:PsiDirectoryNode" /> <item name="craftbeerpi4" type="462c0819:PsiDirectoryNode" />
<item name="cbpi" type="462c0819:PsiDirectoryNode" /> <item name="docs" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path> <path>
<item name="craftbeerpi4" type="b2602c69:ProjectViewProjectNode" /> <item name="craftbeerpi4" type="b2602c69:ProjectViewProjectNode" />
<item name="craftbeerpi4" type="462c0819:PsiDirectoryNode" /> <item name="craftbeerpi4" type="462c0819:PsiDirectoryNode" />
<item name="cbpi" type="462c0819:PsiDirectoryNode" /> <item name="docs_src" type="462c0819:PsiDirectoryNode" />
<item name="http_endpoints" type="462c0819:PsiDirectoryNode" /> </path>
<path>
<item name="craftbeerpi4" type="b2602c69:ProjectViewProjectNode" />
<item name="craftbeerpi4" type="462c0819:PsiDirectoryNode" />
<item name="docs_src" type="462c0819:PsiDirectoryNode" />
<item name="source" type="462c0819:PsiDirectoryNode" />
</path> </path>
</expand> </expand>
<select /> <select />
@ -312,11 +292,11 @@
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/docs_src/source" />
<recent name="$PROJECT_DIR$/logs/sensors" /> <recent name="$PROJECT_DIR$/logs/sensors" />
<recent name="$PROJECT_DIR$/cbpi/api" /> <recent name="$PROJECT_DIR$/cbpi/api" />
<recent name="$PROJECT_DIR$/test" /> <recent name="$PROJECT_DIR$/test" />
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/tests" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/cbpi" /> <recent name="$PROJECT_DIR$/cbpi" />
@ -338,7 +318,7 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Python tests.pytest for tests.test_actor"> <component name="RunManager" selected="Python.run">
<configuration name="cli" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="cli" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="craftbeerpi4" /> <module name="craftbeerpi4" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
@ -558,7 +538,7 @@
<workItem from="1546003397332" duration="543000" /> <workItem from="1546003397332" duration="543000" />
<workItem from="1546006149688" duration="24136000" /> <workItem from="1546006149688" duration="24136000" />
<workItem from="1546201868140" duration="66956000" /> <workItem from="1546201868140" duration="66956000" />
<workItem from="1546520120024" duration="47397000" /> <workItem from="1546520120024" duration="49686000" />
</task> </task>
<task id="LOCAL-00001" summary="Lots of changes"> <task id="LOCAL-00001" summary="Lots of changes">
<created>1541288846149</created> <created>1541288846149</created>
@ -610,7 +590,7 @@
</history-entry> </history-entry>
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="151676000" /> <option name="totallyTimeSpent" value="153965000" />
</component> </component>
<component name="TodoView" selected-index="4"> <component name="TodoView" selected-index="4">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -625,15 +605,15 @@
<frame x="123" y="23" width="1492" height="910" extended-state="0" /> <frame x="123" y="23" width="1492" height="910" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.3262069" /> <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.3262069" />
<window_info id="Structure" order="1" weight="0.24957556" /> <window_info id="Structure" order="1" weight="0.24957556" />
<window_info id="Favorites" order="2" side_tool="true" /> <window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Event Log" order="0" sideWeight="0.2737931" side_tool="true" weight="0.3997555" /> <window_info anchor="bottom" id="Event Log" order="0" sideWeight="0.2737931" side_tool="true" weight="0.3997555" />
<window_info anchor="bottom" id="Version Control" order="1" weight="0.32762837" /> <window_info anchor="bottom" id="Version Control" order="1" weight="0.32762837" />
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.7262069" visible="true" weight="0.47432762" /> <window_info anchor="bottom" id="Run" order="2" sideWeight="0.7262069" weight="0.47432762" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39731053" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.39731053" />
<window_info anchor="bottom" id="Python Console" order="4" weight="0.32885087" /> <window_info anchor="bottom" id="Python Console" order="4" weight="0.32885087" />
<window_info anchor="bottom" id="Terminal" order="5" sideWeight="0.49761903" weight="0.29951102" /> <window_info anchor="bottom" id="Terminal" order="5" sideWeight="0.49761903" visible="true" weight="0.30929095" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3286945" /> <window_info anchor="bottom" id="TODO" order="6" weight="0.3286945" />
<window_info anchor="bottom" id="Message" order="7" /> <window_info anchor="bottom" id="Message" order="7" />
<window_info anchor="bottom" id="Find" order="8" weight="0.32518336" /> <window_info anchor="bottom" id="Find" order="8" weight="0.32518336" />
@ -692,102 +672,6 @@
</watches-manager> </watches-manager>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/cbpi/api/kettle_logic.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/api/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="281">
<caret line="26" column="24" selection-start-line="26" selection-start-column="24" selection-end-line="26" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/http_endpoints/http_step.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" selection-start-line="2" selection-end-line="2" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/config/config.yaml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/database/model.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-475">
<caret line="3" selection-start-line="3" selection-end-line="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/database/orm_framework.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-645">
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/config/create_database.sql">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/config/plugin_list.txt">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="10" selection-start-column="10" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cfg/plugin_list.txt">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="5" selection-start-column="5" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cfg/config.yaml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/eventbus.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="e#0#14#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/config.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="12" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/controller/config_controller.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="9" selection-start-line="1" selection-start-column="9" selection-end-line="1" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/extension/comp/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="70">
<caret line="32" column="51" selection-start-line="32" selection-start-column="51" selection-end-line="32" selection-end-column="51" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/MANIFEST.in"> <entry file="file://$PROJECT_DIR$/MANIFEST.in">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="15">
@ -900,13 +784,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/setup.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="206">
<caret line="31" column="8" selection-start-line="31" selection-start-column="8" selection-end-line="31" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cbpi/http_endpoints/http_curd_endpoints.py"> <entry file="file://$PROJECT_DIR$/cbpi/http_endpoints/http_curd_endpoints.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270"> <state relative-caret-position="270">
@ -1040,5 +917,74 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/setup.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="35" lean-forward="true" selection-start-line="20" selection-start-column="35" selection-end-line="20" selection-end-column="35" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/config.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="12" selection-start-line="4" selection-start-column="12" selection-end-line="4" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="60">
<caret line="4" selection-start-line="4" selection-end-line="4" />
</first_editor>
<second_editor>
<js_state />
</second_editor>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/docs/install.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="25" selection-start-line="25" selection-end-line="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/conf.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/standards.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/step.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/properties.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/kettle_controller.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/actor.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/build/html/index.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs/index.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/sensor.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/webapis.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/index.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/docs_src/source/install.rst">
<provider selected="true" editor-type-id="restructured-text-editor" />
</entry>
</component> </component>
</project> </project>

View file

@ -2,7 +2,7 @@
name: CraftBeerPi name: CraftBeerPi
version: 4.1 version: 4.1
#index_url: /myext index_url: /api/doc
port: 8080 port: 8080

View file

@ -11,7 +11,7 @@ Architecture
ActorController ActorController
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
.. autoclass:: core.controller.actor_controller.ActorController .. autoclass:: cbpi.controller.actor_controller.ActorController
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:
@ -21,7 +21,7 @@ ActorController
CBPiActor CBPiActor
^^^^^^^^^ ^^^^^^^^^
.. autoclass:: core.api.actor.CBPiActor .. autoclass:: cbpi.api.CBPiActor
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:
@ -31,7 +31,7 @@ CBPiActor
Custom Actor Custom Actor
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/dummyactor/__init__.py .. literalinclude:: ../../cbpi/extension/dummyactor/__init__.py
:caption: __init__.py :caption: __init__.py
:name: __init__-py :name: __init__-py
:language: python :language: python
@ -40,6 +40,6 @@ Custom Actor
config.yaml config.yaml
.. literalinclude:: ../../core/extension/dummyactor/config.yaml .. literalinclude:: ../../cbpi/extension/dummyactor/config.yaml
:language: yaml :language: yaml
:linenos: :linenos:

View file

@ -18,6 +18,7 @@ Welcome to CraftBeerPi's documentation!
kettle_controller kettle_controller
properties properties
standards standards
webapis
.. ..

View file

@ -1,12 +1,65 @@
============
Installation Installation
============ ============
Please make sure that Python 3.6 is installed Please make sure that Python 3.5 is installed.
`Rapsbian Stretch <https://www.raspberrypi.org/downloads/raspbian//>`_ is required at least.
It will also run on MacOS
Download and Installation
=========================
:: ::
git clone https://github.com/manuel83/craftbeerpi4 $ sudo pip install -i https://test.pypi.org/simple/ cbpi
cd craftbeerpi4 Further version can be found on PiPy: https://test.pypi.org/project/cbpi/
.. note::
All dependencies will be installed automatically. The installation will add the command "cbpi" to your shell.
To uninstall just remove the package via pip.
::
$ sudo pip uninstall cbpi
Run the Server
==============
To start CraftBeerPi just run the following command in your shell
::
$ cbpi
During the first startup a `config` and `logs` folder gets created in the directory from where the `$ cbpi` in called
PIP Website: https://test.pypi.org/project/cbpi/
Update CraftBeerPi
==================
That's super easy. Just run again with upgrade option
::
$ sudo pip install -i https://test.pypi.org/simple/ cbpi --upgrade
Install plugins
===============
Plugins are normal Python Pip packages.
Install
::
$ sudo pip install -i https://test.pypi.org/simple/ CBPiActor1
Uninstall
::
$ pip uninstall CBPiActor1
pip install -r requirements.txt

View file

@ -6,7 +6,7 @@ Kettle
KettleController KettleController
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
.. autoclass:: core.controller.kettle_controller.KettleController .. autoclass:: cbpi.controller.kettle_controller.KettleController
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:
@ -16,7 +16,7 @@ CBPiKettleLogic
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
.. autoclass:: core.api.kettle_logic.CBPiKettleLogic .. autoclass:: cbpi.api.CBPiKettleLogic
:members: :members:
:show-inheritance: :show-inheritance:
:inherited-members: :inherited-members:
@ -25,7 +25,7 @@ CBPiKettleLogic
Custom Logic Custom Logic
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/dummylogic/__init__.py .. literalinclude:: ../../cbpi/extension/dummylogic/__init__.py
:caption: __init__.py :caption: __init__.py
:name: __init__-py :name: __init__-py
:language: python :language: python
@ -34,6 +34,6 @@ Custom Logic
config.yaml config.yaml
.. literalinclude:: ../../core/extension/dummylogic/config.yaml .. literalinclude:: ../../cbpi/extension/dummylogic/config.yaml
:language: yaml :language: yaml
:linenos: :linenos:

View file

@ -13,7 +13,7 @@ Typical example how to use properties in an actor module.
Custom Actor Custom Actor
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/dummyactor/__init__.py .. literalinclude:: ../../cbpi/extension/dummyactor/__init__.py
:caption: __init__.py :caption: __init__.py
:name: __init__-py :name: __init__-py
:language: python :language: python
@ -23,7 +23,7 @@ Custom Actor
.. autoclass:: core.api.property.Property .. autoclass:: cbpi.api.Property
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:

View file

@ -5,7 +5,7 @@ Sensor
Sensor Controller Sensor Controller
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
.. autoclass:: core.controller.sensor_controller.SensorController .. autoclass:: cbpi.controller.sensor_controller.SensorController
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:
@ -15,7 +15,7 @@ Sensor Controller
CBPiSensor CBPiSensor
^^^^^^^^^^ ^^^^^^^^^^
.. autoclass:: core.api.sensor.CBPiSensor .. autoclass:: cbpi.api.CBPiSensor
:members: :members:
:private-members: :private-members:
:undoc-members: :undoc-members:
@ -25,15 +25,15 @@ CBPiSensor
Custom Sensor Custom Sensor
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. literalinclude:: ../../core/extension/dummysensor/__init__.py .. literalinclude:: ../../cbpi/extension/dummysensor/__init__.py
:caption: __init__.py :caption: __init__.py
:name: __init__-py :name: __init__.py
:language: python :language: python
:linenos: :linenos:
config.yaml config.yaml
.. literalinclude:: ../../core/extension/dummysensor/config.yaml .. literalinclude:: ../../cbpi/extension/dummysensor/config.yaml
:language: yaml :language: yaml
:linenos: :linenos:

View file

@ -36,6 +36,8 @@ Here an example how listen on an event.
It's imporante to add **kwargs as parameter to the listening method. This makes sure that maybe addtional event paramenter are not causing an exception. It's imporante to add **kwargs as parameter to the listening method. This makes sure that maybe addtional event paramenter are not causing an exception.
A list of all registered events listeners can be found under: `http://<IP_ADDRESS>:<PORT>/system/events`
HTTP Endpoints HTTP Endpoints
-------------- --------------
@ -80,6 +82,13 @@ The CBPiWebSocket Event is having the following structure.
SQL Files
---------
Currently only one SQL file for database initialisation is available.
It's located under: `./core/sql`
Web User Interface Web User Interface
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
The Web UI is based on ReactJS + Redux. The Web UI is based on ReactJS + Redux.
@ -98,3 +107,8 @@ After server startup you can find the API documentaiton under: `http://<IP_ADDRE
To generate the swagger file `aiohttp-swagger` is used. for more information see: https://aiohttp-swagger.readthedocs.io/en/latest/ To generate the swagger file `aiohttp-swagger` is used. for more information see: https://aiohttp-swagger.readthedocs.io/en/latest/
Custom Extensions & Pluins
^^^^^^^^^^^^^^^^^^^^^^^^^^
Custom Extension should be placed under `./core/extensions`

View file

@ -6,7 +6,7 @@ Brewing Step
StepController StepController
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
.. autoclass:: core.controller.step_controller.StepController .. autoclass:: cbpi.controller.step_controller.StepController
:members: :members:
:undoc-members: :undoc-members:
@ -16,7 +16,7 @@ StepController
CBPiSimpleStep CBPiSimpleStep
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
.. autoclass:: core.api.step.CBPiSimpleStep .. autoclass:: cbpi.api.CBPiSimpleStep
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
@ -28,15 +28,14 @@ Custom Step
This is an example of a custom step. The Step class need to extend Simple step. In addtion at least the run_cycle method needs to be overwritten This is an example of a custom step. The Step class need to extend Simple step. In addtion at least the run_cycle method needs to be overwritten
.. literalinclude:: ../../core/extension/dummystep/__init__.py .. literalinclude:: ../../cbpi/extension/dummystep/__init__.py
:caption: __init__.py :caption: __init__.py
:name: __init__-py
:language: python :language: python
:linenos: :linenos:
config.yaml config.yaml
.. literalinclude:: ../../core/extension/dummystep/config.yaml .. literalinclude:: ../../cbpi/extension/dummystep/config.yaml
:language: yaml :language: yaml
:linenos: :linenos:

View file

@ -0,0 +1,24 @@
REST API
========
The REST API is document by using Swagger.IO.
After startup of the server the API documentation is available under:
::
http://<SERVER_IP>:<PORT>/api/doc
WebSocket API
=============
WebSocket client can be connected to the following endpoint:
::
http://<SERVER_IP>:<PORT>/ws
I recommend to use Dark WebSocket Terminal for testing. At the moment the WebSocket API is just pushing data.
.. note::
Currently Security is not enabled. That means you need no password to connect to th Web APIs

View file

@ -237,7 +237,7 @@ var Documentation = {
}, },
/** /**
* setup the domain index toggle buttons * init the domain index toggle buttons
*/ */
initIndexTable : function() { initIndexTable : function() {
var togglers = $('img.toggler').click(function() { var togglers = $('img.toggler').click(function() {

View file

@ -93,8 +93,8 @@ var
// Define a local copy of jQuery // Define a local copy of jQuery
jQuery = function( selector, context ) { jQuery = function( selector, context ) {
// The jQuery object is actually just the setup constructor 'enhanced' // The jQuery object is actually just the init constructor 'enhanced'
// Need setup if jQuery is called (just allow error to be thrown if not included) // Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context ); return new jQuery.fn.init( selector, context );
}, },
@ -2965,7 +2965,7 @@ var rootjQuery,
return this; return this;
} }
// Method setup() accepts an alternate rootjQuery // Method init() accepts an alternate rootjQuery
// so migrate can support jQuery.sub (gh-2101) // so migrate can support jQuery.sub (gh-2101)
root = root || rootjQuery; root = root || rootjQuery;
@ -3056,7 +3056,7 @@ var rootjQuery,
return jQuery.makeArray( selector, this ); return jQuery.makeArray( selector, this );
}; };
// Give the setup function the jQuery prototype for later instantiation // Give the init function the jQuery prototype for later instantiation
init.prototype = jQuery.fn; init.prototype = jQuery.fn;
// Initialize central reference // Initialize central reference

View file

@ -92,6 +92,7 @@
<li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li> <li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li>
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
</ul> </ul>
@ -165,13 +166,78 @@
<div class="section" id="actorcontroller"> <div class="section" id="actorcontroller">
<h2>ActorController<a class="headerlink" href="#actorcontroller" title="Permalink to this headline"></a></h2> <h2>ActorController<a class="headerlink" href="#actorcontroller" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.controller.actor_controller.ActorController"> <dt id="cbpi.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> <em class="property">class </em><code class="descclassname">cbpi.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="#cbpi.controller.actor_controller.ActorController" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.controller.actor_controller.ActorHttp</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">core.controller.crud_controller.CRUDController</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.controller.crud_controller.CRUDController</span></code></p>
<p>The main actor controller</p> <p>The main actor controller</p>
<dl class="attribute">
<dt id="cbpi.controller.actor_controller.ActorController._abc_impl">
<code class="descname">_abc_impl</code><em class="property"> = &lt;_abc_data object&gt;</em><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._abc_impl" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.actor_controller.ActorController.init"> <dt id="cbpi.controller.actor_controller.ActorController._init_actor">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.actor_controller.ActorController.init" title="Permalink to this definition"></a></dt> <code class="descname">_init_actor</code><span class="sig-paren">(</span><em>actor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._init_actor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController._post_add_callback">
<code class="descname">_post_add_callback</code><span class="sig-paren">(</span><em>m</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._post_add_callback" title="Permalink to this definition"></a></dt>
<dd><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>m</strong> </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="cbpi.controller.actor_controller.ActorController._post_update_callback">
<code class="descname">_post_update_callback</code><span class="sig-paren">(</span><em>actor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._post_update_callback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController._pre_delete_callback">
<code class="descname">_pre_delete_callback</code><span class="sig-paren">(</span><em>actor_id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._pre_delete_callback" title="Permalink to this definition"></a></dt>
<dd><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>m</strong> </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="cbpi.controller.actor_controller.ActorController._pre_update_callback">
<code class="descname">_pre_update_callback</code><span class="sig-paren">(</span><em>actor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._pre_update_callback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController._stop_actor">
<code class="descname">_stop_actor</code><span class="sig-paren">(</span><em>actor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController._stop_actor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController.call_action">
<code class="descname">call_action</code><span class="sig-paren">(</span><em>actor_id</em>, <em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.call_action" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController.get_state">
<code class="descname">get_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.get_state" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.actor_controller.ActorController.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.init" title="Permalink to this definition"></a></dt>
<dd><p>This method initializes all actors during startup. It creates actor instances</p> <dd><p>This method initializes all actors during startup. It creates actor instances</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -184,14 +250,14 @@
</dd></dl> </dd></dl>
<dl class="attribute"> <dl class="attribute">
<dt id="core.controller.actor_controller.ActorController.model"> <dt id="cbpi.controller.actor_controller.ActorController.model">
<code class="descname">model</code><a class="headerlink" href="#core.controller.actor_controller.ActorController.model" title="Permalink to this definition"></a></dt> <code class="descname">model</code><a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.model" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">core.database.model.ActorModel</span></code></p> <dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.database.model.ActorModel</span></code></p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.actor_controller.ActorController.off"> <dt id="cbpi.controller.actor_controller.ActorController.off">
<code class="descname">off</code><span class="sig-paren">(</span><em>id</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#core.controller.actor_controller.ActorController.off" title="Permalink to this definition"></a></dt> <code class="descname">off</code><span class="sig-paren">(</span><em>actor_id</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.off" title="Permalink to this definition"></a></dt>
<dd><p>Method to switch and actor off <dd><p>Method to switch and actor off
Supporting Event Topic “actor/+/off”</p> Supporting Event Topic “actor/+/off”</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
@ -199,7 +265,7 @@ Supporting Event Topic “actor/+/off”</p>
<col class="field-body" /> <col class="field-body" />
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>id</strong> the actor id</li> <li><strong>actor_id</strong> the actor actor_id</li>
<li><strong>kwargs</strong> </li> <li><strong>kwargs</strong> </li>
</ul> </ul>
</td> </td>
@ -209,36 +275,27 @@ Supporting Event Topic “actor/+/off”</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.actor_controller.ActorController.on"> <dt id="cbpi.controller.actor_controller.ActorController.on">
<code class="descname">on</code><span class="sig-paren">(</span><em>id</em>, <em>power=100</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#core.controller.actor_controller.ActorController.on" title="Permalink to this definition"></a></dt> <code class="descname">on</code><span class="sig-paren">(</span><em>actor_id</em>, <em>future: _asyncio.Future</em>, <em>power=100</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.on" title="Permalink to this definition"></a></dt>
<dd><p>Method to switch an actor on. <dd><p>Method to switch an actor on.
Supporting Event Topic “actor/+/on”</p> Supporting Event Topic “actor/+/on”</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
<col class="field-body" /> <col class="field-body" />
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>actor_id</strong> the actor id</td>
<li><strong>actor_id</strong> the actor id</li>
<li><strong>power</strong> as integer value between 1 and 100</li>
<li><strong>kwargs</strong> </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> </tr>
</tbody> </tbody>
</table> </table>
<p>:param future
:param power: as integer value between 1 and 100
:param kwargs:
:return:</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.actor_controller.ActorController.register"> <dt id="cbpi.controller.actor_controller.ActorController.toggle">
<code class="descname">register</code><span class="sig-paren">(</span><em>name</em>, <em>clazz</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#core.controller.actor_controller.ActorController.register" title="Permalink to this definition"></a></dt> <code class="descname">toggle</code><span class="sig-paren">(</span><em>actor_id</em>, <em>power=100</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cbpi.controller.actor_controller.ActorController.toggle" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="core.controller.actor_controller.ActorController.toggle">
<code class="descname">toggle</code><span class="sig-paren">(</span><em>id</em>, <em>power=100</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#core.controller.actor_controller.ActorController.toggle" title="Permalink to this definition"></a></dt>
<dd><p>Method to toggle an actor on or off <dd><p>Method to toggle an actor on or off
Supporting Event Topic “actor/+/toggle”</p> Supporting Event Topic “actor/+/toggle”</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
@ -246,8 +303,8 @@ Supporting Event Topic “actor/+/toggle”</p>
<col class="field-body" /> <col class="field-body" />
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>id</strong> the actor id</li> <li><strong>actor_id</strong> the actor actor_id</li>
<li><strong>power</strong> the power as interger between 0 and 100</li> <li><strong>power</strong> the power as integer between 0 and 100</li>
</ul> </ul>
</td> </td>
</tr> </tr>
@ -264,12 +321,22 @@ Supporting Event Topic “actor/+/toggle”</p>
<div class="section" id="cbpiactor"> <div class="section" id="cbpiactor">
<h2>CBPiActor<a class="headerlink" href="#cbpiactor" title="Permalink to this headline"></a></h2> <h2>CBPiActor<a class="headerlink" href="#cbpiactor" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.api.actor.CBPiActor"> <dt id="cbpi.api.CBPiActor">
<em class="property">class </em><code class="descclassname">core.api.actor.</code><code class="descname">CBPiActor</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.actor.CBPiActor" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.api.</code><code class="descname">CBPiActor</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.api.extension.CBPiExtension</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.api.extension.CBPiExtension</span></code></p>
<dl class="attribute">
<dt id="cbpi.api.CBPiActor._abc_impl">
<code class="descname">_abc_impl</code><em class="property"> = &lt;_abc_data object&gt;</em><a class="headerlink" href="#cbpi.api.CBPiActor._abc_impl" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.actor.CBPiActor.off"> <dt id="cbpi.api.CBPiActor.init">
<code class="descname">off</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.actor.CBPiActor.off" title="Permalink to this definition"></a></dt> <code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.init" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.api.CBPiActor.off">
<code class="descname">off</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.off" title="Permalink to this definition"></a></dt>
<dd><p>Code to switch the actor off</p> <dd><p>Code to switch the actor off</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -282,8 +349,8 @@ Supporting Event Topic “actor/+/toggle”</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.actor.CBPiActor.on"> <dt id="cbpi.api.CBPiActor.on">
<code class="descname">on</code><span class="sig-paren">(</span><em>power</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.actor.CBPiActor.on" title="Permalink to this definition"></a></dt> <code class="descname">on</code><span class="sig-paren">(</span><em>power</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.on" title="Permalink to this definition"></a></dt>
<dd><p>Code to switch the actor on. Power is provided as integer value</p> <dd><p>Code to switch the actor on. Power is provided as integer value</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -298,8 +365,13 @@ Supporting Event Topic “actor/+/toggle”</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.actor.CBPiActor.state"> <dt id="cbpi.api.CBPiActor.reprJSON">
<code class="descname">state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.actor.CBPiActor.state" title="Permalink to this definition"></a></dt> <code class="descname">reprJSON</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.reprJSON" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.api.CBPiActor.state">
<code class="descname">state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.state" title="Permalink to this definition"></a></dt>
<dd><p>Return the current actor state</p> <dd><p>Return the current actor state</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -311,6 +383,11 @@ Supporting Event Topic “actor/+/toggle”</p>
</table> </table>
</dd></dl> </dd></dl>
<dl class="method">
<dt id="cbpi.api.CBPiActor.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiActor.stop" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl> </dd></dl>
</div> </div>
@ -362,38 +439,148 @@ Supporting Event Topic “actor/+/toggle”</p>
42 42
43 43
44 44
45</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span> 45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100</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">unittest.mock</span> <span class="kn">import</span> <span class="n">MagicMock</span><span class="p">,</span> <span class="n">patch</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="kn">from</span> <span class="nn">cbpi.api</span> <span class="kn">import</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">__name__</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">RPi.GPIO</span> <span class="kn">as</span> <span class="nn">GPIO</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Failed to load RPi.GPIO. Using Mock&quot;</span><span class="p">)</span>
<span class="n">MockRPi</span> <span class="o">=</span> <span class="n">MagicMock</span><span class="p">()</span>
<span class="n">modules</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;RPi&quot;</span><span class="p">:</span> <span class="n">MockRPi</span><span class="p">,</span>
<span class="s2">&quot;RPi.GPIO&quot;</span><span class="p">:</span> <span class="n">MockRPi</span><span class="o">.</span><span class="n">GPIO</span>
<span class="p">}</span>
<span class="n">patcher</span> <span class="o">=</span> <span class="n">patch</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span><span class="s2">&quot;sys.modules&quot;</span><span class="p">,</span> <span class="n">modules</span><span class="p">)</span>
<span class="n">patcher</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">RPi.GPIO</span> <span class="kn">as</span> <span class="nn">GPIO</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="k">class</span> <span class="nc">CustomActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span> <span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</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="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</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">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="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">0</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="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;ACTOR </span><span class="si">%s</span><span class="s2"> ON&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</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="nf">off</span><span class="p">(</span><span class="bp">self</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">gpio</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;ACTOR </span><span class="si">%s</span><span class="s2"> OFF &quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="c1"># Code to swtich the actor off goes here</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="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">gpio</span><span class="p">)</span>
<span class="c1"># Code to swtich the actor on goes here</span>
<span class="k">class</span> <span class="nc">GPIOActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;GPIO&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">15</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">19</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">21</span><span class="p">,</span><span class="mi">22</span><span class="p">,</span><span class="mi">23</span><span class="p">,</span><span class="mi">24</span><span class="p">,</span><span class="mi">25</span><span class="p">,</span><span class="mi">26</span><span class="p">,</span><span class="mi">27</span><span class="p">],</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;GPIO to which the actor is connected&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">CBPiException</span><span class="p">(</span><span class="s2">&quot;FAILD TO INIT ACTOR&quot;</span><span class="p">)</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">0</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;GPIO ON </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</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="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="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;GPIO OFF </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</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">class</span> <span class="nc">GPIORelayBoardActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;GPIO&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">15</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">19</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">21</span><span class="p">,</span><span class="mi">22</span><span class="p">,</span><span class="mi">23</span><span class="p">,</span><span class="mi">24</span><span class="p">,</span><span class="mi">25</span><span class="p">,</span><span class="mi">26</span><span class="p">,</span><span class="mi">27</span><span class="p">],</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;GPIO to which the actor is connected&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">CBPiException</span><span class="p">(</span><span class="s2">&quot;FAILD TO INIT ACTOR&quot;</span><span class="p">)</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">0</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;GPIO ON </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</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="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;GPIO OFF </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</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">setup</span><span class="p">(</span><span class="n">cbpi</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>

View file

@ -86,6 +86,8 @@
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li> <li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html#websocket-api">WebSocket API</a></li>
</ul> </ul>
@ -160,6 +162,7 @@
| <a href="#I"><strong>I</strong></a> | <a href="#I"><strong>I</strong></a>
| <a href="#J"><strong>J</strong></a> | <a href="#J"><strong>J</strong></a>
| <a href="#K"><strong>K</strong></a> | <a href="#K"><strong>K</strong></a>
| <a href="#L"><strong>L</strong></a>
| <a href="#M"><strong>M</strong></a> | <a href="#M"><strong>M</strong></a>
| <a href="#N"><strong>N</strong></a> | <a href="#N"><strong>N</strong></a>
| <a href="#O"><strong>O</strong></a> | <a href="#O"><strong>O</strong></a>
@ -172,7 +175,47 @@
<h2 id="_">_</h2> <h2 id="_">_</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController._is_logic_running">_is_logic_running() (core.controller.kettle_controller.KettleController method)</a> <li><a href="actor.html#cbpi.api.CBPiActor._abc_impl">_abc_impl (cbpi.api.CBPiActor attribute)</a>
<ul>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._abc_impl">(cbpi.controller.actor_controller.ActorController attribute)</a>
</li>
<li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController._abc_impl">(cbpi.controller.kettle_controller.KettleController attribute)</a>
</li>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController._abc_impl">(cbpi.controller.sensor_controller.SensorController attribute)</a>
</li>
</ul></li>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._init_actor">_init_actor() (cbpi.controller.actor_controller.ActorController method)</a>
</li>
<li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController._is_logic_running">_is_logic_running() (cbpi.controller.kettle_controller.KettleController method)</a>
</li>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._post_add_callback">_post_add_callback() (cbpi.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController._post_add_callback">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._post_update_callback">_post_update_callback() (cbpi.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController._post_update_callback">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></li>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._pre_delete_callback">_pre_delete_callback() (cbpi.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController._pre_delete_callback">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></li>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._pre_update_callback">_pre_update_callback() (cbpi.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController._pre_update_callback">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></li>
<li><a href="actor.html#cbpi.controller.actor_controller.ActorController._stop_actor">_stop_actor() (cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -180,13 +223,13 @@
<h2 id="A">A</h2> <h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController">ActorController (class in core.controller.actor_controller)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController">ActorController (class in cbpi.controller.actor_controller)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.agitator_off">agitator_off() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.agitator_off">agitator_off() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.agitator_on">agitator_on() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.agitator_on">agitator_on() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -194,15 +237,17 @@
<h2 id="C">C</h2> <h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.api.actor.CBPiActor">CBPiActor (class in core.api.actor)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.call_action">call_action() (cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.api.kettle_logic.CBPiKettleLogic">CBPiKettleLogic (class in core.api.kettle_logic)</a> <li><a href="actor.html#cbpi.api.CBPiActor">CBPiActor (class in cbpi.api)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="sensor.html#core.api.sensor.CBPiSensor">CBPiSensor (class in core.api.sensor)</a> <li><a href="kettle_controller.html#cbpi.api.CBPiKettleLogic">CBPiKettleLogic (class in cbpi.api)</a>
</li> </li>
<li><a href="step.html#core.api.step.CBPiSimpleStep">CBPiSimpleStep (class in core.api.step)</a> <li><a href="sensor.html#cbpi.api.CBPiSensor">CBPiSensor (class in cbpi.api)</a>
</li>
<li><a href="step.html#cbpi.api.CBPiSimpleStep">CBPiSimpleStep (class in cbpi.api)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -210,13 +255,21 @@
<h2 id="G">G</h2> <h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.get_temp">get_temp() (core.controller.kettle_controller.KettleController method)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.get_state">get_state() (cbpi.controller.actor_controller.ActorController method)</a>
<ul>
<li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.get_state">(cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.get_state">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.get_traget_temp">get_traget_temp() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.get_temp">get_temp() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
<li><a href="sensor.html#core.controller.sensor_controller.SensorController.get_value">get_value() (core.controller.sensor_controller.SensorController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.get_traget_temp">get_traget_temp() (cbpi.controller.kettle_controller.KettleController method)</a>
</li>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.get_value">get_value() (cbpi.controller.sensor_controller.SensorController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -224,33 +277,17 @@
<h2 id="H">H</h2> <h2 id="H">H</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.controller.step_controller.StepController.handle_action">handle_action() (core.controller.step_controller.StepController method)</a> <li><a href="step.html#cbpi.controller.step_controller.StepController.handle_action">handle_action() (cbpi.controller.step_controller.StepController method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.handle_automtic_event">handle_automtic_event() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.handle_automtic_event">handle_automtic_event() (cbpi.controller.kettle_controller.KettleController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.handle_done">handle_done() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.handle_next">next() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.handle_reset">handle_reset() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.handle_start">handle_start() (core.controller.step_controller.StepController method)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.controller.step_controller.StepController.handle_stop">handle_stop() (core.controller.step_controller.StepController method)</a> <li><a href="step.html#cbpi.controller.step_controller.StepController.handle_reset">handle_reset() (cbpi.controller.step_controller.StepController method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.heater_off">heater_off() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.heater_off">heater_off() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.heater_on">heater_on() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.heater_on">heater_on() (cbpi.controller.kettle_controller.KettleController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.http_action">http_action() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.http_next">http_next() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.http_reset">http_reset() (core.controller.step_controller.StepController method)</a>
</li>
<li><a href="step.html#core.controller.step_controller.StepController.http_start">http_start() (core.controller.step_controller.StepController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -258,21 +295,27 @@
<h2 id="I">I</h2> <h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.api.kettle_logic.CBPiKettleLogic.init">setup() (core.api.kettle_logic.CBPiKettleLogic method)</a> <li><a href="actor.html#cbpi.api.CBPiActor.init">init() (cbpi.api.CBPiActor method)</a>
<ul> <ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController.init">(core.controller.actor_controller.ActorController method)</a> <li><a href="kettle_controller.html#cbpi.api.CBPiKettleLogic.init">(cbpi.api.CBPiKettleLogic method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.init">(core.controller.kettle_controller.KettleController method)</a> <li><a href="sensor.html#cbpi.api.CBPiSensor.init">(cbpi.api.CBPiSensor method)</a>
</li> </li>
<li><a href="sensor.html#core.controller.sensor_controller.SensorController.init">(core.controller.sensor_controller.SensorController method)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.init">(cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
<li><a href="step.html#core.controller.step_controller.StepController.init">(core.controller.step_controller.StepController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.init">(cbpi.controller.kettle_controller.KettleController method)</a>
</li>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.init">(cbpi.controller.sensor_controller.SensorController method)</a>
</li>
<li><a href="step.html#cbpi.controller.step_controller.StepController.init">(cbpi.controller.step_controller.StepController method)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.api.step.CBPiSimpleStep.is_dirty">is_dirty() (core.api.step.CBPiSimpleStep method)</a> <li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.init_sensor">init_sensor() (cbpi.controller.sensor_controller.SensorController method)</a>
</li>
<li><a href="step.html#cbpi.api.CBPiSimpleStep.is_dirty">is_dirty() (cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -280,7 +323,7 @@
<h2 id="J">J</h2> <h2 id="J">J</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.job_stop">job_stop() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.job_stop">job_stop() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -288,7 +331,15 @@
<h2 id="K">K</h2> <h2 id="K">K</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController">KettleController (class in core.controller.kettle_controller)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController">KettleController (class in cbpi.controller.kettle_controller)</a>
</li>
</ul></td>
</tr></table>
<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="sensor.html#cbpi.api.CBPiSensor.log_data">log_data() (cbpi.api.CBPiSensor method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -296,14 +347,14 @@
<h2 id="M">M</h2> <h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.api.step.CBPiSimpleStep.managed_fields">managed_fields (core.api.step.CBPiSimpleStep attribute)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.managed_fields">managed_fields (cbpi.api.CBPiSimpleStep attribute)</a>
</li> </li>
<li><a href="actor.html#core.controller.actor_controller.ActorController.model">model (core.controller.actor_controller.ActorController attribute)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.model">model (cbpi.controller.actor_controller.ActorController attribute)</a>
<ul> <ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.model">(core.controller.kettle_controller.KettleController attribute)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.model">(cbpi.controller.kettle_controller.KettleController attribute)</a>
</li> </li>
<li><a href="sensor.html#core.controller.sensor_controller.SensorController.model">(core.controller.sensor_controller.SensorController attribute)</a> <li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.model">(cbpi.controller.sensor_controller.SensorController attribute)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
@ -312,26 +363,30 @@
<h2 id="N">N</h2> <h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.api.step.CBPiSimpleStep.next">next() (core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.next">next() (cbpi.api.CBPiSimpleStep method)</a>
<ul>
<li><a href="step.html#cbpi.controller.step_controller.StepController.next">(cbpi.controller.step_controller.StepController method)</a>
</li> </li>
</ul></li>
</ul></td> </ul></td>
</tr></table> </tr></table>
<h2 id="O">O</h2> <h2 id="O">O</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.api.actor.CBPiActor.off">off() (core.api.actor.CBPiActor method)</a> <li><a href="actor.html#cbpi.api.CBPiActor.off">off() (cbpi.api.CBPiActor method)</a>
<ul> <ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController.off">(core.controller.actor_controller.ActorController method)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.off">(cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.api.actor.CBPiActor.on">on() (core.api.actor.CBPiActor method)</a> <li><a href="actor.html#cbpi.api.CBPiActor.on">on() (cbpi.api.CBPiActor method)</a>
<ul> <ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController.on">(core.controller.actor_controller.ActorController method)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.on">(cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
@ -340,21 +395,21 @@
<h2 id="P">P</h2> <h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="properties.html#core.api.property.Property">Property (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property">Property (class in cbpi.api)</a>
</li> </li>
<li><a href="properties.html#core.api.property.Property.Actor">Property.Actor (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Actor">Property.Actor (class in cbpi.api)</a>
</li> </li>
<li><a href="properties.html#core.api.property.Property.Kettle">Property.Kettle (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Kettle">Property.Kettle (class in cbpi.api)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="properties.html#core.api.property.Property.Number">Property.Number (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Number">Property.Number (class in cbpi.api)</a>
</li> </li>
<li><a href="properties.html#core.api.property.Property.Select">Property.Select (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Select">Property.Select (class in cbpi.api)</a>
</li> </li>
<li><a href="properties.html#core.api.property.Property.Sensor">Property.Sensor (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Sensor">Property.Sensor (class in cbpi.api)</a>
</li> </li>
<li><a href="properties.html#core.api.property.Property.Text">Property.Text (class in core.api.property)</a> <li><a href="properties.html#cbpi.api.Property.Text">Property.Text (class in cbpi.api)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -362,25 +417,25 @@
<h2 id="R">R</h2> <h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <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> <li><a href="actor.html#cbpi.api.CBPiActor.reprJSON">reprJSON() (cbpi.api.CBPiActor method)</a>
</li> </li>
<li><a href="step.html#core.api.step.CBPiSimpleStep.reset">reset() (core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.reset">reset() (cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
<li><a href="step.html#core.api.step.CBPiSimpleStep.reset_dirty">reset_dirty() (core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.reset_dirty">reset_dirty() (cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
<li><a href="kettle_controller.html#core.api.kettle_logic.CBPiKettleLogic.run">run() (core.api.kettle_logic.CBPiKettleLogic method)</a> <li><a href="kettle_controller.html#cbpi.api.CBPiKettleLogic.run">run() (cbpi.api.CBPiKettleLogic method)</a>
<ul> <ul>
<li><a href="sensor.html#core.api.sensor.CBPiSensor.run">(core.api.sensor.CBPiSensor method)</a> <li><a href="sensor.html#cbpi.api.CBPiSensor.run">(cbpi.api.CBPiSensor method)</a>
</li> </li>
<li><a href="step.html#core.api.step.CBPiSimpleStep.run">(core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.run">(cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.api.step.CBPiSimpleStep.run_cycle">run_cycle() (core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.run_cycle">run_cycle() (cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
<li><a href="step.html#core.api.step.CBPiSimpleStep.running">running() (core.api.step.CBPiSimpleStep method)</a> <li><a href="step.html#cbpi.api.CBPiSimpleStep.running">running() (cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -388,37 +443,41 @@
<h2 id="S">S</h2> <h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="sensor.html#core.controller.sensor_controller.SensorController">SensorController (class in core.controller.sensor_controller)</a> <li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController">SensorController (class in cbpi.controller.sensor_controller)</a>
</li> </li>
<li><a href="step.html#core.controller.step_controller.StepController.start">start() (core.controller.step_controller.StepController method)</a> <li><a href="step.html#cbpi.controller.step_controller.StepController.start">start() (cbpi.controller.step_controller.StepController method)</a>
</li> </li>
<li><a href="actor.html#core.api.actor.CBPiActor.state">state() (core.api.actor.CBPiActor method)</a> <li><a href="actor.html#cbpi.api.CBPiActor.state">state() (cbpi.api.CBPiActor method)</a>
<ul> <ul>
<li><a href="sensor.html#core.api.sensor.CBPiSensor.state">(core.api.sensor.CBPiSensor method)</a> <li><a href="sensor.html#cbpi.api.CBPiSensor.state">(cbpi.api.CBPiSensor method)</a>
</li> </li>
</ul></li> </ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="step.html#core.controller.step_controller.StepController">StepController (class in core.controller.step_controller)</a> <li><a href="step.html#cbpi.controller.step_controller.StepController">StepController (class in cbpi.controller.step_controller)</a>
</li> </li>
<li><a href="kettle_controller.html#core.api.kettle_logic.CBPiKettleLogic.stop">stop() (core.api.kettle_logic.CBPiKettleLogic method)</a> <li><a href="actor.html#cbpi.api.CBPiActor.stop">stop() (cbpi.api.CBPiActor method)</a>
<ul> <ul>
<li><a href="step.html#core.api.step.CBPiSimpleStep.stop">(core.api.step.CBPiSimpleStep method)</a> <li><a href="kettle_controller.html#cbpi.api.CBPiKettleLogic.stop">(cbpi.api.CBPiKettleLogic method)</a>
</li>
<li><a href="step.html#cbpi.api.CBPiSimpleStep.stop">(cbpi.api.CBPiSimpleStep method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="sensor.html#cbpi.controller.sensor_controller.SensorController.stop_sensor">stop_sensor() (cbpi.controller.sensor_controller.SensorController method)</a>
</li>
</ul></td> </ul></td>
</tr></table> </tr></table>
<h2 id="T">T</h2> <h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="actor.html#core.controller.actor_controller.ActorController.toggle">toggle() (core.controller.actor_controller.ActorController method)</a> <li><a href="actor.html#cbpi.controller.actor_controller.ActorController.toggle">toggle() (cbpi.controller.actor_controller.ActorController method)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="kettle_controller.html#core.controller.kettle_controller.KettleController.toggle_automtic">toggle_automtic() (core.controller.kettle_controller.KettleController method)</a> <li><a href="kettle_controller.html#cbpi.controller.kettle_controller.KettleController.toggle_automtic">toggle_automtic() (cbpi.controller.kettle_controller.KettleController method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>

View file

@ -86,6 +86,8 @@
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li> <li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html#websocket-api">WebSocket API</a></li>
</ul> </ul>
@ -154,7 +156,13 @@
<h1>Welcome to CraftBeerPis documentation!<a class="headerlink" href="#welcome-to-craftbeerpi-s-documentation" title="Permalink to this headline"></a></h1> <h1>Welcome to CraftBeerPis documentation!<a class="headerlink" href="#welcome-to-craftbeerpi-s-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound"> <div class="toctree-wrapper compound">
<ul> <ul>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="install.html#download-and-installation">Download and Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#run-the-server">Run the Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#update-craftbeerpi">Update CraftBeerPi</a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#install-plugins">Install plugins</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="core.html">Core</a></li> <li class="toctree-l1"><a class="reference internal" href="core.html">Core</a></li>
<li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a><ul> <li class="toctree-l1"><a class="reference internal" href="actor.html">Actor</a><ul>
<li class="toctree-l2"><a class="reference internal" href="actor.html#architecture">Architecture</a></li> <li class="toctree-l2"><a class="reference internal" href="actor.html#architecture">Architecture</a></li>
@ -187,15 +195,19 @@
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a><ul> <li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="standards.html#python">Python</a><ul> <li class="toctree-l2"><a class="reference internal" href="standards.html#python">Python</a><ul>
<li class="toctree-l3"><a class="reference internal" href="standards.html#eventbus">CBPiEventBus</a></li> <li class="toctree-l3"><a class="reference internal" href="standards.html#cbpieventbus">CBPiEventBus</a></li>
<li class="toctree-l3"><a class="reference internal" href="standards.html#http-endpoints">HTTP Endpoints</a></li> <li class="toctree-l3"><a class="reference internal" href="standards.html#http-endpoints">HTTP Endpoints</a></li>
<li class="toctree-l3"><a class="reference internal" href="standards.html#websocket">CBPiWebSocket</a></li> <li class="toctree-l3"><a class="reference internal" href="standards.html#cbpiwebsocket">CBPiWebSocket</a></li>
<li class="toctree-l3"><a class="reference internal" href="standards.html#sql-files">SQL Files</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="standards.html#web-user-interface">Web User Interface</a></li> <li class="toctree-l2"><a class="reference internal" href="standards.html#web-user-interface">Web User Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="standards.html#rest-api">REST API</a></li> <li class="toctree-l2"><a class="reference internal" href="standards.html#rest-api">REST API</a></li>
<li class="toctree-l2"><a class="reference internal" href="standards.html#custom-extensions-pluins">Custom Extensions &amp; Pluins</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html#websocket-api">WebSocket API</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -79,13 +79,22 @@
<ul class="current"> <ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Installation</a></li> <li class="toctree-l1 current"><a class="current reference internal" href="#">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#download-and-installation">Download and Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-the-server">Run the Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="#update-craftbeerpi">Update CraftBeerPi</a></li>
<li class="toctree-l2"><a class="reference internal" href="#install-plugins">Install plugins</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="core.html">Core</a></li> <li class="toctree-l1"><a class="reference internal" href="core.html">Core</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="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="sensor.html">Sensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li> <li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li>
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html#websocket-api">WebSocket API</a></li>
</ul> </ul>
@ -152,14 +161,52 @@
<div class="section" id="installation"> <div class="section" id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h1> <h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h1>
<p>Please make sure that Python 3.6 is installed</p> <p>Please make sure that Python 3.5 is installed.
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">manuel83</span><span class="o">/</span><span class="n">craftbeerpi4</span> <a class="reference external" href="https://www.raspberrypi.org/downloads/raspbian//">Rapsbian Stretch</a> is required at least.
It will also run on MacOS</p>
<span class="n">cd</span> <span class="n">craftbeerpi4</span> <div class="section" id="download-and-installation">
<h2>Download and Installation<a class="headerlink" href="#download-and-installation" title="Permalink to this headline"></a></h2>
<span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">r</span> <span class="n">requirements</span><span class="o">.</span><span class="n">txt</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo pip install -i https://test.pypi.org/simple/ cbpi
</pre></div> </pre></div>
</div> </div>
<p>Further version can be found on PiPy: <a class="reference external" href="https://test.pypi.org/project/cbpi/">https://test.pypi.org/project/cbpi/</a></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All dependencies will be installed automatically. The installation will add the command “cbpi” to your shell.</p>
</div>
<p>To uninstall just remove the package via pip.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo pip uninstall cbpi
</pre></div>
</div>
</div>
<div class="section" id="run-the-server">
<h2>Run the Server<a class="headerlink" href="#run-the-server" title="Permalink to this headline"></a></h2>
<p>To start CraftBeerPi just run the following command in your shell</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cbpi
</pre></div>
</div>
<p>During the first startup a <cite>config</cite> and <cite>logs</cite> folder gets created in the directory from where the <cite>$ cbpi</cite> in called
PIP Website: <a class="reference external" href="https://test.pypi.org/project/cbpi/">https://test.pypi.org/project/cbpi/</a></p>
</div>
<div class="section" id="update-craftbeerpi">
<h2>Update CraftBeerPi<a class="headerlink" href="#update-craftbeerpi" title="Permalink to this headline"></a></h2>
<p>Thats super easy. Just run again with upgrade option</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo pip install -i https://test.pypi.org/simple/ cbpi --upgrade
</pre></div>
</div>
</div>
<div class="section" id="install-plugins">
<h2>Install plugins<a class="headerlink" href="#install-plugins" title="Permalink to this headline"></a></h2>
<p>Plugins are normal Python Pip packages.</p>
<p>Install</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo pip install -i https://test.pypi.org/simple/ CBPiActor1
</pre></div>
</div>
<p>Uninstall</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ pip uninstall CBPiActor1
</pre></div>
</div>
</div>
</div> </div>

View file

@ -91,6 +91,7 @@
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
</ul> </ul>
@ -160,38 +161,48 @@
<div class="section" id="kettlecontroller"> <div class="section" id="kettlecontroller">
<h2>KettleController<a class="headerlink" href="#kettlecontroller" title="Permalink to this headline"></a></h2> <h2>KettleController<a class="headerlink" href="#kettlecontroller" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.controller.kettle_controller.KettleController"> <dt id="cbpi.controller.kettle_controller.KettleController">
<em class="property">class </em><code class="descclassname">core.controller.kettle_controller.</code><code class="descname">KettleController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.controller.kettle_controller.</code><code class="descname">KettleController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.controller.crud_controller.CRUDController</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.controller.crud_controller.CRUDController</span></code></p>
<p>The main kettle controller</p> <p>The main kettle controller</p>
<dl class="method"> <dl class="attribute">
<dt id="core.controller.kettle_controller.KettleController._is_logic_running"> <dt id="cbpi.controller.kettle_controller.KettleController._abc_impl">
<code class="descname">_is_logic_running</code><span class="sig-paren">(</span><em>kettle_id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController._is_logic_running" title="Permalink to this definition"></a></dt> <code class="descname">_abc_impl</code><em class="property"> = &lt;_abc_data object&gt;</em><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController._abc_impl" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.agitator_off"> <dt id="cbpi.controller.kettle_controller.KettleController._is_logic_running">
<code class="descname">agitator_off</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.agitator_off" title="Permalink to this definition"></a></dt> <code class="descname">_is_logic_running</code><span class="sig-paren">(</span><em>kettle_id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController._is_logic_running" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.agitator_on"> <dt id="cbpi.controller.kettle_controller.KettleController.agitator_off">
<code class="descname">agitator_on</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.agitator_on" title="Permalink to this definition"></a></dt> <code class="descname">agitator_off</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.agitator_off" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.get_temp"> <dt id="cbpi.controller.kettle_controller.KettleController.agitator_on">
<code class="descname">get_temp</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.get_temp" title="Permalink to this definition"></a></dt> <code class="descname">agitator_on</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.agitator_on" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.get_traget_temp"> <dt id="cbpi.controller.kettle_controller.KettleController.get_state">
<code class="descname">get_traget_temp</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.get_traget_temp" title="Permalink to this definition"></a></dt> <code class="descname">get_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.get_state" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.handle_automtic_event"> <dt id="cbpi.controller.kettle_controller.KettleController.get_temp">
<code class="descname">handle_automtic_event</code><span class="sig-paren">(</span><em>id</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.handle_automtic_event" title="Permalink to this definition"></a></dt> <code class="descname">get_temp</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.get_temp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.kettle_controller.KettleController.get_traget_temp">
<code class="descname">get_traget_temp</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.get_traget_temp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.kettle_controller.KettleController.handle_automtic_event">
<code class="descname">handle_automtic_event</code><span class="sig-paren">(</span><em>id</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.handle_automtic_event" title="Permalink to this definition"></a></dt>
<dd><p>Method to handle the event kettle/+/automatic</p> <dd><p>Method to handle the event kettle/+/automatic</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -211,8 +222,8 @@
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.heater_off"> <dt id="cbpi.controller.kettle_controller.KettleController.heater_off">
<code class="descname">heater_off</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.heater_off" title="Permalink to this definition"></a></dt> <code class="descname">heater_off</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.heater_off" title="Permalink to this definition"></a></dt>
<dd><p>Convenience Method to switch the heater of a kettle off</p> <dd><p>Convenience Method to switch the heater of a kettle off</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -227,8 +238,8 @@
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.heater_on"> <dt id="cbpi.controller.kettle_controller.KettleController.heater_on">
<code class="descname">heater_on</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.heater_on" title="Permalink to this definition"></a></dt> <code class="descname">heater_on</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.heater_on" title="Permalink to this definition"></a></dt>
<dd><p>Convenience Method to switch the heater of a kettle on</p> <dd><p>Convenience Method to switch the heater of a kettle on</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -243,8 +254,8 @@
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.init"> <dt id="cbpi.controller.kettle_controller.KettleController.init">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.init" title="Permalink to this definition"></a></dt> <code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.init" title="Permalink to this definition"></a></dt>
<dd><p>This method initializes all actors during startup. It creates actor instances</p> <dd><p>This method initializes all actors during startup. It creates actor instances</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -257,19 +268,19 @@
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.job_stop"> <dt id="cbpi.controller.kettle_controller.KettleController.job_stop">
<code class="descname">job_stop</code><span class="sig-paren">(</span><em>key</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#core.controller.kettle_controller.KettleController.job_stop" title="Permalink to this definition"></a></dt> <code class="descname">job_stop</code><span class="sig-paren">(</span><em>key</em>, <em>**kwargs</em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.job_stop" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="attribute"> <dl class="attribute">
<dt id="core.controller.kettle_controller.KettleController.model"> <dt id="cbpi.controller.kettle_controller.KettleController.model">
<code class="descname">model</code><a class="headerlink" href="#core.controller.kettle_controller.KettleController.model" title="Permalink to this definition"></a></dt> <code class="descname">model</code><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.model" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">core.database.model.KettleModel</span></code></p> <dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.database.model.KettleModel</span></code></p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.kettle_controller.KettleController.toggle_automtic"> <dt id="cbpi.controller.kettle_controller.KettleController.toggle_automtic">
<code class="descname">toggle_automtic</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.kettle_controller.KettleController.toggle_automtic" title="Permalink to this definition"></a></dt> <code class="descname">toggle_automtic</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.kettle_controller.KettleController.toggle_automtic" title="Permalink to this definition"></a></dt>
<dd><p>Convenience Method to toggle automatic</p> <dd><p>Convenience Method to toggle automatic</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -289,13 +300,13 @@
<div class="section" id="cbpikettlelogic"> <div class="section" id="cbpikettlelogic">
<h2>CBPiKettleLogic<a class="headerlink" href="#cbpikettlelogic" title="Permalink to this headline"></a></h2> <h2>CBPiKettleLogic<a class="headerlink" href="#cbpikettlelogic" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.api.kettle_logic.CBPiKettleLogic"> <dt id="cbpi.api.CBPiKettleLogic">
<em class="property">class </em><code class="descclassname">core.api.kettle_logic.</code><code class="descname">CBPiKettleLogic</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.kettle_logic.CBPiKettleLogic" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.api.</code><code class="descname">CBPiKettleLogic</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiKettleLogic" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.api.extension.CBPiExtension</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.api.extension.CBPiExtension</span></code></p>
<p>Base Class for a Kettle logic.</p> <p>Base Class for a Kettle logic.</p>
<dl class="method"> <dl class="method">
<dt id="core.api.kettle_logic.CBPiKettleLogic.init"> <dt id="cbpi.api.CBPiKettleLogic.init">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.kettle_logic.CBPiKettleLogic.init" title="Permalink to this definition"></a></dt> <code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiKettleLogic.init" title="Permalink to this definition"></a></dt>
<dd><p>Code which will be executed when the logic is initialised. Needs to be overwritten by the implementing logic</p> <dd><p>Code which will be executed when the logic is initialised. Needs to be overwritten by the implementing logic</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -308,8 +319,8 @@
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.kettle_logic.CBPiKettleLogic.run"> <dt id="cbpi.api.CBPiKettleLogic.run">
<code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.kettle_logic.CBPiKettleLogic.run" title="Permalink to this definition"></a></dt> <code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiKettleLogic.run" title="Permalink to this definition"></a></dt>
<dd><p>This method is running as background process when logic is started. <dd><p>This method is running as background process when logic is started.
Typically a while loop responsible that the method keeps running</p> Typically a while loop responsible that the method keeps running</p>
<blockquote> <blockquote>
@ -329,8 +340,8 @@ Typically a while loop responsible that the method keeps running</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.kettle_logic.CBPiKettleLogic.stop"> <dt id="cbpi.api.CBPiKettleLogic.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.kettle_logic.CBPiKettleLogic.stop" title="Permalink to this definition"></a></dt> <code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiKettleLogic.stop" title="Permalink to this definition"></a></dt>
<dd><p>Code which will be executed when the logic is stopped. Needs to be overwritten by the implementing logic</p> <dd><p>Code which will be executed when the logic is stopped. Needs to be overwritten by the implementing logic</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -429,13 +440,9 @@ Typically a while loop responsible that the method keeps running</p>
78 78
79 79
80 80
81 81</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
82
83</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">from</span> <span class="nn">core.api</span> <span class="kn">import</span> <span class="n">Property</span><span class="p">,</span> <span class="n">on_event</span>
<span class="kn">from</span> <span class="nn">core.api.kettle_logic</span> <span class="kn">import</span> <span class="n">CBPiKettleLogic</span>
<span class="kn">from</span> <span class="nn">cbpi.api</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">class</span> <span class="nc">CustomLogic</span><span class="p">(</span><span class="n">CBPiKettleLogic</span><span class="p">):</span> <span class="k">class</span> <span class="nc">CustomLogic</span><span class="p">(</span><span class="n">CBPiKettleLogic</span><span class="p">):</span>
@ -462,14 +469,14 @@ Typically a while loop responsible that the method keeps running</p>
<span class="k">if</span> <span class="n">timeout</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span> <span class="k">if</span> <span class="n">timeout</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;----&gt; WAIT FOR FUTURE&quot;</span><span class="p">)</span>
<span class="n">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">wait_for</span><span class="p">(</span><span class="n">future_obj</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">timeout</span><span class="p">)</span> <span class="n">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">wait_for</span><span class="p">(</span><span class="n">future_obj</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">timeout</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;------&gt; TIMEOUT&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">future_obj</span><span class="o">.</span><span class="n">result</span><span class="p">()</span> <span class="k">return</span> <span class="n">future_obj</span><span class="o">.</span><span class="n">result</span><span class="p">()</span>
<span class="k">except</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">TimeoutError</span><span class="p">:</span> <span class="k">except</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">TimeoutError</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s1">&#39;timeout!&#39;</span><span class="p">)</span> <span class="k">pass</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;----&gt; WAIT FOR FUTURE&quot;</span><span class="p">)</span>
<span class="n">await</span> <span class="n">future_obj</span> <span class="n">await</span> <span class="n">future_obj</span>
<span class="k">return</span> <span class="n">future_obj</span><span class="o">.</span><span class="n">result</span><span class="p">()</span> <span class="k">return</span> <span class="n">future_obj</span><span class="o">.</span><span class="n">result</span><span class="p">()</span>
@ -484,10 +491,10 @@ Typically a while loop responsible that the method keeps running</p>
<span class="bp">self</span><span class="o">.</span><span class="n">cbpi</span><span class="o">.</span><span class="n">bus</span><span class="o">.</span><span class="n">unregister</span><span class="p">(</span><span class="n">my_callback</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">bus</span><span class="o">.</span><span class="n">unregister</span><span class="p">(</span><span class="n">my_callback</span><span class="p">)</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;future&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">set_result</span><span class="p">(</span><span class="s2">&quot;AMAZING&quot;</span><span class="p">)</span> <span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;future&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">set_result</span><span class="p">(</span><span class="s2">&quot;AMAZING&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;OTHER VALUE&quot;</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="k">pass</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_event</span><span class="p">(</span><span class="s2">&quot;sensor/1&quot;</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">my_callback</span><span class="p">)</span> <span class="n">result</span> <span class="o">=</span> <span class="n">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_event</span><span class="p">(</span><span class="s2">&quot;sensor/1&quot;</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">my_callback</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;THE RESULT&quot;</span><span class="p">,</span> <span class="n">result</span><span class="p">)</span>
<span class="sd">&#39;&#39;&#39;</span> <span class="sd">&#39;&#39;&#39;</span>
@ -501,7 +508,7 @@ Typically a while loop responsible that the method keeps running</p>
<span class="sd"> break</span> <span class="sd"> break</span>
<span class="sd"> await asyncio.sleep(1)</span> <span class="sd"> await asyncio.sleep(1)</span>
<span class="sd"> &#39;&#39;&#39;</span> <span class="sd"> &#39;&#39;&#39;</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;YES IM FINISHED STOP LOGIC&quot;</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="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">cbpi</span><span class="p">):</span>

Binary file not shown.

View file

@ -28,6 +28,7 @@
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" /> <link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="next" title="Standard &amp; Guidelines" href="standards.html" />
<link rel="prev" title="Kettle" href="kettle_controller.html" /> <link rel="prev" title="Kettle" href="kettle_controller.html" />
@ -88,6 +89,7 @@
<li class="toctree-l2"><a class="reference internal" href="#custom-actor">Custom Actor</a></li> <li class="toctree-l2"><a class="reference internal" href="#custom-actor">Custom Actor</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
</ul> </ul>
@ -207,38 +209,148 @@ For example the user can set the GPIO number or the 1Wire Id.</p>
42 42
43 43
44 44
45</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span> 45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100</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">unittest.mock</span> <span class="kn">import</span> <span class="n">MagicMock</span><span class="p">,</span> <span class="n">patch</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="kn">from</span> <span class="nn">cbpi.api</span> <span class="kn">import</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">__name__</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">RPi.GPIO</span> <span class="kn">as</span> <span class="nn">GPIO</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Failed to load RPi.GPIO. Using Mock&quot;</span><span class="p">)</span>
<span class="n">MockRPi</span> <span class="o">=</span> <span class="n">MagicMock</span><span class="p">()</span>
<span class="n">modules</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;RPi&quot;</span><span class="p">:</span> <span class="n">MockRPi</span><span class="p">,</span>
<span class="s2">&quot;RPi.GPIO&quot;</span><span class="p">:</span> <span class="n">MockRPi</span><span class="o">.</span><span class="n">GPIO</span>
<span class="p">}</span>
<span class="n">patcher</span> <span class="o">=</span> <span class="n">patch</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span><span class="s2">&quot;sys.modules&quot;</span><span class="p">,</span> <span class="n">modules</span><span class="p">)</span>
<span class="n">patcher</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">RPi.GPIO</span> <span class="kn">as</span> <span class="nn">GPIO</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="k">class</span> <span class="nc">CustomActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span> <span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</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="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</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">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="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">0</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="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;ACTOR </span><span class="si">%s</span><span class="s2"> ON&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</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="nf">off</span><span class="p">(</span><span class="bp">self</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">gpio</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;ACTOR </span><span class="si">%s</span><span class="s2"> OFF &quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="c1"># Code to swtich the actor off goes here</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="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">gpio</span><span class="p">)</span>
<span class="c1"># Code to swtich the actor on goes here</span>
<span class="k">class</span> <span class="nc">GPIOActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;GPIO&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">15</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">19</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">21</span><span class="p">,</span><span class="mi">22</span><span class="p">,</span><span class="mi">23</span><span class="p">,</span><span class="mi">24</span><span class="p">,</span><span class="mi">25</span><span class="p">,</span><span class="mi">26</span><span class="p">,</span><span class="mi">27</span><span class="p">],</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;GPIO to which the actor is connected&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">CBPiException</span><span class="p">(</span><span class="s2">&quot;FAILD TO INIT ACTOR&quot;</span><span class="p">)</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">0</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;GPIO ON </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</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="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="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;GPIO OFF </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</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">class</span> <span class="nc">GPIORelayBoardActor</span><span class="p">(</span><span class="n">CBPiActor</span><span class="p">):</span>
<span class="c1"># Custom property which can be configured by the user</span>
<span class="n">gpio</span> <span class="o">=</span> <span class="n">Property</span><span class="o">.</span><span class="n">Select</span><span class="p">(</span><span class="s2">&quot;GPIO&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="mi">13</span><span class="p">,</span><span class="mi">14</span><span class="p">,</span><span class="mi">15</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">17</span><span class="p">,</span><span class="mi">18</span><span class="p">,</span><span class="mi">19</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">21</span><span class="p">,</span><span class="mi">22</span><span class="p">,</span><span class="mi">23</span><span class="p">,</span><span class="mi">24</span><span class="p">,</span><span class="mi">25</span><span class="p">,</span><span class="mi">26</span><span class="p">,</span><span class="mi">27</span><span class="p">],</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;GPIO to which the actor is connected&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">OUT</span><span class="p">)</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">CBPiException</span><span class="p">(</span><span class="s2">&quot;FAILD TO INIT ACTOR&quot;</span><span class="p">)</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">0</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;GPIO ON </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">0</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="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;GPIO OFF </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">))</span>
<span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gpio</span><span class="p">),</span> <span class="mi">1</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">setup</span><span class="p">(</span><span class="n">cbpi</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>
@ -256,41 +368,41 @@ For example the user can set the GPIO number or the 1Wire Id.</p>
</td></tr></table></div> </td></tr></table></div>
</div> </div>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property"> <dt id="cbpi.api.Property">
<em class="property">class </em><code class="descclassname">core.api.property.</code><code class="descname">Property</code><a class="headerlink" href="#core.api.property.Property" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.api.</code><code class="descname">Property</code><a class="headerlink" href="#cbpi.api.Property" title="Permalink to this definition"></a></dt>
<dd><dl class="class"> <dd><dl class="class">
<dt id="core.api.property.Property.Actor"> <dt id="cbpi.api.Property.Actor">
<em class="property">class </em><code class="descname">Actor</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Actor" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Actor</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Actor" title="Permalink to this definition"></a></dt>
<dd><p>The user select an actor which is available in the system. The value of this variable will be the actor id</p> <dd><p>The user select an actor which is available in the system. The value of this variable will be the actor id</p>
</dd></dl> </dd></dl>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property.Kettle"> <dt id="cbpi.api.Property.Kettle">
<em class="property">class </em><code class="descname">Kettle</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Kettle" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Kettle</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Kettle" title="Permalink to this definition"></a></dt>
<dd><p>The user select a kettle which is available in the system. The value of this variable will be the kettle id</p> <dd><p>The user select a kettle which is available in the system. The value of this variable will be the kettle id</p>
</dd></dl> </dd></dl>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property.Number"> <dt id="cbpi.api.Property.Number">
<em class="property">class </em><code class="descname">Number</code><span class="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=None</em>, <em>unit=''</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Number" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Number</code><span class="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=None</em>, <em>unit=''</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Number" title="Permalink to this definition"></a></dt>
<dd><p>The user can set a number value</p> <dd><p>The user can set a number value</p>
</dd></dl> </dd></dl>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property.Select"> <dt id="cbpi.api.Property.Select">
<em class="property">class </em><code class="descname">Select</code><span class="sig-paren">(</span><em>label</em>, <em>options</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Select" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Select</code><span class="sig-paren">(</span><em>label</em>, <em>options</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Select" title="Permalink to this definition"></a></dt>
<dd><p>Select Property. The user can select value from list set as options parameter</p> <dd><p>Select Property. The user can select value from list set as options parameter</p>
</dd></dl> </dd></dl>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property.Sensor"> <dt id="cbpi.api.Property.Sensor">
<em class="property">class </em><code class="descname">Sensor</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Sensor" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Sensor</code><span class="sig-paren">(</span><em>label</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Sensor" title="Permalink to this definition"></a></dt>
<dd><p>The user select a sensor which is available in the system. The value of this variable will be the sensor id</p> <dd><p>The user select a sensor which is available in the system. The value of this variable will be the sensor id</p>
</dd></dl> </dd></dl>
<dl class="class"> <dl class="class">
<dt id="core.api.property.Property.Text"> <dt id="cbpi.api.Property.Text">
<em class="property">class </em><code class="descname">Text</code><span class="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=''</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.property.Property.Text" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descname">Text</code><span class="sig-paren">(</span><em>label</em>, <em>configurable=False</em>, <em>default_value=''</em>, <em>description=''</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.Property.Text" title="Permalink to this definition"></a></dt>
<dd><p>The user can set a text value</p> <dd><p>The user can set a text value</p>
</dd></dl> </dd></dl>
@ -307,6 +419,8 @@ For example the user can set the GPIO number or the 1Wire Id.</p>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="standards.html" class="btn btn-neutral float-right" title="Standard &amp; Guidelines" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="kettle_controller.html" class="btn btn-neutral" title="Kettle" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> <a href="kettle_controller.html" class="btn btn-neutral" title="Kettle" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>

View file

@ -85,6 +85,8 @@
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li> <li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="webapis.html#websocket-api">WebSocket API</a></li>
</ul> </ul>

File diff suppressed because one or more lines are too long

View file

@ -91,6 +91,7 @@
<li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li> <li class="toctree-l1"><a class="reference internal" href="step.html">Brewing Step</a></li>
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
</ul> </ul>
@ -160,17 +161,67 @@
<div class="section" id="sensor-controller"> <div class="section" id="sensor-controller">
<h2>Sensor Controller<a class="headerlink" href="#sensor-controller" title="Permalink to this headline"></a></h2> <h2>Sensor Controller<a class="headerlink" href="#sensor-controller" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.controller.sensor_controller.SensorController"> <dt id="cbpi.controller.sensor_controller.SensorController">
<em class="property">class </em><code class="descclassname">core.controller.sensor_controller.</code><code class="descname">SensorController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.sensor_controller.SensorController" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.controller.sensor_controller.</code><code class="descname">SensorController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.controller.crud_controller.CRUDController</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">core.http_endpoints.http_api.HttpCrudEndpoints</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.controller.crud_controller.CRUDController</span></code></p>
<dl class="method"> <dl class="attribute">
<dt id="core.controller.sensor_controller.SensorController.get_value"> <dt id="cbpi.controller.sensor_controller.SensorController._abc_impl">
<code class="descname">get_value</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.sensor_controller.SensorController.get_value" title="Permalink to this definition"></a></dt> <code class="descname">_abc_impl</code><em class="property"> = &lt;_abc_data object&gt;</em><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController._abc_impl" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.sensor_controller.SensorController.init"> <dt id="cbpi.controller.sensor_controller.SensorController._post_add_callback">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.sensor_controller.SensorController.init" title="Permalink to this definition"></a></dt> <code class="descname">_post_add_callback</code><span class="sig-paren">(</span><em>m</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController._post_add_callback" title="Permalink to this definition"></a></dt>
<dd><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>m</strong> </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="cbpi.controller.sensor_controller.SensorController._post_update_callback">
<code class="descname">_post_update_callback</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController._post_update_callback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController._pre_delete_callback">
<code class="descname">_pre_delete_callback</code><span class="sig-paren">(</span><em>sensor_id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController._pre_delete_callback" title="Permalink to this definition"></a></dt>
<dd><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>m</strong> </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="cbpi.controller.sensor_controller.SensorController._pre_update_callback">
<code class="descname">_pre_update_callback</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController._pre_update_callback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController.get_state">
<code class="descname">get_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.get_state" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController.get_value">
<code class="descname">get_value</code><span class="sig-paren">(</span><em>sensor_id</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.get_value" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.init" title="Permalink to this definition"></a></dt>
<dd><p>This method initializes all actors during startup. It creates actor instances</p> <dd><p>This method initializes all actors during startup. It creates actor instances</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -182,29 +233,49 @@
</table> </table>
</dd></dl> </dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController.init_sensor">
<code class="descname">init_sensor</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.init_sensor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute"> <dl class="attribute">
<dt id="core.controller.sensor_controller.SensorController.model"> <dt id="cbpi.controller.sensor_controller.SensorController.model">
<code class="descname">model</code><a class="headerlink" href="#core.controller.sensor_controller.SensorController.model" title="Permalink to this definition"></a></dt> <code class="descname">model</code><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.model" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">core.database.model.SensorModel</span></code></p> <dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.database.model.SensorModel</span></code></p>
</dd></dl> </dd></dl>
<dl class="method">
<dt id="cbpi.controller.sensor_controller.SensorController.stop_sensor">
<code class="descname">stop_sensor</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.sensor_controller.SensorController.stop_sensor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl> </dd></dl>
</div> </div>
<div class="section" id="cbpisensor"> <div class="section" id="cbpisensor">
<h2>CBPiSensor<a class="headerlink" href="#cbpisensor" title="Permalink to this headline"></a></h2> <h2>CBPiSensor<a class="headerlink" href="#cbpisensor" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.api.sensor.CBPiSensor"> <dt id="cbpi.api.CBPiSensor">
<em class="property">class </em><code class="descclassname">core.api.sensor.</code><code class="descname">CBPiSensor</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.sensor.CBPiSensor" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.api.</code><code class="descname">CBPiSensor</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSensor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">core.api.extension.CBPiExtension</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">cbpi.api.extension.CBPiExtension</span></code></p>
<dl class="method"> <dl class="method">
<dt id="core.api.sensor.CBPiSensor.run"> <dt id="cbpi.api.CBPiSensor.init">
<code class="descname">run</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.sensor.CBPiSensor.run" title="Permalink to this definition"></a></dt> <code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSensor.init" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.sensor.CBPiSensor.state"> <dt id="cbpi.api.CBPiSensor.log_data">
<code class="descname">state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.sensor.CBPiSensor.state" title="Permalink to this definition"></a></dt> <code class="descname">log_data</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSensor.log_data" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.api.CBPiSensor.run">
<code class="descname">run</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSensor.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cbpi.api.CBPiSensor.state">
<code class="descname">state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSensor.state" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
</dd></dl> </dd></dl>
@ -269,13 +340,13 @@
53 53
54 54
55 55
56</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span> 56
57
58</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">import</span> <span class="nn">logging</span> <span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">random</span> <span class="kn">import</span> <span class="nn">random</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="kn">from</span> <span class="nn">cbpi.api</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">core.api.sensor</span> <span class="kn">import</span> <span class="n">CBPiSensor</span>
<span class="k">class</span> <span class="nc">CustomSensor</span><span class="p">(</span><span class="n">CBPiSensor</span><span class="p">):</span> <span class="k">class</span> <span class="nc">CustomSensor</span><span class="p">(</span><span class="n">CBPiSensor</span><span class="p">):</span>
@ -296,6 +367,10 @@
<span class="sd"> &#39;&#39;&#39;</span> <span class="sd"> &#39;&#39;&#39;</span>
<span class="k">pass</span> <span class="k">pass</span>
<span class="k">def</span> <span class="nf">init</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">init</span><span class="p">()</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="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="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">state</span><span class="p">()</span>
@ -306,10 +381,10 @@
<span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="mi">0</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span> <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="n">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">interval</span><span class="p">)</span> <span class="n">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">interval</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">log_data</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">+</span> <span class="mi">1</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">+</span> <span class="mi">1</span>
<span class="n">cbpi</span><span class="o">.</span><span class="n">bus</span><span class="o">.</span><span class="n">fire</span><span class="p">(</span><span class="s2">&quot;sensor/</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span> <span class="n">await</span> <span class="n">cbpi</span><span class="o">.</span><span class="n">bus</span><span class="o">.</span><span class="n">fire</span><span class="p">(</span><span class="s2">&quot;sensor/</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;SENSOR IS RUNNING&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>

View file

@ -87,13 +87,15 @@
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Standard &amp; Guidelines</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">Standard &amp; Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#python">Python</a><ul> <li class="toctree-l2"><a class="reference internal" href="#python">Python</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#eventbus">CBPiEventBus</a></li> <li class="toctree-l3"><a class="reference internal" href="#cbpieventbus">CBPiEventBus</a></li>
<li class="toctree-l3"><a class="reference internal" href="#http-endpoints">HTTP Endpoints</a></li> <li class="toctree-l3"><a class="reference internal" href="#http-endpoints">HTTP Endpoints</a></li>
<li class="toctree-l3"><a class="reference internal" href="#websocket">CBPiWebSocket</a></li> <li class="toctree-l3"><a class="reference internal" href="#cbpiwebsocket">CBPiWebSocket</a></li>
<li class="toctree-l3"><a class="reference internal" href="#sql-files">SQL Files</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l2"><a class="reference internal" href="#web-user-interface">Web User Interface</a></li> <li class="toctree-l2"><a class="reference internal" href="#web-user-interface">Web User Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="#rest-api">REST API</a></li> <li class="toctree-l2"><a class="reference internal" href="#rest-api">REST API</a></li>
<li class="toctree-l2"><a class="reference internal" href="#custom-extensions-pluins">Custom Extensions &amp; Pluins</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -169,8 +171,8 @@ As a main framework CraftBeerPi is based on <cite>aiohttp</cite></p>
<ul class="simple"> <ul class="simple">
<li>aioHTTP <a class="reference external" href="https://aiohttp.readthedocs.io/en/stable/">https://aiohttp.readthedocs.io/en/stable/</a></li> <li>aioHTTP <a class="reference external" href="https://aiohttp.readthedocs.io/en/stable/">https://aiohttp.readthedocs.io/en/stable/</a></li>
</ul> </ul>
<div class="section" id="eventbus"> <div class="section" id="cbpieventbus">
<h3>CBPiEventBus<a class="headerlink" href="#eventbus" title="Permalink to this headline"></a></h3> <h3>CBPiEventBus<a class="headerlink" href="#cbpieventbus" title="Permalink to this headline"></a></h3>
<p>One core concept of CraftBeerPi 4.x is the CBPiEventBus. <p>One core concept of CraftBeerPi 4.x is the CBPiEventBus.
It should be avoided to call method on a controller directly. Events should be fired and listener methods should be used. It should be avoided to call method on a controller directly. Events should be fired and listener methods should be used.
This makes sure that all components are loosely coupled. New plugins can listen on events and extend or change the functionality easily.</p> This makes sure that all components are loosely coupled. New plugins can listen on events and extend or change the functionality easily.</p>
@ -188,6 +190,7 @@ This makes sure that all components are loosely coupled. New plugins can listen
<p class="first admonition-title">Note</p> <p class="first admonition-title">Note</p>
<p class="last">Its imporante to add <a href="#id1"><span class="problematic" id="id2">**</span></a>kwargs as parameter to the listening method. This makes sure that maybe addtional event paramenter are not causing an exception.</p> <p class="last">Its imporante to add <a href="#id1"><span class="problematic" id="id2">**</span></a>kwargs as parameter to the listening method. This makes sure that maybe addtional event paramenter are not causing an exception.</p>
</div> </div>
<p>A list of all registered events listeners can be found under: <cite>http://&lt;IP_ADDRESS&gt;:&lt;PORT&gt;/system/events</cite></p>
</div> </div>
<div class="section" id="http-endpoints"> <div class="section" id="http-endpoints">
<h3>HTTP Endpoints<a class="headerlink" href="#http-endpoints" title="Permalink to this headline"></a></h3> <h3>HTTP Endpoints<a class="headerlink" href="#http-endpoints" title="Permalink to this headline"></a></h3>
@ -205,8 +208,8 @@ Typically you perform just some basing parameter validation and fire an event so
<p class="last">The Events are process in an async way. Results will be pushed to the client via CBPiWebSocket Event.</p> <p class="last">The Events are process in an async way. Results will be pushed to the client via CBPiWebSocket Event.</p>
</div> </div>
</div> </div>
<div class="section" id="websocket"> <div class="section" id="cbpiwebsocket">
<h3>CBPiWebSocket<a class="headerlink" href="#websocket" title="Permalink to this headline"></a></h3> <h3>CBPiWebSocket<a class="headerlink" href="#cbpiwebsocket" title="Permalink to this headline"></a></h3>
<p>The CBPiWebSocket is listening on <cite>http://&lt;IP_ADDRESS&gt;:&lt;PORT&gt;/ws</cite> <p>The CBPiWebSocket is listening on <cite>http://&lt;IP_ADDRESS&gt;:&lt;PORT&gt;/ws</cite>
All events are forwarded to all connected web socket clients.</p> All events are forwarded to all connected web socket clients.</p>
<p>The CBPiWebSocket Event is having the following structure.</p> <p>The CBPiWebSocket Event is having the following structure.</p>
@ -225,6 +228,11 @@ All events are forwarded to all connected web socket clients.</p>
</pre></div> </pre></div>
</div> </div>
</div> </div>
<div class="section" id="sql-files">
<h3>SQL Files<a class="headerlink" href="#sql-files" title="Permalink to this headline"></a></h3>
<p>Currently only one SQL file for database initialisation is available.
Its located under: <cite>./core/sql</cite></p>
</div>
</div> </div>
<div class="section" id="web-user-interface"> <div class="section" id="web-user-interface">
<h2>Web User Interface<a class="headerlink" href="#web-user-interface" title="Permalink to this headline"></a></h2> <h2>Web User Interface<a class="headerlink" href="#web-user-interface" title="Permalink to this headline"></a></h2>
@ -243,6 +251,10 @@ The build process is based on webpack and bable.</p>
After server startup you can find the API documentaiton under: <cite>http://&lt;IP_ADDRESS&gt;:&lt;PORT&gt;/api/doc</cite></p> After server startup you can find the API documentaiton under: <cite>http://&lt;IP_ADDRESS&gt;:&lt;PORT&gt;/api/doc</cite></p>
<p>To generate the swagger file <cite>aiohttp-swagger</cite> is used. for more information see: <a class="reference external" href="https://aiohttp-swagger.readthedocs.io/en/latest/">https://aiohttp-swagger.readthedocs.io/en/latest/</a></p> <p>To generate the swagger file <cite>aiohttp-swagger</cite> is used. for more information see: <a class="reference external" href="https://aiohttp-swagger.readthedocs.io/en/latest/">https://aiohttp-swagger.readthedocs.io/en/latest/</a></p>
</div> </div>
<div class="section" id="custom-extensions-pluins">
<h2>Custom Extensions &amp; Pluins<a class="headerlink" href="#custom-extensions-pluins" title="Permalink to this headline"></a></h2>
<p>Custom Extension should be placed under <cite>./core/extensions</cite></p>
</div>
</div> </div>

View file

@ -91,6 +91,7 @@
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li> <li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li> <li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
</ul> </ul>
@ -160,8 +161,8 @@
<div class="section" id="stepcontroller"> <div class="section" id="stepcontroller">
<h2>StepController<a class="headerlink" href="#stepcontroller" title="Permalink to this headline"></a></h2> <h2>StepController<a class="headerlink" href="#stepcontroller" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.controller.step_controller.StepController"> <dt id="cbpi.controller.step_controller.StepController">
<em class="property">class </em><code class="descclassname">core.controller.step_controller.</code><code class="descname">StepController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.controller.step_controller.</code><code class="descname">StepController</code><span class="sig-paren">(</span><em>cbpi</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController" title="Permalink to this definition"></a></dt>
<dd><p>The Step Controller. This controller is responsible to start and stop the brewing steps.</p> <dd><p>The Step Controller. This controller is responsible to start and stop the brewing steps.</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -175,8 +176,8 @@
</tbody> </tbody>
</table> </table>
<dl class="method"> <dl class="method">
<dt id="core.controller.step_controller.StepController.handle_action"> <dt id="cbpi.controller.step_controller.StepController.handle_action">
<code class="descname">handle_action</code><span class="sig-paren">(</span><em>action</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_action" title="Permalink to this definition"></a></dt> <code class="descname">handle_action</code><span class="sig-paren">(</span><em>action</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController.handle_action" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/action”. <dd><p>Event Handler for “step/action”.
It invokes the provided method name on the current step</p> It invokes the provided method name on the current step</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
@ -197,47 +198,8 @@ It invokes the provided method name on the current step</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.step_controller.StepController.handle_done"> <dt id="cbpi.controller.step_controller.StepController.handle_reset">
<code class="descname">handle_done</code><span class="sig-paren">(</span><em>topic</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_done" title="Permalink to this definition"></a></dt> <code class="descname">handle_reset</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController.handle_reset" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/+/done”.
Starts the next step</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>topic</strong> </li>
<li><strong>kwargs</strong> </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.controller.step_controller.StepController.handle_next">
<code class="descname">next</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_next" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/next”.
It start the next step</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>kwargs</strong> </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.controller.step_controller.StepController.handle_reset">
<code class="descname">handle_reset</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_reset" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/reset”. <dd><p>Event Handler for “step/reset”.
Resets the current step</p> Resets the current step</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
@ -253,113 +215,32 @@ Resets the current step</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.step_controller.StepController.handle_start"> <dt id="cbpi.controller.step_controller.StepController.init">
<code class="descname">handle_start</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_start" title="Permalink to this definition"></a></dt> <code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController.init" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/start”.
It starts the brewing process</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>kwargs</strong> </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.controller.step_controller.StepController.handle_stop">
<code class="descname">handle_stop</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.handle_stop" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/stop”.
Stops the current step</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>kwargs</strong> </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.controller.step_controller.StepController.http_action">
<code class="descname">http_action</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.http_action" title="Permalink to this definition"></a></dt>
<dd><p>HTTP Endpoint to call an action on the current step.</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>request</strong> web requset</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">web.Response(text=”OK”</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="core.controller.step_controller.StepController.http_next">
<code class="descname">http_next</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.http_next" title="Permalink to this definition"></a></dt>
<dd><p>HTTP Endpoint to start the next step. The current step will be stopped</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>request</strong> </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.controller.step_controller.StepController.http_reset">
<code class="descname">http_reset</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.http_reset" title="Permalink to this definition"></a></dt>
<dd><p>HTTP Endpoint to call reset on the current step.</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>request</strong> </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.controller.step_controller.StepController.http_start">
<code class="descname">http_start</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.http_start" title="Permalink to this definition"></a></dt>
<dd><p>HTTP Endpoint to start the brewing process.</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>request</strong> </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.controller.step_controller.StepController.init">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.init" title="Permalink to this definition"></a></dt>
<dd><p>Initializer of the the Step Controller. <dd><p>Initializer of the the Step Controller.
:return:</p> :return:</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.controller.step_controller.StepController.start"> <dt id="cbpi.controller.step_controller.StepController.next">
<code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.controller.step_controller.StepController.start" title="Permalink to this definition"></a></dt> <code class="descname">next</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController.next" title="Permalink to this definition"></a></dt>
<dd><p>Event Handler for “step/next”.
It start the next step</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>kwargs</strong> </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="cbpi.controller.step_controller.StepController.start">
<code class="descname">start</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.controller.step_controller.StepController.start" title="Permalink to this definition"></a></dt>
<dd><p>Start the first step</p> <dd><p>Start the first step</p>
<p>:return:None</p> <p>:return:None</p>
</dd></dl> </dd></dl>
@ -370,12 +251,12 @@ Stops the current step</p>
<div class="section" id="cbpisimplestep"> <div class="section" id="cbpisimplestep">
<h2>CBPiSimpleStep<a class="headerlink" href="#cbpisimplestep" title="Permalink to this headline"></a></h2> <h2>CBPiSimpleStep<a class="headerlink" href="#cbpisimplestep" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="core.api.step.CBPiSimpleStep"> <dt id="cbpi.api.CBPiSimpleStep">
<em class="property">class </em><code class="descclassname">core.api.step.</code><code class="descname">CBPiSimpleStep</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep" title="Permalink to this definition"></a></dt> <em class="property">class </em><code class="descclassname">cbpi.api.</code><code class="descname">CBPiSimpleStep</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.is_dirty"> <dt id="cbpi.api.CBPiSimpleStep.is_dirty">
<code class="descname">is_dirty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.is_dirty" title="Permalink to this definition"></a></dt> <code class="descname">is_dirty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.is_dirty" title="Permalink to this definition"></a></dt>
<dd><p>Check if a managed variable has a new value</p> <dd><p>Check if a managed variable has a new value</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -388,13 +269,13 @@ Stops the current step</p>
</dd></dl> </dd></dl>
<dl class="attribute"> <dl class="attribute">
<dt id="core.api.step.CBPiSimpleStep.managed_fields"> <dt id="cbpi.api.CBPiSimpleStep.managed_fields">
<code class="descname">managed_fields</code><em class="property"> = []</em><a class="headerlink" href="#core.api.step.CBPiSimpleStep.managed_fields" title="Permalink to this definition"></a></dt> <code class="descname">managed_fields</code><em class="property"> = []</em><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.managed_fields" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.next"> <dt id="cbpi.api.CBPiSimpleStep.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.next" title="Permalink to this definition"></a></dt> <code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.next" title="Permalink to this definition"></a></dt>
<dd><p>Request to stop the the step</p> <dd><p>Request to stop the the step</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -407,8 +288,8 @@ Stops the current step</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.reset"> <dt id="cbpi.api.CBPiSimpleStep.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.reset" title="Permalink to this definition"></a></dt> <code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.reset" title="Permalink to this definition"></a></dt>
<dd><p>Reset the step. This method needs to be overwritten by the custom step implementation</p> <dd><p>Reset the step. This method needs to be overwritten by the custom step implementation</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -421,8 +302,8 @@ Stops the current step</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.reset_dirty"> <dt id="cbpi.api.CBPiSimpleStep.reset_dirty">
<code class="descname">reset_dirty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.reset_dirty" title="Permalink to this definition"></a></dt> <code class="descname">reset_dirty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.reset_dirty" title="Permalink to this definition"></a></dt>
<dd><p>Reset the dirty flag</p> <dd><p>Reset the dirty flag</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -435,8 +316,8 @@ Stops the current step</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.run"> <dt id="cbpi.api.CBPiSimpleStep.run">
<code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.run" title="Permalink to this definition"></a></dt> <code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.run" title="Permalink to this definition"></a></dt>
<dd><p>This method in running in the background. It invokes the run_cycle method in the configured interval <dd><p>This method in running in the background. It invokes the run_cycle method in the configured interval
It checks if a managed variable was modified in the last exection cycle. If yes, the method will persisit the new value of the It checks if a managed variable was modified in the last exection cycle. If yes, the method will persisit the new value of the
managed property</p> managed property</p>
@ -451,8 +332,8 @@ managed property</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.run_cycle"> <dt id="cbpi.api.CBPiSimpleStep.run_cycle">
<code class="descname">run_cycle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.run_cycle" title="Permalink to this definition"></a></dt> <code class="descname">run_cycle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.run_cycle" title="Permalink to this definition"></a></dt>
<dd><p>This method is executed in the defined interval. <dd><p>This method is executed in the defined interval.
That the place to put your step logic. That the place to put your step logic.
The method need to be overwritten in the Ccstom step implementaion</p> The method need to be overwritten in the Ccstom step implementaion</p>
@ -467,8 +348,8 @@ The method need to be overwritten in the Ccstom step implementaion</p>
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.running"> <dt id="cbpi.api.CBPiSimpleStep.running">
<code class="descname">running</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.running" title="Permalink to this definition"></a></dt> <code class="descname">running</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.running" title="Permalink to this definition"></a></dt>
<dd><p>Method checks if the step should continue running. <dd><p>Method checks if the step should continue running.
The method will return False if the step is requested to stop or the next step should start</p> The method will return False if the step is requested to stop or the next step should start</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
@ -482,8 +363,8 @@ The method will return False if the step is requested to stop or the next step s
</dd></dl> </dd></dl>
<dl class="method"> <dl class="method">
<dt id="core.api.step.CBPiSimpleStep.stop"> <dt id="cbpi.api.CBPiSimpleStep.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#core.api.step.CBPiSimpleStep.stop" title="Permalink to this definition"></a></dt> <code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cbpi.api.CBPiSimpleStep.stop" title="Permalink to this definition"></a></dt>
<dd><p>Request to stop the step</p> <dd><p>Request to stop the step</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -501,8 +382,8 @@ The method will return False if the step is requested to stop or the next step s
<div class="section" id="custom-step"> <div class="section" id="custom-step">
<h2>Custom Step<a class="headerlink" href="#custom-step" title="Permalink to this headline"></a></h2> <h2>Custom Step<a class="headerlink" href="#custom-step" title="Permalink to this headline"></a></h2>
<p>This is an example of a custom step. The Step class need to extend Simple step. In addtion at least the run_cycle method needs to be overwritten</p> <p>This is an example of a custom step. The Step class need to extend Simple step. In addtion at least the run_cycle method needs to be overwritten</p>
<div class="literal-block-wrapper docutils container" id="init-py"> <div class="literal-block-wrapper docutils container" id="id1">
<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="code-block-caption"><span class="caption-text">__init__.py</span><a class="headerlink" href="#id1" title="Permalink to this code"></a></div>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1 <div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2 2
3 3
@ -539,8 +420,7 @@ The method will return False if the step is requested to stop or the next step s
34 34
35</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span> 35</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">from</span> <span class="nn">core.api</span> <span class="kn">import</span> <span class="n">Property</span><span class="p">,</span> <span class="n">action</span> <span class="kn">from</span> <span class="nn">cbpi.api</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">core.api.step</span> <span class="kn">import</span> <span class="n">CBPiSimpleStep</span>
<span class="k">class</span> <span class="nc">CustomStepCBPi</span><span class="p">(</span><span class="n">CBPiSimpleStep</span><span class="p">):</span> <span class="k">class</span> <span class="nc">CustomStepCBPi</span><span class="p">(</span><span class="n">CBPiSimpleStep</span><span class="p">):</span>
@ -554,12 +434,13 @@ The method will return False if the step is requested to stop or the next step s
<span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;WOOHOO&quot;</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;WOOHOO&quot;</span>
<span class="n">async</span> <span class="k">def</span> <span class="nf">run_cycle</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="n">async</span> <span class="k">def</span> <span class="nf">run_cycle</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;RUN&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="c1">#await asyncio.sleep(1)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">i</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="bp">self</span><span class="o">.</span><span class="n">i</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cbpi</span><span class="o">.</span><span class="n">notify</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s2">&quot;step&quot;</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="s2">&quot;OH YES&quot;</span><span class="p">)</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">i</span> <span class="o">==</span> <span class="mi">5</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;RUN STEP&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">)</span> <span class="c1"># print(&quot;NEXT&quot;)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">next</span><span class="p">()</span>
<span class="c1">#self.cbpi.notify(key=&quot;step&quot;, message=&quot;HELLO FROM STEP&quot;)</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="k">def</span> <span class="nf">setup</span><span class="p">(</span><span class="n">cbpi</span><span class="p">):</span>

232
docs/webapis.html Normal file
View file

@ -0,0 +1,232 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>REST API &mdash; CraftBeerPi 4.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Standard &amp; Guidelines" href="standards.html" />
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> CraftBeerPi
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="core.html">Core</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">Brewing Step</a></li>
<li class="toctree-l1"><a class="reference internal" href="kettle_controller.html">Kettle</a></li>
<li class="toctree-l1"><a class="reference internal" href="properties.html">Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="standards.html">Standard &amp; Guidelines</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="#websocket-api">WebSocket API</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">CraftBeerPi</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>REST API</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/webapis.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="rest-api">
<h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline"></a></h1>
<p>The REST API is document by using Swagger.IO.
After startup of the server the API documentation is available under:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//&lt;</span><span class="n">SERVER_IP</span><span class="o">&gt;</span><span class="p">:</span><span class="o">&lt;</span><span class="n">PORT</span><span class="o">&gt;/</span><span class="n">api</span><span class="o">/</span><span class="n">doc</span>
</pre></div>
</div>
</div>
<div class="section" id="websocket-api">
<h1>WebSocket API<a class="headerlink" href="#websocket-api" title="Permalink to this headline"></a></h1>
<p>WebSocket client can be connected to the following endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//&lt;</span><span class="n">SERVER_IP</span><span class="o">&gt;</span><span class="p">:</span><span class="o">&lt;</span><span class="n">PORT</span><span class="o">&gt;/</span><span class="n">ws</span>
</pre></div>
</div>
<p>I recommend to use Dark WebSocket Terminal for testing. At the moment the WebSocket API is just pushing data.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Currently Security is not enabled. That means you need no password to connect to th Web APIs</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="standards.html" class="btn btn-neutral" title="Standard &amp; Guidelines" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Manuel Fritsch
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<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 type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -1,7 +1,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup(name='cbpi', setup(name='cbpi',
version='4.0.2', version='4.0.3',
description='CraftBeerPi API', description='CraftBeerPi API',
author='Manuel Fritsch', author='Manuel Fritsch',
author_email='manuel@craftbeerpi.com', author_email='manuel@craftbeerpi.com',