From 6286cff6f51a0363537cc23e2931e628cbd83325 Mon Sep 17 00:00:00 2001 From: Shaun Tarves Date: Mon, 10 May 2021 08:26:07 -0400 Subject: [PATCH] Added support for /app/user/get_user_info [Closes #14] --- wyze_sdk/api/client.py | 8 ++++++++ wyze_sdk/service/api_service.py | 12 ++++++++++++ wyze_sdk/version.py | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/wyze_sdk/api/client.py b/wyze_sdk/api/client.py index a87651b..c1faf50 100644 --- a/wyze_sdk/api/client.py +++ b/wyze_sdk/api/client.py @@ -151,6 +151,14 @@ def refresh_token(self) -> WyzeResponse: self._update_session(access_token=response["access_token"], refresh_token=response["refresh_token"]) return response + def user_get_info(self) -> WyzeResponse: + """ + Retrieves the current user's info. + + :rtype: WyzeResponse + """ + return self._api_client().get_user_info() + def devices_list(self, **kwargs) -> Sequence[Device]: """List the devices available to the current user diff --git a/wyze_sdk/service/api_service.py b/wyze_sdk/service/api_service.py index 6d6768c..90a0458 100644 --- a/wyze_sdk/service/api_service.py +++ b/wyze_sdk/service/api_service.py @@ -98,6 +98,18 @@ def get_v1_device_info(self, *, mac: str, **kwargs) -> WyzeResponse: kwargs.update({"device_mac": mac, "sv": SV_GET_DEVICE_INFO}) return self.api_call('/app/device/get_device_info', json=kwargs) + def get_user_info(self, **kwargs) -> WyzeResponse: + SV_GET_USER_INFO = '6e054e04b7144c90af3b1281b6533492' + + kwargs.update({"sv": SV_GET_USER_INFO}) + return self.api_call('/app/user/get_user_info', json=kwargs) + + def logout(self, **kwargs) -> WyzeResponse: + SV_LOGOUT = '759245b61abd49128585e95f30e61add' + + kwargs.update({"sv": SV_LOGOUT}) + return self.api_call('/app/user/logout', json=kwargs) + def get_device_info(self, *, mac: str, model: str, **kwargs) -> WyzeResponse: SV_GET_DEVICE_INFO = '81d1abc794ba45a39fdd21233d621e84' diff --git a/wyze_sdk/version.py b/wyze_sdk/version.py index a82b376..72f26f5 100644 --- a/wyze_sdk/version.py +++ b/wyze_sdk/version.py @@ -1 +1 @@ -__version__ = "1.1.1" +__version__ = "1.1.2"