new layout + 200px status images

This commit is contained in:
Mikkeli Matlock
2026-02-16 14:52:20 +09:00
parent 8fd0201777
commit 227f66dbff
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ connected ESP32 dashboard client on port 8766.
Protocol: Protocol:
Status image: Status image:
1. Text frame: {"type":"status_image","width":120,"height":120} 1. Text frame: {"type":"status_image","width":200,"height":200}
2. Binary frame: 1-bit monochrome bitmap 2. Binary frame: 1-bit monochrome bitmap
Alarm audio: Alarm audio:

View File

@@ -9,12 +9,12 @@ from PIL import Image
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
IMG_DIR = Path(__file__).parent / "assets" / "img" IMG_DIR = Path(__file__).parent / "assets" / "img"
STATUS_IMG_SIZE = 120 STATUS_IMG_SIZE = 200
MONOCHROME_THRESHOLD = 180 MONOCHROME_THRESHOLD = 180
def load_status_image(path: Path) -> bytes: def load_status_image(path: Path) -> bytes:
"""Load a PNG, convert to 1-bit 120x120 monochrome bitmap (MSB-first, black=1). """Load a PNG, convert to 1-bit 200x200 monochrome bitmap (MSB-first, black=1).
Transparent pixels are composited onto white so they don't render as black. Transparent pixels are composited onto white so they don't render as black.
""" """