331 files

This commit is contained in:
Home Assistant Version Control
2026-10-04 05:26:42 +00:00
parent 22ba8b4648
commit c4d601bfba
331 changed files with 10227 additions and 50159 deletions
+7 -3
View File
@@ -2060,9 +2060,13 @@ class ChoresMixin:
self.storage.upsert_daily_progress(entry["child_id"], board["date"], entry["due"], entry["done"], cutoff)
await self.storage.async_save()
def daily_progress_state(self, days: int = 7) -> dict:
"""Last ``days`` days of stored done/total per child, today included live."""
board = self.get_today_board()
def daily_progress_state(self, days: int = 7, board: dict | None = None) -> dict:
"""Last ``days`` days of stored done/total per child, today included live.
``board`` is today's ``get_today_board()`` when the caller already has it.
"""
if board is None:
board = self.get_today_board()
today = date.fromisoformat(board["date"])
dates = [(today - timedelta(days=n)).isoformat() for n in range(days - 1, -1, -1)]
out = {}