Add auto-start targets feature with dashboard section

- Add auto_start boolean field to PictureTarget model (persisted per-target)
- Wire auto_start through API schemas, routes, and store
- Auto-start targets on server boot in main.py lifespan
- Add star toggle button on target cards (next to delete button)
- Add auto-start section on dashboard between performance and profiles
- Remove auto-start section from profiles tab

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 15:08:01 +03:00
parent 701eac19e5
commit d05b4b78f4
14 changed files with 131 additions and 8 deletions

View File

@@ -15,6 +15,7 @@ class PictureTarget:
created_at: datetime
updated_at: datetime
description: Optional[str] = None
auto_start: bool = False
def register_with_manager(self, manager) -> None:
"""Register this target with the processor manager. Subclasses override."""
@@ -25,12 +26,15 @@ class PictureTarget:
pass
def update_fields(self, *, name=None, device_id=None, picture_source_id=None,
settings=None, key_colors_settings=None, description=None) -> None:
settings=None, key_colors_settings=None, description=None,
auto_start=None) -> None:
"""Apply mutable field updates. Base handles common fields; subclasses handle type-specific ones."""
if name is not None:
self.name = name
if description is not None:
self.description = description
if auto_start is not None:
self.auto_start = auto_start
@property
def has_picture_source(self) -> bool:
@@ -44,6 +48,7 @@ class PictureTarget:
"name": self.name,
"target_type": self.target_type,
"description": self.description,
"auto_start": self.auto_start,
"created_at": self.created_at.isoformat(),
"updated_at": self.updated_at.isoformat(),
}