From: Benjamin Braatz Date: Tue, 5 Oct 2021 19:15:43 +0000 (+0200) Subject: Rotate messages before sending to graph. X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=c27015dc8696d035815ea6d2620de90492aa93c6;p=graphit%2Fcontrolpi-graph.git Rotate messages before sending to graph. --- diff --git a/controlpi_plugins/graph.py b/controlpi_plugins/graph.py index 7e4ffad..f13d9c1 100644 --- a/controlpi_plugins/graph.py +++ b/controlpi_plugins/graph.py @@ -51,9 +51,10 @@ class Graph(BasePlugin): if comessage_guid: await self._call('verknuepfe', [comessage_guid, self._coroot_guid]) - await self._call('setze', [comessage_guid, 'comessage_json', - json.dumps(self._messages)]) + messages = self._messages self._messages = [] + await self._call('setze', [comessage_guid, 'comessage_json', + json.dumps(messages)]) await self._call('setze', [comessage_guid, 'comessage_ready', True]) else: