From 48b11c85f5c58fc1925cbc5353de869b0129d9c8 Mon Sep 17 00:00:00 2001 From: Dargus Date: Sun, 26 May 2024 21:45:29 -0700 Subject: [PATCH 1/2] Fixes issue 17 - sleep() throws error b"" does not pass properly to the i2cdisplay function as it tries to concatenate a list with a byte string. --- adafruit_displayio_sh1106.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_displayio_sh1106.py b/adafruit_displayio_sh1106.py index 74d9ecf..a1a7b54 100644 --- a/adafruit_displayio_sh1106.py +++ b/adafruit_displayio_sh1106.py @@ -108,7 +108,7 @@ def sleep(self) -> None: 4) The MP can access (update) the built-in display RAM """ if self._is_awake: - self.bus.send(0xAE, b"") # 0xAE = display off, sleep mode + self.bus.send(0xAE, [0x00]) # 0xAE = display off, sleep mode self._is_awake = False def wake(self) -> None: @@ -116,5 +116,5 @@ def wake(self) -> None: Wake display from sleep mode """ if not self._is_awake: - self.bus.send(0xAF, b"") # 0xAF = display on + self.bus.send(0xAF, [0x00]) # 0xAF = display on self._is_awake = True From 16408869a7da2c0569a1b7f74c80ec7a06f82c81 Mon Sep 17 00:00:00 2001 From: Dargus Date: Wed, 29 May 2024 12:55:21 -0700 Subject: [PATCH 2/2] Removed extra null byte being sent on displayio_sh1106 Removed extra null byte being sent to the bus. --- adafruit_displayio_sh1106.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_displayio_sh1106.py b/adafruit_displayio_sh1106.py index a1a7b54..79a00b0 100644 --- a/adafruit_displayio_sh1106.py +++ b/adafruit_displayio_sh1106.py @@ -108,7 +108,7 @@ def sleep(self) -> None: 4) The MP can access (update) the built-in display RAM """ if self._is_awake: - self.bus.send(0xAE, [0x00]) # 0xAE = display off, sleep mode + self.bus.send(0xAE, []) # 0xAE = display off, sleep mode self._is_awake = False def wake(self) -> None: @@ -116,5 +116,5 @@ def wake(self) -> None: Wake display from sleep mode """ if not self._is_awake: - self.bus.send(0xAF, [0x00]) # 0xAF = display on + self.bus.send(0xAF, []) # 0xAF = display on self._is_awake = True