From 103177d79f1c3c9209d064c919e6de38df76e5bf Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Wed, 26 Feb 2025 06:05:25 -0700 Subject: [PATCH] flashing stops if clicked --- pywmreceived.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pywmreceived.py b/pywmreceived.py index d79e9d4..89128ee 100755 --- a/pywmreceived.py +++ b/pywmreceived.py @@ -90,7 +90,10 @@ class Application(wmoo.Application): ic("") ic(f"sender: {sender}") ic(f"message: {message}") - self._flasher = 7 + if self.backlit: + self._flasher = 8 + else: + self._flasher = 7 def handle_sent_im_msg(self, account, recepient, message): """ @@ -154,6 +157,11 @@ class Application(wmoo.Application): self.draw_background() self.draw_all_text() + def backlight_off(self, event): + self._flasher = 0 + if self.backlit: + self.toggle_backlight(True) + def update(self): wmoo.Application.update(self) @@ -192,7 +200,7 @@ def main(): # 6x7 grey1=1 grey2=10 green1=18 green2=27 app.draw_background() app.draw_all_text() - app.addCallback(app.toggle_backlight, 'buttonrelease', area=(2,2,62,62)) + app.addCallback(app.backlight_off, 'buttonrelease', area=(2,2,62,62)) # Start the GLib main loop in a separate thread glib_thread = threading.Thread(target=run_glib_mainloop, daemon=True)