This commit is contained in:
Benjamin Tayehanpour 2026-10-01 19:57:57 +00:00
parent 8796110721
commit cf1e1970a5

View file

@ -11,13 +11,13 @@ class display:
async def redraw(self, row = None): async def redraw(self, row = None):
if row == None: if row == None:
for row, line in enumerate(self.contents): for row, line in enumerate(self.contents):
await self.device.async_message(line, row) await self.device.async_message(line, row + 1)
else: else:
await self.device.async_message(self.contents[row], row) await self.device.async_message(self.contents[row - 1], row)
async def read(self, row): async def read(self, row):
return self.contents[row] return self.contents[row]
async 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.contents[row - 1] = f'{self.contents[row][:offset]}{data}{self.contents[row][offset+len(data):]}'
await self.redraw(row) await self.redraw(row)