2026-10-15 19:43:59 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <ArduinoJson.h>
|
|
|
|
|
|
|
|
|
|
#include "logic/page.h"
|
|
|
|
|
|
|
|
|
|
// Dynamic pages (logic/page.h) as JSON for the web UI:
|
|
|
|
|
// {slots: [{start: "08:00", bitmap: "Pikachu"}],
|
|
|
|
|
// elements: [{type: "clock"|"date"|"ha"|"text", x, y, align: "left"|"center"|"right",
|
|
|
|
|
// overlay: "top"|"box"|"invert", font, format, language: "nl"|"en",
|
2026-10-15 21:01:14 +02:00
|
|
|
// decimals (-1 = as received), text, suffix, entity, attribute, factor,
|
2026-10-15 21:50:19 +02:00
|
|
|
// scroll_width, scroll_speed, target ("YYYY-MM-DDTHH:MM"),
|
|
|
|
|
// show: "number"|"duration"|"time"|"map", input_unit: "s"|"min"|"h",
|
|
|
|
|
// auto_unit, absolute, map}]}
|
2026-10-15 21:01:14 +02:00
|
|
|
// type also "countdown", "stopwatch", "image". Texts use the UTF-8 degree sign.
|
2026-10-15 19:43:59 +02:00
|
|
|
|
|
|
|
|
void pageToJson(const DynamicPage &page, JsonObject out);
|
|
|
|
|
// Returns nullptr or a message for the user. Validates the page (validatePage()).
|
|
|
|
|
const char *pageFromJson(JsonVariantConst in, DynamicPage &page);
|