#pragma once // The objects of the clock firmware and the actions the web UI and Home Assistant use. // main.cpp only decides the order of things at boot and in loop(). #include "BROSE9323.h" #include "display/frames.h" #include "display/status_screen.h" #include "logic/display_controller.h" #include "logic/settings.h" #include "nano_link/nano_link.h" extern NanoLink nano; extern BROSE9323 display; extern FlipdotFrames frames; extern StatusScreen status; extern DisplayController controller; // Settings: loaded at boot, changed in the web UI const Settings &appSettings(); void appLoadSettings(); // Validates, stores and applies. Returns nullptr or an error message. Sets // restart_needed when the change only works after a restart (Home Assistant). const char *appSaveSettings(const Settings &settings, bool &restart_needed); // The page shown during the day: PAGE_CLOCK or a bitmap name (stored in the settings) const char *appSelectPage(const char *name); // A bitmap was saved or deleted: redraw when it is the current page void appBitmapChanged(const char *name); // Live mode of the web UI void appShowLive(const uint8_t *bitmap); void appStopLive(); // Restart the ESP32 after `delay_ms` (so a web response can still be sent) void appRestartLater(uint32_t delay_ms); void appLoop();