Public Access
Weather forecast page, 16 elements per page, attribute paths, examples from the display
- Home Assistant attributes can be paths into lists (forecast.1.condition). - Date elements can show a day ahead (day offset 0-7). - Pages hold 16 elements (page format 6; the old formats are frozen at 8). Pages are reset in place (clearPage), not through a 4 KB temporary. - Verwachting page: today (icon, temperature, max/min) and the next 2 days with 7 x 7 icons (weer7 <condition>), from a template sensor (docs/home-assistant.md). - examples/home-pages.json is exported from the display with all pages and their icons, private entity id parts replaced by placeholders (tools/export_examples.py replaces tools/make_example_pages.py). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
839e86e8f1
commit
a6b946e17c
33 files changed
+1918
-1050
No files matched your search
@@ -73,6 +73,7 @@ void pageToJson(const DynamicPage &page, JsonObject out)
|
||||
o["bar_height"] = e.bar_height;
|
||||
o["bar_max"] = e.bar_max;
|
||||
o["bar_frame"] = e.bar_frame;
|
||||
o["day_offset"] = e.day_offset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +90,7 @@ static bool copyText(JsonVariantConst value, char *out, size_t size)
|
||||
|
||||
const char *pageFromJson(JsonVariantConst in, DynamicPage &page)
|
||||
{
|
||||
page = DynamicPage();
|
||||
clearPage(page);
|
||||
JsonArrayConst slots = in["slots"];
|
||||
JsonArrayConst elements = in["elements"];
|
||||
if (slots.size() > (size_t)PAGE_SLOTS)
|
||||
@@ -136,6 +137,7 @@ const char *pageFromJson(JsonVariantConst in, DynamicPage &page)
|
||||
e.bar_height = constrain(o["bar_height"] | 3, 0, 255);
|
||||
e.bar_max = o["bar_max"] | 100.0f;
|
||||
e.bar_frame = o["bar_frame"] | true;
|
||||
e.day_offset = constrain(o["day_offset"] | 0, -1, DAY_OFFSET_MAX + 1); // out of range: validatePage says so
|
||||
if (!copyText(o["map"], e.map, sizeof(e.map)))
|
||||
return "The list of texts is too long (63 characters)";
|
||||
const char *target = o["target"] | "";
|
||||
|
||||
Reference in new issue
Block a user