Skip to content

Commit

Permalink
Added support for /app/user/get_user_info [Closes #14]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Tarves committed May 10, 2021
1 parent a6c907a commit 6286cff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions wyze_sdk/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions wyze_sdk/service/api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion wyze_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.1"
__version__ = "1.1.2"

0 comments on commit 6286cff

Please sign in to comment.