Inkycal/inkycal/display/drivers/9_in_7.py

46 lines
1.0 KiB
Python
Raw Normal View History

"""
9.7" driver class
2023-06-03 16:16:07 +02:00
Copyright by aceinnolab
"""
from subprocess import run
2023-12-18 12:46:33 +01:00
2024-05-12 02:00:26 +02:00
from inkycal.settings import Settings
# Display resolution
2022-04-02 01:30:17 +02:00
EPD_WIDTH = 1200
EPD_HEIGHT = 825
2024-05-12 02:00:26 +02:00
settings = Settings()
2024-05-12 02:00:26 +02:00
command = f'sudo {settings.PARALLEL_DRIVER_PATH}/epd -{settings.VCOM} 0 {settings.IMAGE_FOLDER + "canvas.bmp"}'
2022-04-02 01:30:17 +02:00
class EPD:
2022-04-02 01:30:17 +02:00
def __init__(self):
"""9.7" epaper class"""
pass
2022-04-02 01:30:17 +02:00
def init(self):
pass
def display(self, command):
"""displays an image"""
try:
run_command = command.split()
run(run_command)
except:
print("oops, something didn't work right :/")
def getbuffer(self, image):
"""ad-hoc"""
image = image.rotate(90, expand=True)
2024-05-12 02:00:26 +02:00
image.convert('RGB').save(settings.IMAGE_FOLDER + 'canvas.bmp', 'BMP')
command = f'sudo {settings.PARALLEL_DRIVER_PATH}/epd -{settings.VCOM} 0 {settings.IMAGE_FOLDER + "canvas.bmp"}'
print(command)
2022-04-02 01:30:17 +02:00
return command
def sleep(self):
pass