Public Access
The hardcoded clock is now the built-in dynamic page "Clock". A dynamic page has a background bitmap per time of day and up to 8 elements (clock, date, Home Assistant value, text), each with position, alignment, font and overlay. Pages are drawn on the ESP32, also for the web previews. - Pages tab in the web UI: page editor with drag and drop, font upload (TTF/OTF converted in the browser to the FDF1 dot font format) - Built-in fonts Small, Normal, Large and Full height (generated by tools/make_builtin_fonts.py), built-in bitmaps Pikachu and Pikachu yawning - Home Assistant values over the REST API (URL and token in the HA tab) - Settings version 4: evening settings removed (now time slots of the Clock page), old records are converted - HA Mode dropdown lists the dynamic pages and bitmaps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.7 KiB
C
31 lines
1.7 KiB
C
#pragma once
|
|
|
|
// Web UI of the clock firmware on port 80 (http://<ESP32 IP>/): live view of the display,
|
|
// choosing the page, dynamic pages and fonts, bitmaps (upload, draw, store), live mode,
|
|
// settings and Home Assistant. The page itself is in web/web_page.h.
|
|
//
|
|
// JSON API (bitmaps are 418 hex digits, see logic/bitmap_format.h):
|
|
// GET /api/status time, WiFi, firmware, Home Assistant, storage
|
|
// GET /api/screen what the dots show now {on, live, data}
|
|
// GET /api/bitmaps all bitmaps with data {storage, bitmaps:[{name, builtin, data}]}
|
|
// GET /api/bitmap?name= one bitmap {name, data}
|
|
// POST /api/bitmap store {name, data}
|
|
// POST /api/bitmap/delete {name}
|
|
// GET /api/pages dynamic pages {pages:[{name, builtin, page, data (preview)}]}
|
|
// POST /api/pages/save {name, page} (page format: web/page_json.h)
|
|
// POST /api/pages/delete {name}
|
|
// POST /api/pages/preview {page, time ("HH:MM", optional)} -> {data, boxes:[[x,y,w,h]]}
|
|
// GET /api/fonts {fonts:[{name, builtin, height}]}
|
|
// POST /api/fonts/save {name, data (hex, format of logic/font.h)}
|
|
// POST /api/fonts/delete {name}
|
|
// GET /api/ha/value?entity=&attribute= read a Home Assistant value now {value}
|
|
// POST /api/page {page: a dynamic page or bitmap name}
|
|
// POST /api/live show now {data}
|
|
// POST /api/live/stop
|
|
// GET /api/settings (the MQTT password and HA token are never sent, only *_set)
|
|
// POST /api/settings changed fields; {settings, restart}
|
|
// POST /api/restart
|
|
// POST /api/recovery
|
|
void webUiBegin();
|
|
void webUiLoop();
|