Replace auto-start with startup automation, add card colors to dashboard

- Add `startup` automation condition type that activates on server boot,
  replacing the per-target `auto_start` flag
- Remove `auto_start` field from targets, scene snapshots, and all API layers
- Remove auto-start UI section and star buttons from dashboard and target cards
- Remove `color` field from scene presets (backend, API, modal, frontend)
- Add card color support to scene preset cards (color picker + border style)
- Show localStorage-backed card colors on all dashboard cards (targets,
  automations, sync clocks, scene presets)
- Fix card color picker updating wrong card when duplicate data attributes
  exist by using closest() from picker wrapper instead of global querySelector
- Add sync clocks step to Sources tab tutorial
- Bump SW cache v9 → v10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 01:09:27 +03:00
parent f08117eb7b
commit fddbd771f2
28 changed files with 78 additions and 211 deletions

View File

@@ -24,6 +24,7 @@ from wled_controller.storage.automation import (
Condition,
DisplayStateCondition,
MQTTCondition,
StartupCondition,
SystemIdleCondition,
TimeOfDayCondition,
WebhookCondition,
@@ -70,6 +71,8 @@ def _condition_from_schema(s: ConditionSchema) -> Condition:
return WebhookCondition(
token=s.token or secrets.token_hex(16),
)
if s.condition_type == "startup":
return StartupCondition()
raise ValueError(f"Unknown condition type: {s.condition_type}")

View File

@@ -105,7 +105,7 @@ def _target_to_response(target) -> PictureTargetResponse:
adaptive_fps=target.adaptive_fps,
protocol=target.protocol,
description=target.description,
auto_start=target.auto_start,
created_at=target.created_at,
updated_at=target.updated_at,
)
@@ -117,7 +117,7 @@ def _target_to_response(target) -> PictureTargetResponse:
picture_source_id=target.picture_source_id,
key_colors_settings=_kc_settings_to_schema(target.settings),
description=target.description,
auto_start=target.auto_start,
created_at=target.created_at,
updated_at=target.updated_at,
)
@@ -127,7 +127,7 @@ def _target_to_response(target) -> PictureTargetResponse:
name=target.name,
target_type=target.target_type,
description=target.description,
auto_start=target.auto_start,
created_at=target.created_at,
updated_at=target.updated_at,
)
@@ -169,7 +169,6 @@ async def create_target(
picture_source_id=data.picture_source_id,
key_colors_settings=kc_settings,
description=data.description,
auto_start=data.auto_start,
)
# Register in processor manager
@@ -288,7 +287,6 @@ async def update_target(
protocol=data.protocol,
key_colors_settings=kc_settings,
description=data.description,
auto_start=data.auto_start,
)
# Detect KC brightness VS change (inside key_colors_settings)

View File

@@ -37,14 +37,12 @@ def _preset_to_response(preset: ScenePreset) -> ScenePresetResponse:
id=preset.id,
name=preset.name,
description=preset.description,
color=preset.color,
targets=[{
"target_id": t.target_id,
"running": t.running,
"color_strip_source_id": t.color_strip_source_id,
"brightness_value_source_id": t.brightness_value_source_id,
"fps": t.fps,
"auto_start": t.auto_start,
} for t in preset.targets],
order=preset.order,
created_at=preset.created_at,
@@ -76,7 +74,6 @@ async def create_scene_preset(
id=f"scene_{uuid.uuid4().hex[:8]}",
name=data.name,
description=data.description,
color=data.color,
targets=targets,
order=store.count(),
created_at=now,
@@ -143,7 +140,6 @@ async def update_scene_preset(
preset_id,
name=data.name,
description=data.description,
color=data.color,
order=data.order,
)
except ValueError as e:

View File

@@ -65,7 +65,6 @@ class PictureTargetCreate(BaseModel):
picture_source_id: str = Field(default="", description="Picture source ID (for key_colors targets)")
key_colors_settings: Optional[KeyColorsSettingsSchema] = Field(None, description="Key colors settings (for key_colors targets)")
description: Optional[str] = Field(None, description="Optional description", max_length=500)
auto_start: bool = Field(default=False, description="Auto-start on server boot")
class PictureTargetUpdate(BaseModel):
@@ -86,7 +85,6 @@ class PictureTargetUpdate(BaseModel):
picture_source_id: Optional[str] = Field(None, description="Picture source ID (for key_colors targets)")
key_colors_settings: Optional[KeyColorsSettingsSchema] = Field(None, description="Key colors settings (for key_colors targets)")
description: Optional[str] = Field(None, description="Optional description", max_length=500)
auto_start: Optional[bool] = Field(None, description="Auto-start on server boot")
class PictureTargetResponse(BaseModel):
@@ -109,7 +107,6 @@ class PictureTargetResponse(BaseModel):
picture_source_id: str = Field(default="", description="Picture source ID (key_colors)")
key_colors_settings: Optional[KeyColorsSettingsSchema] = Field(None, description="Key colors settings")
description: Optional[str] = Field(None, description="Description")
auto_start: bool = Field(default=False, description="Auto-start on server boot")
created_at: datetime = Field(description="Creation timestamp")
updated_at: datetime = Field(description="Last update timestamp")

View File

@@ -12,7 +12,6 @@ class TargetSnapshotSchema(BaseModel):
color_strip_source_id: str = ""
brightness_value_source_id: str = ""
fps: int = 30
auto_start: bool = False
class ScenePresetCreate(BaseModel):
@@ -20,7 +19,6 @@ class ScenePresetCreate(BaseModel):
name: str = Field(description="Preset name", min_length=1, max_length=100)
description: str = Field(default="", max_length=500)
color: str = Field(default="#4fc3f7", description="Card accent color")
target_ids: Optional[List[str]] = Field(None, description="Target IDs to capture (all if omitted)")
@@ -29,7 +27,6 @@ class ScenePresetUpdate(BaseModel):
name: Optional[str] = Field(None, min_length=1, max_length=100)
description: Optional[str] = Field(None, max_length=500)
color: Optional[str] = None
order: Optional[int] = None
@@ -39,7 +36,6 @@ class ScenePresetResponse(BaseModel):
id: str
name: str
description: str
color: str
targets: List[TargetSnapshotSchema]
order: int
created_at: datetime