--- /dev/null
+__pycache__/
+dist/
+controlpi_graph.egg-info/
+venv/
--- /dev/null
+Copyright (c) 2021 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 Graph Connections
+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-graph/](https://docs.graph-it.com/graphit/controlpi-graph/).
+Code documentation (in English) including doctests is contained in the
+source files.
+An API documentation generated by pdoc3 can be found at
+[doc/controlpi_plugins/index.html](doc/controlpi_plugins/index.html) in the source
+repository and at
+[https://docs.graph-it.com/graphit/controlpi-graph/controlpi_plugins/](https://docs.graph-it.com/graphit/controlpi-graph/controlpi_plugins/).
--- /dev/null
+{
+ "Example Server": {
+ "plugin": "WSServer",
+ "port": 8080,
+ "web": {
+ "/": { "module": "controlpi_plugins.wsserver",
+ "location": "Debug" }
+ }
+ },
+ "Test Graph": {
+ "plugin": "GraphConnection",
+ "url": "tls://graph.example.com",
+ "crt": "graph.crt"
+ },
+ "Example State": {
+ "plugin": "State"
+ },
+ ...
+}
--- /dev/null
+"""Provide Graph Connections as ControlPi Plugin
+
+…
+
+TODO: documentation, doctests
+"""
+from controlpi import BasePlugin, Message, MessageTemplate
+
+
+class GraphConnection(BasePlugin):
+ """Graph connection plugin.
+
+ Connect to remote graph and allow execution of API calls over this
+ connection.
+ """
+
+ CONF_SCHEMA = {'properties':
+ {'url': {'type': 'string'},
+ 'crt': {'type': 'string'}},
+ 'required': ['url', 'crt']}
+
+ async def _receive(self, message: Message) -> None:
+ await self.bus.send(Message(self.name, {'spam': self.conf['spam']}))
+
+ def process_conf(self) -> None:
+ """Register plugin as bus client."""
+ message = Message(self.name, {'spam': self.conf['spam']})
+ sends = [MessageTemplate.from_message(message)]
+ receives = [MessageTemplate({'target': {'const': self.name}})]
+ self.bus.register(self.name, 'Plugin', sends, receives, self._receive)
+
+ async def run(self) -> None:
+ """Send initial message."""
+ await self.bus.send(Message(self.name, {'spam': self.conf['spam']}))
--- /dev/null
+# ControlPi-Plugin für Graph-Connections
+Dieses Paket enthält ein Plugin für das ControlPi-System, mit dem <…>
+
+## Benutzung
+…
+
+## 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-graph.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-graph.git
+```
--- /dev/null
+import setuptools
+
+with open("README.md", "r") as readme_file:
+ long_description = readme_file.read()
+
+setuptools.setup(
+ name="controlpi-graph",
+ version="0.1.0",
+ author="Graph-IT GmbH",
+ author_email="info@graph-it.com",
+ description="ControlPi Plugin for Graph Connections",
+ long_description=long_description,
+ long_description_content_type="text/markdown",
+ url="http://docs.graph-it.com/graphit/controlpi-graph",
+ 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",
+ ],
+)