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,35 @@
|
||||
"""Development stand-in for the real panel: saves each frame as a PNG instead
|
||||
of writing to hardware, so the scheduler/rendering logic can be exercised off
|
||||
the Pi.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from display import Display
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MockDisplay(Display):
|
||||
def __init__(self, resolution: tuple[int, int], out_dir: str = "./mock_output"):
|
||||
self.resolution = resolution
|
||||
self.out_dir = Path(out_dir)
|
||||
self.out_dir.mkdir(parents=True, exist_ok=True)
|
||||
self._frame_count = 0
|
||||
|
||||
def init(self) -> None:
|
||||
logger.info("MockDisplay initialized (resolution=%s)", self.resolution)
|
||||
|
||||
def show(self, image: Image.Image) -> None:
|
||||
self._frame_count += 1
|
||||
path = self.out_dir / "current.png"
|
||||
image.save(path)
|
||||
history_path = self.out_dir / f"frame_{self._frame_count:04d}.png"
|
||||
image.save(history_path)
|
||||
logger.info("MockDisplay: wrote frame to %s", path)
|
||||
|
||||
def sleep(self) -> None:
|
||||
logger.info("MockDisplay: sleep")
|
||||
Reference in new issue
Block a user