groups and scenes 2

This commit is contained in:
2025-11-13 21:54:09 +01:00
parent 5851414ba5
commit b82217a666

View File

@@ -79,7 +79,7 @@ class SceneExecutionResponse(BaseModel):
# GROUPS ENDPOINTS # GROUPS ENDPOINTS
# ============================================================================ # ============================================================================
@router.get("/groups", response_model=list[GroupResponse]) @router.get("/groups", response_model=list[GroupResponse], tags=["groups"])
async def list_groups() -> list[GroupResponse]: async def list_groups() -> list[GroupResponse]:
""" """
List all available groups. 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: async def get_group(group_id: str) -> GroupResponse:
""" """
Get details for a specific group. 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]: async def set_group(group_id: str, request: GroupSetRequest) -> dict[str, Any]:
""" """
Set state for all devices in a group. 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 # SCENES ENDPOINTS
# ============================================================================ # ============================================================================
@router.get("/scenes", response_model=list[SceneResponse]) @router.get("/scenes", response_model=list[SceneResponse], tags=["scenes"])
async def list_scenes() -> list[SceneResponse]: async def list_scenes() -> list[SceneResponse]:
""" """
List all available scenes. 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: async def get_scene(scene_id: str) -> SceneResponse:
""" """
Get details for a specific scene. 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: async def run_scene(scene_id: str, request: SceneRunRequest | None = None) -> SceneExecutionResponse:
""" """
Execute a scene. Execute a scene.