Add four animated Cyberpunk-style ESPHome pages

Netrunner HUD, self-solving breach protocol, optics boot-and-scan and a
split HUD with a mini breach matrix, all in the page rotation. The el512
display gains animated_pages / animation_interval (redraw ~15 fps while
shown), page_age_ms() as animation clock, and shift_rows() / invert_rect()
for glitch effects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-18 23:29:12 +02:00
1 parent 6d5e5315f0
commit 50ee17b3f6
7 files changed
+944 -4

No files matched your search

+12
View File
@@ -16,6 +16,8 @@ CONF_VS_PIN = "vs_pin"
CONF_ENABLE_PIN = "enable_pin"
CONF_LOW_POWER_PIN = "low_power_pin"
CONF_STILL_ALIVE_PAGE = "still_alive_page"
CONF_ANIMATED_PAGES = "animated_pages"
CONF_ANIMATION_INTERVAL = "animation_interval"
EL512Display = el512_ns.class_("EL512Display", display.DisplayBuffer)
@@ -35,6 +37,12 @@ CONFIG_SCHEMA = cv.All(
# Page (from `pages:`) that plays the Portal end-credits show; its
# lambda should call it.draw_still_alive() via id(...).
cv.Optional(CONF_STILL_ALIVE_PAGE): cv.use_id(display.DisplayPage),
# Pages that redraw every animation_interval while shown; their
# lambdas can use id(...).page_age_ms() as the animation clock.
cv.Optional(CONF_ANIMATED_PAGES): cv.ensure_list(cv.use_id(display.DisplayPage)),
cv.Optional(
CONF_ANIMATION_INTERVAL, default="66ms"
): cv.positive_time_period_milliseconds,
}
).extend(cv.polling_component_schema("1s")),
cv.has_at_most_one_key(CONF_PAGES, CONF_LAMBDA),
@@ -59,6 +67,10 @@ async def to_code(config):
if CONF_STILL_ALIVE_PAGE in config:
page = await cg.get_variable(config[CONF_STILL_ALIVE_PAGE])
cg.add(var.set_still_alive_page(page))
for page_id in config.get(CONF_ANIMATED_PAGES, []):
page = await cg.get_variable(page_id)
cg.add(var.add_animated_page(page))
cg.add(var.set_animation_interval(config[CONF_ANIMATION_INTERVAL].total_milliseconds))
if CONF_LAMBDA in config:
lambda_ = await cg.process_lambda(
config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void