Skip to content

WyzeIOTC

Wyze IOTC singleton, used to construct iotc_sessions

This object should generally be used inside a context manager, i.e.:

with WyzeIOTC() as wyze:
    with wyze.connect_and_auth(account, camera) as session:
        ...  # send commands to the camera, then start streaming

Attributes:

Name Type Description
tutk_platform_lib CDLL

the underlying c library used to communicate with the wyze device; see wyzecam.tutk.tutk.load_library

udp_port int

the UDP port used on this machine for communication with wyze cameras on the same network

max_num_av_channels int

the maximum number of simultaneous sessions this object supports.

version

the version of the underyling tutk_platform_lib

connect_and_auth(self, account, camera)

Initialize a new iotc session with the specified camera, and account information.

The result of this method should be used as a context manager, i.e. using the 'with' keyword. This allows us to automatically clean up after we're done with the session:

with WyzeIOTC() as iotc:
    with iotc.connect_and_auth(account, camera) as session:
        ...  # send configuration commands, or stream video from the session.

See WyzeIOTCSession for more info.

Parameters:

Name Type Description Default
account WyzeAccount

the account object returned from wyzecam.api.get_user_info

required
camera WyzeCamera

the camera object returned from wyzecam.api.get_camera_list

required

Returns:

Type Description
WyzeIOTCSession

An object representing the Wyze IOTC Session, a WyzeIOTCSession

Source code in wyzecam/iotc.py
def connect_and_auth(
    self, account: WyzeAccount, camera: WyzeCamera
) -> "WyzeIOTCSession":
    """Initialize a new iotc session with the specified camera, and account information.

    The result of this method should be used as a context manager, i.e. using the 'with'
    keyword.  This allows us to automatically clean up after we're done with the session:

    ```python
    with WyzeIOTC() as iotc:
        with iotc.connect_and_auth(account, camera) as session:
            ...  # send configuration commands, or stream video from the session.
    ```

    See [WyzeIOTCSession](../iotc_session/) for more info.

    :param account: the account object returned from [wyzecam.api.get_user_info][]
    :param camera: the camera object returned from [wyzecam.api.get_camera_list][]
    :returns: An object representing the Wyze IOTC Session, a [WyzeIOTCSession](../iotc_session/)
    """
    return WyzeIOTCSession(self.tutk_platform_lib, account, camera)