You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importboardimportdisplayioimporti2cdisplaybusimportadafruit_displayio_ssd1306fromtimeimportsleepimporttracebackdisplayio.release_displays()
i2cBus=board.I2C()
display_bus=i2cdisplaybus.I2CDisplayBus(i2cBus, device_address=0x3C)
WIDTH=128HEIGHT=32# create the display and put it to sleepdisplay=adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT)
print(f"Wake> {display.is_awake}")
try:
print("Sleep")
display.sleep()
print("No error")
exceptException:
print(traceback.format_exc())
sleep(.5)
print(f"Wake> {display.is_awake}")
try:
print("Wakey")
display.wake()
print("No error")
exceptException:
print(traceback.format_exc())
Results:
WORKDIR ‹venv›
╰─$ py brokesleep.py
Wake> True
Sleep
Traceback (most recent call last):
File "WORKDIR/brokesleep.py", line 21, in <module>
display.sleep()
File "WORKDIR/venv/lib/python3.9/site-packages/adafruit_displayio_ssd1306.py", line 130, in sleep
self.bus.send(0xAE, b"") # 0xAE = display off, sleep mode
File "WORKDIR/venv/lib/python3.9/site-packages/i2cdisplaybus/__init__.py", line 90, in send
self._send(DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, bytes([command] + data))
TypeError: can only concatenate list (not "bytes") to list
Wake> True
Wakey
No error
Closing this, I believe it was resolved by adafruit/Adafruit_Blinka_Displayio#142. Please re-open or create new issue if you still have this problem under latest versions.
Duplicating #42 since it cannot be re-opened.
This is effectively the same as adafruit/Adafruit_CircuitPython_DisplayIO_SH1106#17, with the same repro code.
Results:
A fix in the Blinka
displayio
adafruit/Adafruit_Blinka_Displayio#137The text was updated successfully, but these errors were encountered: