From 259f59c0e55da8114ab659cc4e939834ebbbc258 Mon Sep 17 00:00:00 2001 From: Benjamin Tayehanpour Date: Sat, 26 Sep 2026 21:19:11 +0000 Subject: [PATCH] stuff --- display.py | 10 +++++----- fancontrol.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/display.py b/display.py index a00aeb3..68b38c6 100644 --- a/display.py +++ b/display.py @@ -8,16 +8,16 @@ class display: self.device = LCD(2, i2c_addr, True) self.contents = [""] * self.height - def redraw(self, row = None): + async def redraw(self, row = None): if row == None: for row, line in enumerate(self.contents): - self.device.async_message(row + 1, line) + await self.device.async_message(row + 1, line) else: - self.device.async_message(row + 1, self.contents[row]) + await self.device.async_message(row + 1, self.contents[row]) - def read(self, row): + async def read(self, row): return self.contents[row] - def write(self, row, data, offset = 0): + async def write(self, row, data, offset = 0): self.contents[row] = f'{self.contents[row][:offset]}{data}{self.contents[row][offset+len(data):]}' self.redraw(row) \ No newline at end of file diff --git a/fancontrol.py b/fancontrol.py index 0086438..e914803 100644 --- a/fancontrol.py +++ b/fancontrol.py @@ -6,8 +6,8 @@ from display import display def wheel_handler(dir): print(f"wheel: {dir}") - disp.write(1, f"wheel: {dir}") - disp.redraw() + loop = asyncio.get_event_loop() + loop.create_task(disp.write(1, f"wheel: {dir}")) def button_test(*args): print(args)