Files
Flipdot-display/src/esp32/web/page_json.h
T

22 lines
1.2 KiB
C
Raw Normal View History

#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",
// decimals (-1 = as received), text, suffix, entity, attribute, factor,
// scroll_width, scroll_speed, target ("YYYY-MM-DDTHH:MM"),
// show: "number"|"duration"|"time"|"map", input_unit: "s"|"min"|"h",
2026-10-20 17:52:25 +02:00
// auto_unit, absolute, map, bar_width, bar_height, bar_max, bar_frame,
// day_offset}]}
// type also "countdown", "stopwatch", "image", "bar", "life". Game of Life elements also
// have start: "random"|"pattern"|"rotate"|"shuffle" and generations (0: no limit); the
// other fields mean what logic/page.h says. Texts use the UTF-8 degree sign.
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);