From c6237c5849ae4f8a9c441a176a77bfdca75c8ce2 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 26 Jan 2021 07:06:56 +0000 Subject: [PATCH] GitBook: [master] one page modified --- development.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/development.md b/development.md index 4eb4ebb..1dd1eac 100644 --- a/development.md +++ b/development.md @@ -1,6 +1,22 @@ # Development -## Custom Sensor +## Development Setup + +Custom Plugins are shipped as standard Python packages. Just create a python virtual env and add `cbpi`as dependency + +{% hint style="info" %} +How to create virtual env in Python +[https://docs.python.org/3/tutorial/venv.html](https://docs.python.org/3/tutorial/venv.html) +{% endhint %} + +```bash + +python3 -m venv venv +source venv/bin/activate +python3 -m pip insatll cbpi +``` + +## Sensor ```python # -*- coding: utf-8 -*- @@ -11,7 +27,9 @@ import random from aiohttp import web from cbpi.api import * - +''' +Make sure to extend CBPiSensor +''' @parameters([Property.Number(label="Param1", configurable=True), Property.Text(label="Param2", configurable=True, default_value="HALLO"),