Initial commit: Paperwall, a standalone e-ink dashboard
Navidrome now-playing, clock, and weather for a Waveshare epd4in0e panel, with a local web UI and install/uninstall scripts for the Pi.
This commit is contained in:
commit
66464291e1
33 files changed
+2215
No files matched your search
@@ -0,0 +1,28 @@
|
||||
"""Display driver interface.
|
||||
|
||||
A driver only needs to do three things: get ready, put an image on the panel,
|
||||
and go to sleep to save power. `EPD4in0eDisplay` talks to the real Waveshare
|
||||
hardware; `MockDisplay` is a drop-in stand-in for developing off the Pi.
|
||||
"""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
||||
class Display(ABC):
|
||||
resolution: tuple[int, int]
|
||||
|
||||
@abstractmethod
|
||||
def init(self) -> None:
|
||||
"""Prepare the panel for writing (called once at startup, and again
|
||||
after every sleep since most EPDs need re-initializing)."""
|
||||
|
||||
@abstractmethod
|
||||
def show(self, image: Image.Image) -> None:
|
||||
"""Push a full-resolution image to the panel. This is always a full
|
||||
refresh on this hardware -- there is no partial-refresh path."""
|
||||
|
||||
@abstractmethod
|
||||
def sleep(self) -> None:
|
||||
"""Put the panel into low-power mode between updates."""
|
||||
Reference in new issue
Block a user