--- /dev/null
+Copyright (c) 2023 Graph-IT GmbH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
--- /dev/null
+# ControlPi Plugin for <PURPOSE>
+This distribution package contains a plugin for the
+[ControlPi system](https://docs.graph-it.com/graphit/controlpi), that
+<...>
+
+Documentation (in German) can be found at [doc/index.md](doc/index.md) in
+the source repository and at
+[https://docs.graph-it.com/graphit/controlpi-<NAME>/](https://docs.graph-it.com/graphit/controlpi-<NAME>/).
+Code documentation (in English) including doctests is contained in the
+source files.
--- /dev/null
+{
+ "Debug": {
+ "plugin": "WSServer",
+ "web": {
+ "/": {
+ "module": "controlpi_plugins.wsserver",
+ "location": "Debug"
+ }
+ }
+ },
+ "Log": {
+ "plugin": "Log",
+ "filter": [{}]
+ },
+ <...>
+}
--- /dev/null
+"""ControlPi Plugin for <PURPOSE>."""
+import asyncio
+
+from controlpi import BasePlugin, Message, MessageTemplate
+from controlpi.baseplugin import JSONSchema
+
+
+class Example(BasePlugin):
+ """ControlPi plugin for <PURPOSE>."""
+
+ CONF_SCHEMA: JSONSchema = {'properties':
+ {'init': {'type': 'boolean',
+ 'default': False}},
+ 'required': []}
+
+ def process_conf(self) -> None:
+ """Register bus client."""
+ self._state = self.conf['init']
+ self.bus.register(self.name, 'Example',
+ [MessageTemplate({'event':
+ {'const': 'changed'},
+ 'state':
+ {'type': 'boolean'}}),
+ MessageTemplate({'state':
+ {'type': 'boolean'}})],
+ [([MessageTemplate({'target':
+ {'const': self.name},
+ 'command':
+ {'const': 'get state'}})],
+ self._get_state)])
+
+ async def _get_state(self, message) -> None:
+ await self.bus.send(Message(self.name, {'state': self._state}))
+
+ async def run(self) -> None:
+ """Run main loop of the plugin."""
+ while True:
+ self._state = not self._state
+ await self.bus.send(Message(self.name, {'event': 'changed',
+ 'state': self._state}))
+ await asyncio.sleep(10)
--- /dev/null
+# ControlPi-Plugin für <ZWECK>
+Dieses Paket enthält ein Plugin für das ControlPi-System, mit dem <...>
+
+## Installation
+Eine ausführliche Dokumentation ist in der Dokumentation der
+[ControlPi-Infrastruktur](https://docs.graph-it.com/graphit/controlpi) zu
+finden.
+
+Der Code dieses Plugins kann mit git geclonet werden:
+```sh
+$ git clone git://git.graph-it.com/graphit/controlpi-<NAME>.git
+```
+(Falls Zugang zu diesem Server per SSH besteht und Änderungen gepusht
+werden sollen, sollte stattdessen die SSH-URL benutzt werden.)
+
+Dann kann es editierbar in ein virtuelles Environment installiert werden:
+```sh
+(venv)$ pip install --editable <Pfad zum Code-Repository>
+```
+
+Auf dem Raspberry Pi (oder wenn keine Code-Änderungen gewünscht sind) kann
+es auch direkt, ohne einen git-Clone installiert werden:
+```sh
+(venv)$ pip install git+git://git.graph-it.com/graphit/controlpi-<NAME>.git
+```
+
+## Benutzung
+Eine minimale ControlPi-Konfiguration, die dieses Plugin benutzt, ist im
+git-Repository enthalten:
+```json
+{
+ "Debug": {
+ "plugin": "WSServer",
+ "web": {
+ "/": {
+ "module": "controlpi_plugins.wsserver",
+ "location": "Debug"
+ }
+ }
+ },
+ "Log": {
+ "plugin": "Log",
+ "filter": [{}]
+ },
+ <...>
+}
+```
+
+<...>
+
+Mit dieser Beispiel-Konfiguration kann <...> in der Debug-Oberfläche des
+ControlPi und im Log in `journalctl -u controlpi` gesehen werden:
+
--- /dev/null
+import setuptools
+
+with open("README.md", "r") as readme_file:
+ long_description = readme_file.read()
+
+setuptools.setup(
+ name="controlpi-<NAME>",
+ version="0.1.0",
+ author="Graph-IT GmbH",
+ author_email="info@graph-it.com",
+ description="ControlPi Plugin for <PURPOSE>",
+ long_description=long_description,
+ long_description_content_type="text/markdown",
+ url="http://docs.graph-it.com/graphit/controlpi-<NAME>",
+ packages=["controlpi_plugins"],
+ install_requires=[
+ "controlpi @ git+git://git.graph-it.com/graphit/controlpi.git",
+ ],
+ classifiers=[
+ "Programming Language :: Python",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ ],
+)