From 96fb4f389fb7c74b90b5b0856c779782785659dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=AA=E3=83=B3=E8=A6=AA=E8=A1=9B?= =?UTF-8?q?=E9=9A=8A?= Date: Thu, 16 May 2024 09:50:30 +0900 Subject: [PATCH 1/3] Add is initialized speaker --- vvclient/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) From b6623cece3fad42253619ca66e0378e77a1c905d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=AA=E3=83=B3=E8=A6=AA=E8=A1=9B?= =?UTF-8?q?=E9=9A=8A?= Date: Thu, 16 May 2024 09:53:40 +0900 Subject: [PATCH 2/3] Update test_init.py --- tests/test_init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From aca6dc63923edba2d14c5a90bf754dc54135b664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=AA=E3=83=B3=E8=A6=AA=E8=A1=9B?= =?UTF-8?q?=E9=9A=8A?= Date: Thu, 16 May 2024 09:57:23 +0900 Subject: [PATCH 3/3] Update http.py --- vvclient/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)