Development

Development Setup

Custom Plugins are shipped as standard Python packages. Just create a python virtual env and add cbpias dependency

How to create virtual env in Python https://docs.python.org/3/tutorial/venv.html

1. Create a virtual env with CBPi

python3 -m venv venv
source venv/bin/activate
python3 -m pip insatll cbpi

2. Create Plugin

cbpi create <PLUGIN_NAME>

3. Add Custom Code

4. Install your plugin locally

pip install ./<PLUGIN_NAME>
cbpi add <PLUGIN_NAME>

3. Build plugin

To build your package run the following command in the root folder of your plugin

4. Upload the plugin

Create a PyPi Account

PyPi is a Python package index. You can create an accout for free and upload your plugin to this platform.

https://pypi.org

Upload your package

Make sure that you have intalled twine. pip install twine

Full Example

https://github.com/Manuel83/cbpi4-ui-plugin

Sensor

Actor

Last updated

Was this helpful?