new layout + 200px status images
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user