fix for 9.7" epaper display

This commit should fix any previous issues with the 9.7" epaper displays not showing the image correctly
This commit is contained in:
Ace 2020-10-09 11:25:11 +02:00
parent b53b42afd2
commit b6c2534644

View File

@ -23,6 +23,7 @@ class Display:
driver_path = 'inkycal.display.drivers.{}'.format(epaper_model) driver_path = 'inkycal.display.drivers.{}'.format(epaper_model)
driver = import_module(driver_path) driver = import_module(driver_path)
self._epaper = driver.EPD() self._epaper = driver.EPD()
self.model_name = epaper_model
except ImportError: except ImportError:
raise Exception('This module is not supported. Check your spellings?') raise Exception('This module is not supported. Check your spellings?')
@ -39,6 +40,10 @@ class Display:
if self.supports_colour == False: if self.supports_colour == False:
print('Initialising..', end = '') print('Initialising..', end = '')
epaper.init() epaper.init()
# For the 9.7" ePaper, the image needs to be flipped by 90 deg first
# The other displays flip the image automatically
if self.model_name == "9_in_7":
im_black.rotate(90, expand=True)
print('Updating display......', end = '') print('Updating display......', end = '')
epaper.display(epaper.getbuffer(im_black)) epaper.display(epaper.getbuffer(im_black))
print('Done') print('Done')