wyze_sdk.service package

Submodules

wyze_sdk.service.api_service module

class wyze_sdk.service.api_service.ApiServiceClient(token: str | None = None, base_url: str | None = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', sc: str = 'a626948714654991afd3c0dbd7cdb901')

Bases: 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: dict | None = None) 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) WyzeResponse
change_password(**kwargs) WyzeResponse
get_co_event_list(*, device_ids: Sequence[str] = [], begin: datetime | None = None, end: datetime | None = None, limit: int | None = 20, order_by: int | None = 2, **kwargs) WyzeResponse
get_device_group_timer(*, id: int, action_type: int, **kwargs) WyzeResponse
“data”: {

“action_value”: “1”, “delay_time”: 10800, “plan_execute_ts”: 1618169169544

},

get_device_info(*, mac: str, model: str, **kwargs) WyzeResponse
get_device_list_property_list(*, device_ids: Sequence[str], target_pids: Sequence[str], **kwargs) WyzeResponse
get_device_property_list(*, mac: str, model: str, target_pids: Sequence[str] = [], **kwargs) WyzeResponse
get_device_timer(*, mac: str, action_type: int, **kwargs) WyzeResponse
“data”: {

“action_value”: “1”, “delay_time”: 10800, “plan_execute_ts”: 1618169169544

},

get_event_list(*, device_ids: Sequence[str] = [], event_values: EventAlarmType | Sequence[EventAlarmType] = [], event_tags: Sequence[str] = [], event_type: str = '1', begin: datetime | None = None, end: datetime | None = None, limit: int = 20, order_by: int = 2, **kwargs) WyzeResponse
get_motion_event_list(*, device_ids: Sequence[str] = [], begin: datetime | None = None, end: datetime | None = None, limit: int | None = 20, order_by: int | None = 2, **kwargs) WyzeResponse
get_object_list(**kwargs) WyzeResponse
get_plug_usage_record_list(*, mac: str, start_time: datetime, end_time: datetime, **kwargs) WyzeResponse
get_smoke_event_list(*, device_ids: Sequence[str] = [], begin: datetime | None = None, end: datetime | None = None, limit: int | None = 20, order_by: int | None = 2, **kwargs) WyzeResponse
get_sound_event_list(*, device_ids: Sequence[str] = [], begin: datetime | None = None, end: datetime | None = None, limit: int | None = 20, order_by: int | None = 2, **kwargs) WyzeResponse
get_user_info(**kwargs) WyzeResponse
get_v1_device_info(*, mac: str, **kwargs) WyzeResponse
logout(**kwargs) WyzeResponse
refresh_token(*, refresh_token: str, **kwargs) WyzeResponse
run_action(*, mac: str, action_key: str, action_params: dict | None = {}, custom_string: str | None = None, provider_key: str, **kwargs) WyzeResponse
run_action_list(*, actions: dict[str, dict[str, DeviceProp]] | Sequence[dict[str, dict[str, DeviceProp]]], custom_string: str | None = None, **kwargs) WyzeResponse
set_device_property(*, mac: str, model: str, pid: str, value: Any, **kwargs) WyzeResponse
set_device_property_list(*, mac: str, model: str, props: DeviceProp | Sequence[DeviceProp] = [], **kwargs) WyzeResponse
set_device_timer(*, mac: str, delay_time: int, action_value: int, **kwargs) 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) WyzeResponse
class wyze_sdk.service.api_service.AwayModeGenerator

Bases: object

cursor_time = None
remain_time = None
property value: Sequence[str]

wyze_sdk.service.auth_service module

class wyze_sdk.service.auth_service.AuthServiceClient(token: str | None = None, base_url: str | None = 'https://auth-prod.api.wyze.com', api_key: str = 'RckMFKbsds5p6QY3COEXc2ABwNTYY0q18ziEiSEm')

Bases: 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: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None, nonce: int | None = None) 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, key_id: str | None = None, api_key: str | None = None, totp_key: str | None = None, **kwargs) WyzeResponse

wyze_sdk.service.base module

class wyze_sdk.service.base.BaseServiceClient(token: str | None = None, base_url: str | None = None, timeout: int = 30, headers: dict | None = None, app_id: str | None = '9319141212m2ik', app_name: str | None = 'wyze', app_version: str | None = '2.19.14', user_agent_prefix: str | None = None, user_agent_suffix: str | None = None, phone_id: str | None = None, phone_type: int | None = 2, request_verifier: RequestVerifier | None = None, logger: Logger | None = 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: dict | None = None, params: dict | None = None, json: dict | None = None, headers: dict | None = None, auth: dict | None = None) 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) WyzeResponse
do_post(url: str, headers: dict, payload: dict, params: dict | None = None) WyzeResponse
get_sorted_params(params: dict = {}) str
class wyze_sdk.service.base.ExServiceClient(token: str | None = None, base_url: str | None = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: RequestVerifier | None = None)

Bases: WpkNetServiceClient

ex service client is the wrapper for WpkWyzeExService.

class wyze_sdk.service.base.SignatureServiceClient(token: str | None = None, base_url: str | None = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: RequestVerifier | None = None)

Bases: WpkNetServiceClient

signature service client is the wrapper for WpkWyzeSignatureService

class wyze_sdk.service.base.WpkNetServiceClient(token: str | None = None, base_url: str | None = 'https://api.wyzecam.com/', app_name: str = 'com.hualai', app_id: str = '9319141212m2ik', request_verifier: RequestVerifier | None = None)

Bases: 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: dict | None = None, json: dict | None = None, headers: dict | None = None, nonce: int | None = None) 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: str | None = None, base_url: str | None = 'https://wyze-earth-service.wyzecam.com')

Bases: 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: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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 | Sequence[str], parent_did: str | None = None, model: str | None = None, keys: str | Sequence[str], **kwargs) WyzeResponse
get_iot_prop(*, did: str | Sequence[str], parent_did: str | None = None, model: str | None = None, keys: str | Sequence[str], **kwargs) WyzeResponse
get_sub_device(*, did: str, **kwargs) WyzeResponse
set_iot_prop(*, did: str, model: str, key: str, value: str, is_sub_device: bool = False, **kwargs) WyzeResponse
set_iot_prop_by_topic(*, did: str, model: str, props: dict[str, str], is_sub_device: bool = False, **kwargs) 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: dict | bytes, headers: dict, status_code: int)

Bases: WyzeResponse

validate() 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: str | None = None, base_url: str | None = 'https://yd-saas-toc.wyzecam.com')

Bases: 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'
WYZE_FORD_IV_HEX = '0123456789ABCDEF'
add_password(*, uuid: str, password: str | None = None, name: str | None = None, permission: LockKeyPermission, periodicity: LockKeyPeriodicity | None = None, userid: str, **kwargs) FordResponse
api_call(api_method: str, *, http_verb: str = 'GET', params: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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_password(*, uuid: str, password_id: str, **kwargs) FordResponse
generate_dynamic_signature(*, path: str, method: str, body: str | bytes)

Generates a dynamic signature

get_crypt_secret(**kwargs) FordResponse

See: com.yunding.ford.manager.NetLockManager.getCryptSecret

get_family_record_count(*, uuid: str, begin: datetime, end: datetime | None = None, **kwargs) FordResponse

See: com.yunding.ford.manager.NetLockManager.getFamilyRecordCount

get_family_records(*, uuid: str, begin: datetime, end: datetime | None = None, offset: int = 0, limit: int = 20, **kwargs) FordResponse

Gets a reverse chronological list of lock event records. begin is the earliest time.

See: com.yunding.ford.manager.NetLockManager.getFamilyRecord

get_gateway_info(*, uuid: str, **kwargs) FordResponse
get_keypad_info(*, uuid: str, **kwargs) FordResponse
get_lock_info(*, uuid: str, with_keypad: bool = True, **kwargs) FordResponse

See: com.yunding.ford.manager.NetLockManager.getLockInfo

get_passwords(*, uuid: str, **kwargs) FordResponse
get_user_device(limit: int = 25, offset: int = 0, **kwargs) FordResponse

See: com.yunding.ford.manager.NetDeviceManager.getUserDevice

remote_control_lock(*, uuid: str, action: str, **kwargs) FordResponse

See: com.yunding.ford.manager.NetLockManager.remoteControlLock

update_password(*, uuid: str, password_id: str, password: str | None = None, name: str | None = None, permission: LockKeyPermission | None = None, periodicity: LockKeyPeriodicity | None = None, **kwargs) FordResponse
wyze_sdk.service.ford_service.default(obj)

wyze_sdk.service.general_api_service module

class wyze_sdk.service.general_api_service.GeneralApiServiceClient(token: str | None = None, base_url: str | None = 'https://wyze-general-api.wyzecam.com', sdk_version: str | None = '1.2.3', sdk_type: str | None = '100', user_id: str | None = None)

Bases: 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: dict | None = None) 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: str | None = None, base_url: str | None = 'https://wyze-platform-service.wyzecam.com')

Bases: 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: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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: str | None = None, **kwargs)
get_variable(*, keys: str | Sequence[str], **kwargs)

wyze_sdk.service.scale_service module

class wyze_sdk.service.scale_service.ScaleServiceClient(token: str | None = None, base_url: str | None = 'https://wyze-scale-service.wyzecam.com')

Bases: 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) 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) 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: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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: str | None = None, **kwargs) 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) WyzeResponse

Delete health records from the user’s profile.

See: com.wyze.ihealth.d.b.u

get_device_member(*, did: str, **kwargs) WyzeResponse

Get the users associated with the scale.

See: com.wyze.ihealth.d.a.j

get_device_setting(*, did: str, **kwargs) WyzeResponse

Get the settings for the scale.

See: com.wyze.ihealth.d.a.m

get_family_member(*, did: str, **kwargs) WyzeResponse

Get the users associated with the scale.

See: com.wyze.ihealth.d.a.o

get_goal_weight(*, user_id: str, **kwargs) WyzeResponse

Get the goal weight from the user’s profile.

See: com.wyze.ihealth.d.b.v

get_heart_rate_record_list(*, user_id: str | None = None, record_number: int | None = 1, measure_ts: int | None = None, **kwargs) WyzeResponse

Get the heart rate records from the user’s profile.

See: com.wyze.ihealth.d.b.b

get_latest_records(*, user_id: str | None = None, **kwargs) WyzeResponse

Get the latest records from the user’s profile.

See: com.wyze.ihealth.d.b.t

get_records(*, user_id: str | None = None, start_time: datetime, end_time: datetime, **kwargs) 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) WyzeResponse

Get binding token for the scale.

See: com.wyze.ihealth.d.a.c

get_user_device_relation(*, did: str, user_id: str, **kwargs) WyzeResponse

Get the relationship of the users associated with the scale.

See: com.wyze.ihealth.d.a.d

get_user_preference(*, did: str, **kwargs) 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) 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) 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.sirius_service module

class wyze_sdk.service.sirius_service.SiriusServiceClient(token: str | None = None, base_url: str | None = 'https://wyze-sirius-service.wyzecam.com')

Bases: ExServiceClient

Sirius service client is the wrapper on the requests to https://wyze-sirius-service.wyzecam.com

WYZE_API_URL = 'https://wyze-sirius-service.wyzecam.com'
WYZE_APP_ID = 'wssp_bc5c93d925b51c8f'
api_call(api_method: str, *, http_verb: str = 'POST', params: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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 | Sequence[str], parent_did: str | None = None, model: str | None = None, keys: str | Sequence[str], **kwargs) WyzeResponse
get_iot_prop(*, did: str | Sequence[str], parent_did: str | None = None, model: str | None = None, keys: str | Sequence[str], **kwargs) WyzeResponse
get_sub_device(*, did: str, **kwargs) WyzeResponse
set_iot_prop(*, did: str, model: str, key: str, value: str, is_sub_device: bool = False, **kwargs) WyzeResponse
set_iot_prop_by_topic(*, did: str, model: str, props: dict[str, str], is_sub_device: bool = False, **kwargs) WyzeResponse

wyze_sdk.service.venus_service module

class wyze_sdk.service.venus_service.VenusServiceClient(token: str | None = None, base_url: str | None = 'https://wyze-venus-service-vn.wyzecam.com', app_id: str = 'venp_4c30f812828de875')

Bases: 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'
WYZE_VACUUM_FIRMWARE_VERSION = '1.6.113'
WYZE_VENUS_PLUGIN_VERSION = '2.35.1'
api_call(api_method: str, *, http_verb: str = 'POST', params: dict | None = None, json: dict | None = None, request_specific_headers: dict | None = None) 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.

control(*, did: str, type: VacuumDeviceControlRequestType, value: VacuumDeviceControlRequestValue, rooms: int | Sequence[int] | None = None, **kwargs) WyzeResponse

The client command to issue commands to the device.

The rooms should be specified as an array of integers, as identified by the current map.

Actions defined in the app are:

FOR ALL: type: VacuumDeviceControlRequestType.RETURN_TO_CHARGING:

value: VacuumDeviceControlRequestValue.START (Recharge Start) value: VacuumDeviceControlRequestValue.STOP

mode 5: Recharge Stop Manual Recharge mode 10,32,1103,1203,1303,1403: Recharge Stop Finish Recharge mode 11,33,1104,1204,1304,1404 AND charge_state 0: Recharge Stop Break Recharge mode 11,33,1104,1204,1304,1404 AND charge_state 1: Recharge Stop Break Charging

FOR VACUUM (i12 == 0): type: VacuumDeviceControlRequestType.GLOBAL_SWEEPING:

if no rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE if rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

type: VacuumDeviceControlRequestType.AREA_CLEAN:

value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

FOR MOP (i12 == 2): type: VacuumDeviceControlRequestType.GLOBAL_SWEEPING:

if no rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE if rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

type: VacuumDeviceControlRequestType.AREA_CLEAN:

value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

FOR HURRICANE (i12 == 1): type: VacuumDeviceControlRequestType.GLOBAL_SWEEPING:

if no rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE if rooms selected: value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

type: VacuumDeviceControlRequestType.AREA_CLEAN:

value: VacuumDeviceControlRequestValue.START (resume) value: VacuumDeviceControlRequestValue.PAUSE value: VacuumDeviceControlRequestValue.FALSE_PAUSE

Ref: com.wyze.sweeprobot.common.entity.model.request.VenusDeviceControlRequest Ref: k(int i10, int i11, int i12)

get_current_map(*, did: str, **kwargs) WyzeResponse
get_current_position(*, did: str, **kwargs) WyzeResponse
get_device_info(*, did: str, keys: str | Sequence[str], **kwargs) WyzeResponse
get_iot_prop(*, did: str, keys: str | Sequence[str], **kwargs) WyzeResponse
get_maps(*, did: str, **kwargs) WyzeResponse
get_status(*, did: str, **kwargs) WyzeResponse
get_sweep_records(*, did: str, keys: str | Sequence[str], limit: int = 20, since: datetime, **kwargs) WyzeResponse
set_current_map(*, did: str, map_id: int, **kwargs) WyzeResponse
set_iot_action(*, did: str, model: str, cmd: str, params: dict | Sequence[dict], is_sub_device: bool = False, **kwargs) WyzeResponse

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: 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.

Module contents