Split adaptive value source into explicit adaptive_time and adaptive_scene types
Replace single "adaptive" type with adaptive_mode sub-selector by two distinct source types in the dropdown. Removes the adaptive_mode field entirely — the source_type itself carries the mode. Clearer UX with "Adaptive (Time of Day)" and "Adaptive (Scene)" as separate options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,6 @@ def _to_response(source: ValueSource) -> ValueSourceResponse:
|
||||
mode=d.get("mode"),
|
||||
sensitivity=d.get("sensitivity"),
|
||||
smoothing=d.get("smoothing"),
|
||||
adaptive_mode=d.get("adaptive_mode"),
|
||||
schedule=d.get("schedule"),
|
||||
picture_source_id=d.get("picture_source_id"),
|
||||
scene_behavior=d.get("scene_behavior"),
|
||||
@@ -56,7 +55,7 @@ def _to_response(source: ValueSource) -> ValueSourceResponse:
|
||||
@router.get("/api/v1/value-sources", response_model=ValueSourceListResponse, tags=["Value Sources"])
|
||||
async def list_value_sources(
|
||||
_auth: AuthRequired,
|
||||
source_type: Optional[str] = Query(None, description="Filter by source_type: static, animated, or audio"),
|
||||
source_type: Optional[str] = Query(None, description="Filter by source_type: static, animated, audio, adaptive_time, or adaptive_scene"),
|
||||
store: ValueSourceStore = Depends(get_value_source_store),
|
||||
):
|
||||
"""List all value sources, optionally filtered by type."""
|
||||
@@ -90,7 +89,6 @@ async def create_value_source(
|
||||
sensitivity=data.sensitivity,
|
||||
smoothing=data.smoothing,
|
||||
description=data.description,
|
||||
adaptive_mode=data.adaptive_mode,
|
||||
schedule=data.schedule,
|
||||
picture_source_id=data.picture_source_id,
|
||||
scene_behavior=data.scene_behavior,
|
||||
@@ -137,7 +135,6 @@ async def update_value_source(
|
||||
sensitivity=data.sensitivity,
|
||||
smoothing=data.smoothing,
|
||||
description=data.description,
|
||||
adaptive_mode=data.adaptive_mode,
|
||||
schedule=data.schedule,
|
||||
picture_source_id=data.picture_source_id,
|
||||
scene_behavior=data.scene_behavior,
|
||||
|
||||
Reference in New Issue
Block a user