diff --git a/esphome/chore-tracker-esphome.yaml b/esphome/chore-tracker-esphome.yaml index 1a17561..d014048 100644 --- a/esphome/chore-tracker-esphome.yaml +++ b/esphome/chore-tracker-esphome.yaml @@ -891,6 +891,7 @@ lvgl: y: -34 text: "󰋣" text_font: font_mdi_small + text_color: 0x4D96FF - label: align: CENTER y: 17 @@ -927,6 +928,7 @@ lvgl: y: -34 text: "󰦩" text_font: font_mdi_small + text_color: 0x4D96FF - label: align: CENTER y: 17 @@ -963,6 +965,7 @@ lvgl: y: -34 text: "󰆫" text_font: font_mdi_small + text_color: 0x4D96FF - label: align: CENTER y: 17 @@ -999,6 +1002,7 @@ lvgl: y: -34 text: "󱜜" text_font: font_mdi_small + text_color: 0x4D96FF - label: align: CENTER y: 17 @@ -1130,6 +1134,7 @@ lvgl: y: -34 text: "󰐂" text_font: font_mdi_small + text_color: 0xC77DFF - label: align: CENTER y: 17 @@ -1166,6 +1171,7 @@ lvgl: y: -34 text: "󰇷" text_font: font_mdi_small + text_color: 0xC77DFF - label: align: CENTER y: 17 @@ -1297,6 +1303,7 @@ lvgl: y: -34 text: "󰊩" text_font: font_mdi_small + text_color: 0xFF6B9D - label: align: CENTER y: 17 @@ -1333,6 +1340,7 @@ lvgl: y: -34 text: "󰇷" text_font: font_mdi_small + text_color: 0xFF6B9D - label: align: CENTER y: 17 @@ -1369,6 +1377,7 @@ lvgl: y: -34 text: "󰇷" text_font: font_mdi_small + text_color: 0xFF6B9D - label: align: CENTER y: 17 diff --git a/esphome/chore-tracker/generate.py b/esphome/chore-tracker/generate.py index 62fb622..0e7d9ca 100644 --- a/esphome/chore-tracker/generate.py +++ b/esphome/chore-tracker/generate.py @@ -49,8 +49,15 @@ def eid(kid: dict, chore: dict) -> str: def ha_switch(kid: dict, chore: dict) -> str: return f"switch.chore_tracker_{eid(kid, chore)}" +# mdi:checkbox-marked-circle-outline — safe default if icon is omitted +DEFAULT_ICON = "\U000F0133" + def get_chores(kid: dict) -> list: - return kid["chores"] + chores = kid["chores"] + for c in chores: + if "icon" not in c: + c["icon"] = DEFAULT_ICON + return chores # ───────────────────────────────────────────────────────────────────────────── @@ -461,6 +468,7 @@ def _gen_lvgl_pages(kids: list) -> str: y: {icon_y} text: "{chore['icon']}" text_font: font_mdi_small + text_color: 0x{kid['color']} - label: align: CENTER y: {label_y} @@ -900,6 +908,12 @@ def main(): print(" Add a 'chores:' list under each kid in chores_config.yaml") sys.exit(1) + # Warn about missing icons (will use default, not crash) + for k in kids: + for c in k.get("chores", []): + if "icon" not in c: + print(f"⚠️ {k['name']} / '{c['name']}' has no icon — using default") + total_chores = sum(len(get_chores(k)) for k in kids) print(f"✅ Config loaded: {len(kids)} kid(s), {total_chores} total chores") for k in kids: