From e0e39244d1a171944230af6909c5365f76c2619c Mon Sep 17 00:00:00 2001 From: LeKeno <33626494+lekeno@users.noreply.github.com> Date: Wed, 2 May 2018 20:57:33 +0900 Subject: [PATCH] Add send_shape method --- edmcoverlay.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/edmcoverlay.py b/edmcoverlay.py index 66f1600..780f76c 100644 --- a/edmcoverlay.py +++ b/edmcoverlay.py @@ -137,6 +137,35 @@ def send_message(self, msgid, text, color, x, y, ttl=4, size="normal"): "x": x, "y": y, "ttl": ttl} self.send_raw(msg) + + def send_shape(self, shapeid, shape, color, fill, x, y, w, h, ttl): + """ + Send a shape + :param shapeid: + :param shape: + :param color: + :param fill: + :param x: + :param y: + :param w: + :param h: + :param ttl: + :return: + """ + if not self.connection: + ensure_service() + self.connect() + + msg = {"id": shapeid, + "shape": shape, + "color": color, + "fill": fill, + "x": x, "y": y, + "w": w, "h": h, + "ttl": ttl + } + self.send_raw(msg) + def debugconsole():