diff --git a/README.md b/README.md index 7999138..6884419 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,18 @@ curl -X 'GET' \ -H 'accept: application/json' ``` +*Set Bus 2 Mode* + +```console +curl -X 'PATCH' \ + 'http://127.0.0.1:8000/bus/2/mode' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "mode": "Composite" +}' +``` + *Healthcheck* ```console diff --git a/pyproject.toml b/pyproject.toml index bf50903..d8a7f0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "vmr-http" -version = "0.3.2" +version = "0.3.3" description = "HTTP API for controlling Voicemeeter" readme = "README.md" authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] diff --git a/src/vmr_http/web/busmode.py b/src/vmr_http/web/busmode.py index 96d5b5c..3f79cb8 100644 --- a/src/vmr_http/web/busmode.py +++ b/src/vmr_http/web/busmode.py @@ -1,6 +1,6 @@ """module for bus mode related endpoints.""" -from fastapi import APIRouter, Depends, HTTPException +from fastapi import APIRouter, Body, Depends, HTTPException from vmr_http.dependencies import get_voicemeeter_client @@ -25,7 +25,7 @@ _reversed_busmodes = {v: k for k, v in _readable_busmodes.items()} @router.patch('/{index}/mode') @router.put('/{index}/mode') -async def update_bus_mode(index: int, mode: str, voicemeeter=Depends(get_voicemeeter_client)): +async def update_bus_mode(index: int, mode: str = Body(..., embed=True), voicemeeter=Depends(get_voicemeeter_client)): """Update the bus mode for the specified bus index.""" if mode not in _reversed_busmodes: raise HTTPException( diff --git a/uv.lock b/uv.lock index 94b06a2..0fa69ed 100644 --- a/uv.lock +++ b/uv.lock @@ -1151,7 +1151,7 @@ wheels = [ [[package]] name = "vmr-http" -version = "0.3.2" +version = "0.3.3" source = { editable = "." } dependencies = [ { name = "fastapi" },