groups and scenes 2
This commit is contained in:
@@ -79,7 +79,7 @@ class SceneExecutionResponse(BaseModel):
|
||||
# GROUPS ENDPOINTS
|
||||
# ============================================================================
|
||||
|
||||
@router.get("/groups", response_model=list[GroupResponse])
|
||||
@router.get("/groups", response_model=list[GroupResponse], tags=["groups"])
|
||||
async def list_groups() -> list[GroupResponse]:
|
||||
"""
|
||||
List all available groups.
|
||||
@@ -128,7 +128,7 @@ async def list_groups() -> list[GroupResponse]:
|
||||
)
|
||||
|
||||
|
||||
@router.get("/groups/{group_id}", response_model=GroupResponse)
|
||||
@router.get("/groups/{group_id}", response_model=GroupResponse, tags=["groups"])
|
||||
async def get_group(group_id: str) -> GroupResponse:
|
||||
"""
|
||||
Get details for a specific group.
|
||||
@@ -186,7 +186,7 @@ async def get_group(group_id: str) -> GroupResponse:
|
||||
)
|
||||
|
||||
|
||||
@router.post("/groups/{group_id}/set", status_code=status.HTTP_202_ACCEPTED)
|
||||
@router.post("/groups/{group_id}/set", status_code=status.HTTP_202_ACCEPTED, tags=["groups"])
|
||||
async def set_group(group_id: str, request: GroupSetRequest) -> dict[str, Any]:
|
||||
"""
|
||||
Set state for all devices in a group.
|
||||
@@ -270,7 +270,7 @@ async def set_group(group_id: str, request: GroupSetRequest) -> dict[str, Any]:
|
||||
# SCENES ENDPOINTS
|
||||
# ============================================================================
|
||||
|
||||
@router.get("/scenes", response_model=list[SceneResponse])
|
||||
@router.get("/scenes", response_model=list[SceneResponse], tags=["scenes"])
|
||||
async def list_scenes() -> list[SceneResponse]:
|
||||
"""
|
||||
List all available scenes.
|
||||
@@ -301,7 +301,7 @@ async def list_scenes() -> list[SceneResponse]:
|
||||
)
|
||||
|
||||
|
||||
@router.get("/scenes/{scene_id}", response_model=SceneResponse)
|
||||
@router.get("/scenes/{scene_id}", response_model=SceneResponse, tags=["scenes"])
|
||||
async def get_scene(scene_id: str) -> SceneResponse:
|
||||
"""
|
||||
Get details for a specific scene.
|
||||
@@ -341,7 +341,7 @@ async def get_scene(scene_id: str) -> SceneResponse:
|
||||
)
|
||||
|
||||
|
||||
@router.post("/scenes/{scene_id}/run", response_model=SceneExecutionResponse)
|
||||
@router.post("/scenes/{scene_id}/run", response_model=SceneExecutionResponse, tags=["scenes"])
|
||||
async def run_scene(scene_id: str, request: SceneRunRequest | None = None) -> SceneExecutionResponse:
|
||||
"""
|
||||
Execute a scene.
|
||||
|
||||
Reference in New Issue
Block a user