wyze_sdk.service package¶
Submodules¶
wyze_sdk.service.api_service module¶
- class wyze_sdk.service.api_service.ApiServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', sc: str = 'a626948714654991afd3c0dbd7cdb901')¶
Bases:
wyze_sdk.service.base.BaseServiceClient
Wyze api client is the wrapper on the requests to https://api.wyzecam.com
- SC = 'a626948714654991afd3c0dbd7cdb901'¶
- WYZE_API_URL = 'https://api.wyzecam.com/'¶
- WYZE_APP_NAME = 'com.hualai'¶
- api_call(api_method: str, *, http_verb: str = 'POST', json: dict = {}, headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- cancel_device_timer(*, mac: str, action_type: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_co_event_list(*, device_ids: Sequence[str] = [], begin: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, limit: Optional[int] = 20, order_by: Optional[int] = 2, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_device_group_timer(*, id: int, action_type: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- “data”: {
“action_value”: “1”, “delay_time”: 10800, “plan_execute_ts”: 1618169169544
},
- get_device_info(*, mac: str, model: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_device_list_property_list(*, device_ids: Sequence[str], target_pids: Sequence[str], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_device_property_list(*, mac: str, model: str, target_pids: Sequence[str] = [], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_device_timer(*, mac: str, action_type: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- “data”: {
“action_value”: “1”, “delay_time”: 10800, “plan_execute_ts”: 1618169169544
},
- get_event_list(*, device_ids: Sequence[str] = [], event_values: Union[wyze_sdk.models.events.EventAlarmType, Sequence[wyze_sdk.models.events.EventAlarmType]] = [], event_tags: Sequence[str] = [], event_type: str = '1', begin: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, limit: int = 20, order_by: int = 2, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_motion_event_list(*, device_ids: Sequence[str] = [], begin: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, limit: Optional[int] = 20, order_by: Optional[int] = 2, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_object_list(**kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_smoke_event_list(*, device_ids: Sequence[str] = [], begin: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, limit: Optional[int] = 20, order_by: Optional[int] = 2, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_sound_event_list(*, device_ids: Sequence[str] = [], begin: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, limit: Optional[int] = 20, order_by: Optional[int] = 2, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_user_info(**kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_v1_device_info(*, mac: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- logout(**kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- refresh_token(*, refresh_token: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- run_action(*, mac: str, action_key: str, action_params: Optional[dict] = {}, custom_string: Optional[str] = None, provider_key: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- run_action_list(*, actions: Union[dict[str, dict[str, wyze_sdk.models.devices.base.DeviceProp]], Sequence[dict[str, dict[str, wyze_sdk.models.devices.base.DeviceProp]]]], custom_string: Optional[str] = None, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- set_device_property(*, mac: str, model: str, pid: str, value: Any, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- set_device_timer(*, mac: str, delay_time: int, action_value: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
action_value: 0=off, 1=on
See: com.HLApi.CloudAPI.CloudProtocol.deviceTimerSet
- set_read_state_list(*, events: dict[str, Sequence[str]], read_state: bool = True, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
wyze_sdk.service.auth_service module¶
- class wyze_sdk.service.auth_service.AuthServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://auth-prod.api.wyze.com', api_key: str = 'RckMFKbsds5p6QY3COEXc2ABwNTYY0q18ziEiSEm')¶
Bases:
wyze_sdk.service.base.ExServiceClient
Auth service client is the wrapper on the requests to https://auth-prod.api.wyze.com’
- WYZE_API_KEY = 'RckMFKbsds5p6QY3COEXc2ABwNTYY0q18ziEiSEm'¶
- WYZE_API_URL = 'https://auth-prod.api.wyze.com'¶
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None, nonce: Optional[int] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- user_login(*, email: str, password: str, totp_key: Optional[str] = None, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
wyze_sdk.service.base module¶
- class wyze_sdk.service.base.BaseServiceClient(token: Optional[str] = None, base_url: Optional[str] = None, timeout: int = 30, headers: Optional[dict] = None, app_id: Optional[str] = '9319141212m2ik', app_name: Optional[str] = 'wyze', app_version: Optional[str] = '2.19.14', user_agent_prefix: Optional[str] = None, user_agent_suffix: Optional[str] = None, phone_id: Optional[str] = None, phone_type: Optional[int] = 2, request_verifier: Optional[wyze_sdk.signature.RequestVerifier] = None, logger: Optional[logging.Logger] = None)¶
Bases:
object
- WYZE_APP_ID = '9319141212m2ik'¶
- WYZE_APP_NAME = 'wyze'¶
- WYZE_APP_VERSION = '2.19.14'¶
- WYZE_PHONE_TYPE = 2¶
- api_call(api_endpoint: str, *, http_verb: str = 'POST', data: Optional[dict] = None, params: Optional[dict] = None, json: Optional[dict] = None, headers: Optional[dict] = None, auth: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- do_get(url: str, headers: dict, payload: dict) wyze_sdk.service.wyze_response.WyzeResponse ¶
- do_post(url: str, headers: dict, payload: dict, params: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_sorted_params(params: dict = {}) str ¶
- class wyze_sdk.service.base.ExServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: Optional[wyze_sdk.signature.RequestVerifier] = None)¶
Bases:
wyze_sdk.service.base.WpkNetServiceClient
ex service client is the wrapper for WpkWyzeExService.
- class wyze_sdk.service.base.SignatureServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: Optional[wyze_sdk.signature.RequestVerifier] = None)¶
Bases:
wyze_sdk.service.base.WpkNetServiceClient
signature service client is the wrapper for WpkWyzeSignatureService
- class wyze_sdk.service.base.WpkNetServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: Optional[wyze_sdk.signature.RequestVerifier] = None)¶
Bases:
wyze_sdk.service.base.BaseServiceClient
wpk net service client is the wrapper to newer Wyze services like WpkWyzeSignatureService and WpkWyzeExService.
- WYZE_APP_NAME = 'com.hualai'¶
- WYZE_SALTS = {'9319141212m2ik': 'wyze_app_secret_key_132', 'venp_4c30f812828de875': 'CVCSNoa0ALsNEpgKls6ybVTVOmGzFoiq'}¶
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, headers: Optional[dict] = None, nonce: Optional[int] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
wyze_sdk.service.earth_service module¶
- class wyze_sdk.service.earth_service.EarthServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://wyze-earth-service.wyzecam.com')¶
Bases:
wyze_sdk.service.base.ExServiceClient
Earth service client is the wrapper on the requests to https://wyze-earth-service.wyzecam.com
- WYZE_API_URL = 'https://wyze-earth-service.wyzecam.com'¶
- WYZE_APP_ID = 'earp_9b66f89647d35e43'¶
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- get_device_info(*, did: str, keys: Union[str, Sequence[str]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_iot_prop(*, did: str, keys: Union[str, Sequence[str]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- set_iot_prop(*, did: str, model: str, key: str, value: str, is_sub_device: bool = False, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- set_iot_prop_by_topic(*, did: str, model: str, props: dict[str, str], is_sub_device: bool = False, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
wyze_sdk.service.ford_service module¶
- class wyze_sdk.service.ford_service.FordResponse(*, client, http_verb: str, api_url: str, req_args: dict, data: Union[dict, bytes], headers: dict, status_code: int)¶
Bases:
wyze_sdk.service.wyze_response.WyzeResponse
- validate() wyze_sdk.service.wyze_response.WyzeResponse ¶
Check if the response from the Ford service was successful. Returns:
- (WyzeResponse)
This method returns it’s own object. e.g. ‘self’
- Raises:
WyzeApiError: The request to the Wyze API failed.
- class wyze_sdk.service.ford_service.FordServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://yd-saas-toc.wyzecam.com')¶
Bases:
wyze_sdk.service.base.BaseServiceClient
Ford service client is the wrapper on the requests to https://yd-saas-toc.wyzecam.com
- WYZE_API_URL = 'https://yd-saas-toc.wyzecam.com'¶
- WYZE_FORD_APP_KEY = '275965684684dbdaf29a0ed9'¶
- WYZE_FORD_APP_SECRET = '4deekof1ba311c5c33a9cb8e12787e8c'¶
- api_call(api_method: str, *, http_verb: str = 'GET', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- generate_dynamic_signature(*, path: str, method: str, body: Union[str, bytes])¶
Generates a dynamic signature
- get_crypt_secret(**kwargs) wyze_sdk.service.ford_service.FordResponse ¶
See: com.yunding.ford.manager.NetLockManager.getCryptSecret
- get_family_record(*, uuid: str, begin: datetime.datetime, end: Optional[datetime.datetime] = None, offset: int = 0, limit: int = 20, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
Gets a reverse chronological list of lock event records. begin is the earliest time.
See: com.yunding.ford.manager.NetLockManager.getFamilyRecord
- get_family_record_count(*, uuid: str, begin: datetime.datetime, end: Optional[datetime.datetime] = None, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
See: com.yunding.ford.manager.NetLockManager.getFamilyRecordCount
- get_gateway_info(*, uuid: str, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
- get_lock_info(*, uuid: str, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
See: com.yunding.ford.manager.NetLockManager.getLockInfo
- get_user_device(limit: int = 25, offset: int = 0, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
See: com.yunding.ford.manager.NetDeviceManager.getUserDevice
- remote_control_lock(*, uuid: str, action: str, **kwargs) wyze_sdk.service.ford_service.FordResponse ¶
See: com.yunding.ford.manager.NetLockManager.remoteControlLock
wyze_sdk.service.general_api_service module¶
- class wyze_sdk.service.general_api_service.GeneralApiServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://wyze-general-api.wyzecam.com', sdk_version: Optional[str] = '1.2.3', sdk_type: Optional[str] = '100', user_id: Optional[str] = None)¶
Bases:
wyze_sdk.service.base.BaseServiceClient
Wyze api client is the wrapper on the requests to https://wyze-general-api.wyzecam.com
- WYZE_API_KEY = ''¶
- WYZE_API_URL = 'https://wyze-general-api.wyzecam.com'¶
- WYZE_SDK_TYPE = '100'¶
- WYZE_SDK_VERSION = '1.2.3'¶
- api_call(api_method: str, *, http_verb: str = 'POST', json: dict = {}, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- post_user_event(*, pid: str, event_id: str, event_type: int, **kwargs)¶
wyze_sdk.service.platform_service module¶
- class wyze_sdk.service.platform_service.PlatformServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://wyze-platform-service.wyzecam.com')¶
Bases:
wyze_sdk.service.base.ExServiceClient
Wyze api client is the wrapper on the requests to https://wyze-platform-service.wyzecam.com
- WYZE_API_URL = 'https://wyze-platform-service.wyzecam.com'¶
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- get_user_profile(*, appid: Optional[str] = None, **kwargs)¶
- get_variable(*, keys: Union[str, Sequence[str]], **kwargs)¶
wyze_sdk.service.scale_service module¶
- class wyze_sdk.service.scale_service.ScaleServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://wyze-scale-service.wyzecam.com')¶
Bases:
wyze_sdk.service.base.ExServiceClient
Scale service client is the wrapper on the requests to https://wyze-scale-service.wyzecam.com
- WYZE_API_URL = 'https://wyze-scale-service.wyzecam.com'¶
- WYZE_APP_ID = 'scap_41183d5d0bac498d'¶
- add_heart_rate_record(*, did: str, user_id: str, measure_ts: int, heart_rate: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Add a heart rate record to the user’s profile.
See: com.wyze.ihealth.d.b.p
- add_weight_record(*, did: str, mac: str, user_id: str, measure_ts: int, measure_type: int = 1, weight: float, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Add a weight-only record to the user’s profile.
See: com.wyze.ihealth.d.b.k
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- delete_goal_weight(*, user_id: Optional[str] = None, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Removes the goal weight from the user’s profile.
See: com.wyze.ihealth.d.b.j
- delete_record(*, data_id=typing.Union[int, typing.Sequence[int]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Delete health records from the user’s profile.
See: com.wyze.ihealth.d.b.u
- get_device_member(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the users associated with the scale.
See: com.wyze.ihealth.d.a.j
- get_device_setting(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the settings for the scale.
See: com.wyze.ihealth.d.a.m
- get_family_member(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the users associated with the scale.
See: com.wyze.ihealth.d.a.o
- get_goal_weight(*, user_id: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the goal weight from the user’s profile.
See: com.wyze.ihealth.d.b.v
- get_heart_rate_record_list(*, user_id: Optional[str] = None, record_number: Optional[int] = 1, measure_ts: Optional[int] = None, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the heart rate records from the user’s profile.
See: com.wyze.ihealth.d.b.b
- get_latest_records(*, user_id: Optional[str] = None, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the latest records from the user’s profile.
See: com.wyze.ihealth.d.b.t
- get_records(*, user_id: Optional[str] = None, start_time: datetime.datetime, end_time: datetime.datetime, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get a range of records from the user’s profile.
See: com.wyze.ihealth.d.b.i and com.samsung.android.sdk.healthdata.HealthConstants.SessionMeasurement
- get_token(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get binding token for the scale.
See: com.wyze.ihealth.d.a.c
- get_user_device_relation(*, did: str, user_id: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the relationship of the users associated with the scale.
See: com.wyze.ihealth.d.a.d
- get_user_preference(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Get the scale-related preferences for the current user.
See: com.wyze.ihealth.d.a.p
- get_user_profile()¶
Get the scale-related data from the user’s profile.
See: com.wyze.ihealth.d.a.a and com.samsung.android.sdk.healthdata.HealthUserProfile
- update_device_setting(*, did: str, model: str, firmware_ver: str, mac: str, unit: str, broadcast: int, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Update the settings of scale.
See: com.wyze.ihealth.d.a.f
- update_user_profile(*, logo_url: str, nickname: str, gender: str, birth_date: str, height: str, height_unit: str, body_type: str, occupation: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Set scale-related data to the user’s profile.
See: com.wyze.ihealth.d.a.l and com.samsung.android.sdk.healthdata.HealthUserProfile
wyze_sdk.service.venus_service module¶
- class wyze_sdk.service.venus_service.VenusServiceClient(token: Optional[str] = None, base_url: Optional[str] = 'https://wyze-venus-service-vn.wyzecam.com', app_id: str = 'venp_4c30f812828de875')¶
Bases:
wyze_sdk.service.base.ExServiceClient
Venus service client is the wrapper on the requests to https://wyze-venus-service-vn.wyzecam.com
- WYZE_API_URL = 'https://wyze-venus-service-vn.wyzecam.com'¶
- WYZE_APP_ID = 'venp_4c30f812828de875'¶
- api_call(api_method: str, *, http_verb: str = 'POST', params: Optional[dict] = None, json: Optional[dict] = None, request_specific_headers: Optional[dict] = None) wyze_sdk.service.wyze_response.WyzeResponse ¶
Create a request and execute the API call to Wyze. Args:
- api_endpoint (str): The target Wyze API endpoint.
e.g. ‘/app/v2/home_page/get_object_list’
http_verb (str): HTTP Verb. e.g. ‘POST’ data: The body to attach to the request. If a dictionary is
provided, form-encoding will take place. e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- params (dict): The URL parameters to append to the URL.
e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
- json (dict): JSON for the body to attach to the request
(if data is not specified). e.g. {‘key1’: ‘value1’, ‘key2’: ‘value2’}
headers (dict): Additional request headers auth (dict): A dictionary that consists of access_token and refresh_token
- Returns:
- (WyzeResponse)
The server’s response to an HTTP request. Data from the response can be accessed like a dict.
- Raises:
- WyzeApiError: The following Wyze API call failed:
‘/app/v2/home_page/get_object_list’.
- WyzeRequestError: JSON data can only be submitted as
POST requests.
- get_current_map(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_current_position(*, did: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_device_info(*, did: str, keys: Union[str, Sequence[str]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_iot_prop(*, did: str, keys: Union[str, Sequence[str]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- get_sweep_records(*, did: str, keys: Union[str, Sequence[str]], limit: int = 20, since: datetime, **kwargs) WyzeResponse ¶
- set_iot_action(*, did: str, model: str, cmd: str, params: Union[dict, Sequence[dict]], is_sub_device: bool = False, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
- sweep_rooms(*, did: str, rooms: Union[int, Sequence[int]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
The client command to sweep specific room(s). The rooms should be specified as an array of integers, as identified by the current map.
Ref: com.wyze.sweeprobot.model.request.VenusSweepByRoomRequest
wyze_sdk.service.wyze_response module¶
A Python module for interacting and consuming responses from Wyze.
- class wyze_sdk.service.wyze_response.WyzeResponse(*, client, http_verb: str, api_url: str, req_args: dict, data: Union[dict, bytes], headers: dict, status_code: int)¶
Bases:
object
A container of response data.
- Attributes:
- data (dict): The json-encoded content of the response. Along
with the headers and status code information.
- Methods:
validate: Check if the response from Wyze was successful. get: Retrieves any key from the response data.
- Note:
Any attributes or methods prefixed with _underscores are intended to be “private” internal use only. They may be changed or removed at any time.
- get(key, default=None)¶
Retrieves any key from the response data.
- Note:
This is implemented so users can reference the WyzeResponse object like a dictionary. e.g. response.get(“ok”, False)
- Returns:
The value from data or the specified default.
- validate()¶
Check if the response from Wyze was successful.
- Returns:
- (WyzeResponse)
This method returns it’s own object. e.g. ‘self’
- Raises:
WyzeApiError: The request to the Wyze API failed.