Public Access
Add dynamic pages with clock, date, Home Assistant values and fonts
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>
This commit is contained in:
1 parent
1d3b084de1
commit
0411804a2f
49 files changed
+3058
-331
No files matched your search
+7
-4
@@ -3,13 +3,13 @@
|
||||
// The objects and the actions on them are in app.cpp; this file only sets the order.
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "app.h"
|
||||
#include "config.h"
|
||||
#include "display/bitmap_store.h"
|
||||
#include "logic/status_led.h"
|
||||
#include "nano_link/nano_flash_bridge.h"
|
||||
#include "net/ha_api.h"
|
||||
#include "net/home_assistant.h"
|
||||
#include "net/wifi_ota.h"
|
||||
#include "system/boot_target.h"
|
||||
@@ -79,15 +79,18 @@ void loop()
|
||||
homeAssistantLoop();
|
||||
webUiLoop();
|
||||
appLoop();
|
||||
// Home Assistant values of the shown page (can block about 3 s once a minute)
|
||||
if (haApiLoop(wifiConnected()))
|
||||
controller.pageChanged();
|
||||
|
||||
// While the Nano is being flashed, nothing else may talk to it
|
||||
if (flashBridge.handle())
|
||||
return;
|
||||
status.loop(); // changed flip settings, once the display is on
|
||||
|
||||
struct tm now = {};
|
||||
bool time_valid = getLocalTime(&now, 0);
|
||||
controller.update(millis(), time_valid, now.tm_hour, now.tm_min, wifiConnected());
|
||||
LocalTime now;
|
||||
bool time_valid = appLocalTime(now);
|
||||
controller.update(millis(), time_valid, now, wifiConnected());
|
||||
|
||||
bool led = appSettings().status_led && statusLedLevel(millis(), wifiConnected(), nano.isOn());
|
||||
digitalWrite(LED_PIN, led);
|
||||
|
||||
Reference in new issue
Block a user