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

17 lines
803 B
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")}]}
// type also "countdown", "stopwatch", "image". 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);