Refactor chore tracker for new kids: Emma, Liam, and Zoe
- Updated dashboard YAML to reflect new kids and their chores. - Modified chores configuration to include new kids with appropriate icons and settings. - Adjusted generation script to handle new MDI glyphs for icons. - Revised Home Assistant integration to support new kids, including input buttons and automation for chores. - Ensured all references to old kids (Jordyn, Declan, Chloe) are replaced with new names and corresponding logic.
This commit is contained in:
@@ -122,6 +122,13 @@ def gen_esphome(cfg: dict) -> str:
|
||||
lvgl_pages = _gen_lvgl_pages(kids)
|
||||
scripts = _gen_scripts(kids)
|
||||
|
||||
# Collect all unique MDI glyphs used (avatars + chore icons)
|
||||
all_glyphs = sorted(set(
|
||||
[k["avatar"] for k in kids] +
|
||||
[c["icon"] for k in kids for c in get_chores(k)]
|
||||
))
|
||||
glyphs_str = "".join(all_glyphs)
|
||||
|
||||
return f"""\
|
||||
################################################################################
|
||||
# chore-tracker-esphome.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
||||
@@ -255,6 +262,17 @@ font:
|
||||
- file: "fonts/Nunito-SemiBold.ttf"
|
||||
id: font_tiny
|
||||
size: 13
|
||||
# MDI icon font — used for chore icons and kid avatars
|
||||
- file: "fonts/materialdesignicons-webfont.ttf"
|
||||
id: font_mdi_large
|
||||
size: 48
|
||||
bpp: 4
|
||||
glyphs: {glyphs_str}
|
||||
- file: "fonts/materialdesignicons-webfont.ttf"
|
||||
id: font_mdi_small
|
||||
size: 32
|
||||
bpp: 4
|
||||
glyphs: {glyphs_str}
|
||||
|
||||
# ── Switches — backlight raw + one per chore per kid ─────────────────────────
|
||||
switch:
|
||||
@@ -336,7 +354,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
||||
align: CENTER
|
||||
y: -45
|
||||
text: "{kid['avatar']}"
|
||||
text_font: font_title
|
||||
text_font: font_mdi_large
|
||||
- label:
|
||||
align: CENTER
|
||||
y: 22
|
||||
@@ -443,7 +461,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
||||
align: CENTER
|
||||
y: {icon_y}
|
||||
text: "{chore['icon']}"
|
||||
text_font: font_med
|
||||
text_font: font_mdi_small
|
||||
- label:
|
||||
align: CENTER
|
||||
y: {label_y}
|
||||
@@ -475,7 +493,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
||||
width: {sidebar_w}
|
||||
align: TOP_MID
|
||||
text: "{kid['avatar']}"
|
||||
text_font: font_title
|
||||
text_font: font_mdi_large
|
||||
- label:
|
||||
x: 0
|
||||
y: 76
|
||||
|
||||
Reference in New Issue
Block a user