diff --git a/tests/test_init.py b/tests/test_init.py index e32e5d7..4cb1d3a 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -7,4 +7,4 @@ async def test_basic(): async with Client() as client: await client.init_speaker(1) - assert await client.check_inited_speaker(1) + assert await client.is_inited_speaker(1) diff --git a/vvclient/client.py b/vvclient/client.py index df8befa..a2ed8e0 100644 --- a/vvclient/client.py +++ b/vvclient/client.py @@ -93,3 +93,11 @@ async def init_speaker(self, speaker: int, *, skip_reinit: bool = False, core_ve if core_version: params["core_version"] = core_version await self.http.initialize_speaker(params) + + async def is_inited_speaker(self, speaker: int, *, core_version: Optional[str] = None) -> bool: + params = { + "speaker": speaker + } + if core_version: + params["core_version"] = core_version + return await self.http.is_initialized_speaker(params) diff --git a/vvclient/http.py b/vvclient/http.py index 5b00be1..f2e97b7 100644 --- a/vvclient/http.py +++ b/vvclient/http.py @@ -62,5 +62,5 @@ async def core_versions(self) -> List[str]: async def initialize_speaker(self, params: Dict[str, Union[str, int]]) -> None: return await self.request(Route("POST", "/initialize_speaker"), params=params) - async def is_initialized_speaker(self, params: Dict[str, Union[str, int]) -> bool: + async def is_initialized_speaker(self, params: Dict[str, Union[str, int]]) -> bool: return await self.request(Route("GET", "/is_initialized_speaker"), params=params)