From 86482512a9a908b9e57e6d853de9ebb22fd09d59 Mon Sep 17 00:00:00 2001 From: tekktrik <89490472+tekktrik@users.noreply.github.com> Date: Thu, 17 Mar 2022 14:25:54 -0400 Subject: [PATCH 1/2] Change data param of send() to bytes --- adafruit_displayio_sh1107.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_displayio_sh1107.py b/adafruit_displayio_sh1107.py index a469c6b..07d3cba 100644 --- a/adafruit_displayio_sh1107.py +++ b/adafruit_displayio_sh1107.py @@ -196,7 +196,7 @@ def sleep(self): 4) The MP can access (update) the built-in display RAM """ if self._is_awake: - self.bus.send(int(0xAE), "") # 0xAE = display off, sleep mode + self.bus.send(int(0xAE), b"") # 0xAE = display off, sleep mode self._is_awake = False def wake(self): @@ -204,5 +204,5 @@ def wake(self): Wake display from sleep mode """ if not self._is_awake: - self.bus.send(int(0xAF), "") # 0xAF = display on + self.bus.send(int(0xAF), b"") # 0xAF = display on self._is_awake = True From c6ae98eba6d0090a8c5a19f6eb72756af40d81b7 Mon Sep 17 00:00:00 2001 From: tekktrik <89490472+tekktrik@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:06:51 -0400 Subject: [PATCH 2/2] Remove unnecessary int() usages --- adafruit_displayio_sh1107.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_displayio_sh1107.py b/adafruit_displayio_sh1107.py index 07d3cba..939372d 100644 --- a/adafruit_displayio_sh1107.py +++ b/adafruit_displayio_sh1107.py @@ -196,7 +196,7 @@ def sleep(self): 4) The MP can access (update) the built-in display RAM """ if self._is_awake: - self.bus.send(int(0xAE), b"") # 0xAE = display off, sleep mode + self.bus.send(0xAE, b"") # 0xAE = display off, sleep mode self._is_awake = False def wake(self): @@ -204,5 +204,5 @@ def wake(self): Wake display from sleep mode """ if not self._is_awake: - self.bus.send(int(0xAF), b"") # 0xAF = display on + self.bus.send(0xAF, b"") # 0xAF = display on self._is_awake = True