- Add `tags: List[str]` field to all 13 entity types (devices, output targets, CSS sources, picture sources, audio sources, value sources, sync clocks, automations, scene presets, capture/audio/PP/pattern templates) - Update all stores, schemas, and route handlers for tag CRUD - Add GET /api/v1/tags endpoint aggregating unique tags across all stores - Create TagInput component with chip display, autocomplete dropdown, keyboard navigation, and API-backed suggestions - Display tag chips on all entity cards (searchable via existing text filter) - Add tag input to all 14 editor modals with dirty check support - Add CSS styles and i18n keys (en/ru/zh) for tag UI - Also includes code review fixes: thread safety, perf, store dedup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
1.9 KiB
Python
46 lines
1.9 KiB
Python
"""Sync clock schemas (CRUD + control)."""
|
||
|
||
from datetime import datetime
|
||
from typing import List, Optional
|
||
|
||
from pydantic import BaseModel, Field
|
||
|
||
|
||
class SyncClockCreate(BaseModel):
|
||
"""Request to create a synchronization clock."""
|
||
|
||
name: str = Field(description="Clock name", min_length=1, max_length=100)
|
||
speed: float = Field(default=1.0, description="Speed multiplier (0.1–10.0)", ge=0.1, le=10.0)
|
||
description: Optional[str] = Field(None, description="Optional description", max_length=500)
|
||
tags: List[str] = Field(default_factory=list, description="User-defined tags")
|
||
|
||
|
||
class SyncClockUpdate(BaseModel):
|
||
"""Request to update a synchronization clock."""
|
||
|
||
name: Optional[str] = Field(None, description="Clock name", min_length=1, max_length=100)
|
||
speed: Optional[float] = Field(None, description="Speed multiplier (0.1–10.0)", ge=0.1, le=10.0)
|
||
description: Optional[str] = Field(None, description="Optional description", max_length=500)
|
||
tags: Optional[List[str]] = None
|
||
|
||
|
||
class SyncClockResponse(BaseModel):
|
||
"""Synchronization clock response."""
|
||
|
||
id: str = Field(description="Clock ID")
|
||
name: str = Field(description="Clock name")
|
||
speed: float = Field(description="Speed multiplier")
|
||
description: Optional[str] = Field(None, description="Description")
|
||
tags: List[str] = Field(default_factory=list, description="User-defined tags")
|
||
is_running: bool = Field(True, description="Whether clock is currently running")
|
||
elapsed_time: float = Field(0.0, description="Current elapsed time in seconds")
|
||
created_at: datetime = Field(description="Creation timestamp")
|
||
updated_at: datetime = Field(description="Last update timestamp")
|
||
|
||
|
||
class SyncClockListResponse(BaseModel):
|
||
"""List of synchronization clocks."""
|
||
|
||
clocks: List[SyncClockResponse] = Field(description="List of sync clocks")
|
||
count: int = Field(description="Number of clocks")
|