187 files
This commit is contained in:
@@ -346,6 +346,9 @@ class Chore:
|
||||
# and counts pending completions too, so a slow approval never hands the
|
||||
# child a spare go.
|
||||
weekly_target: int = 0
|
||||
# Extra points paid once a week when the weekly target is reached (#1044),
|
||||
# on top of each completion's own points. 0 = no bonus.
|
||||
weekly_target_bonus: int = 0
|
||||
completion_sound: str = "coin" # Sound to play on completion
|
||||
# Optional picture for the chore. Text-free pre-reader mode (#683) needs
|
||||
# one per chore; everything else falls back to the time-of-day icon.
|
||||
@@ -362,9 +365,11 @@ class Chore:
|
||||
schedule_mode: str = "specific_days"
|
||||
due_days: list[str] = field(default_factory=list) # Mode A: days to show chore
|
||||
# Mode B fields
|
||||
recurrence: str = "weekly" # every_2_days | weekly | every_2_weeks | monthly | every_3_months | every_6_months
|
||||
recurrence: str = (
|
||||
"weekly" # every_<N>_days (N 2-365) | weekly | every_2_weeks | monthly | every_3_months | every_6_months
|
||||
)
|
||||
recurrence_day: str = "" # optional: which day of week for weekly/every_2_weeks
|
||||
recurrence_start: str = "" # optional: ISO date anchor for every_2_days
|
||||
recurrence_start: str = "" # optional: ISO date anchor for every_<N>_days
|
||||
first_occurrence_mode: str = "available_immediately" # available_immediately | wait_for_first_occurrence
|
||||
# Dynamic visibility
|
||||
visibility_entity: str = "" # optional: entity_id to check for visibility
|
||||
@@ -479,6 +484,7 @@ class Chore:
|
||||
claim_allowance_minutes=max(0, int(data.get("claim_allowance_minutes", 0) or 0)),
|
||||
daily_limit=data.get("daily_limit", 1),
|
||||
weekly_target=int(data.get("weekly_target", 0) or 0),
|
||||
weekly_target_bonus=max(0, int(data.get("weekly_target_bonus", 0) or 0)),
|
||||
completion_sound=data.get("completion_sound", "coin"),
|
||||
icon=str(data.get("icon", "") or ""),
|
||||
image_url=str(data.get("image_url", "") or ""),
|
||||
@@ -552,6 +558,7 @@ class Chore:
|
||||
"claim_allowance_minutes": self.claim_allowance_minutes,
|
||||
"daily_limit": self.daily_limit,
|
||||
"weekly_target": self.weekly_target,
|
||||
"weekly_target_bonus": self.weekly_target_bonus,
|
||||
"completion_sound": self.completion_sound,
|
||||
"icon": self.icon,
|
||||
"image_url": self.image_url,
|
||||
|
||||
Reference in New Issue
Block a user