From f845898768503105c413a549dd6371aa1eb094d6 Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Wed, 20 Oct 2021 16:26:23 +0200 Subject: [PATCH] Push 'connection opened' message to graph. --- controlpi_plugins/graph.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controlpi_plugins/graph.py b/controlpi_plugins/graph.py index b10d33e..9071f84 100644 --- a/controlpi_plugins/graph.py +++ b/controlpi_plugins/graph.py @@ -111,4 +111,13 @@ class Graph(BasePlugin): self._coroot_guid = await self._call('attributsknoten', ['coroot_name', self.conf['name']]) + comessage_guid = await self._call('erzeuge', ['comessage']) + if comessage_guid: + await self._call('verknuepfe', [comessage_guid, + self._coroot_guid]) + messages = [Message(self.name, {'event': 'connection opened'})] + await self._call('setze', [comessage_guid, 'comessage_json', + json.dumps(messages)]) + await self._call('setze', [comessage_guid, 'comessage_ready', + True]) await self._close() -- 2.34.1