From ed10c0e01578ab31058dce7525ce5cc260b128bb Mon Sep 17 00:00:00 2001 From: justinballetta <83440090+justinballetta@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:33:17 -0400 Subject: [PATCH] Add Restart function to camera (#33) Added procedure in cameras.py file to use "Restart" function built into Wyze app. Tested and working on Wyze Cam V2 but cannot speak for other models. --- wyze_sdk/api/devices/cameras.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wyze_sdk/api/devices/cameras.py b/wyze_sdk/api/devices/cameras.py index 818f5f3..a46a7c9 100644 --- a/wyze_sdk/api/devices/cameras.py +++ b/wyze_sdk/api/devices/cameras.py @@ -74,3 +74,13 @@ def turn_off(self, *, device_mac: str, device_model: str, **kwargs) -> WyzeRespo """ return super()._api_client().run_action( mac=device_mac, provider_key=device_model, action_key="power_off") + + def restart(self, *, device_mac: str, device_model: str, **kwargs) -> WyzeResponse: + """Restarts a camera. + + Args: + :param str device_mac: The device mac. e.g. 'ABCDEF1234567890' + :param str device_model: The device model. e.g. 'WYZEC1-JZ' + """ + return super()._api_client().run_action( + mac=device_mac, provider_key=device_model, action_key="restart")