From 23f450d17ead23d8315314e233c90147d5f9fe69 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 9 Jun 2024 20:50:22 +0200 Subject: [PATCH] Fix clip recording for Blink Mini and Doorbell camera models Add missing camera model specific API service URLs. --- blinkpy/camera.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 39a134fb..b3c4a4b7 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -516,6 +516,17 @@ async def async_arm(self, value): await api.wait_for_command(self.sync.blink, response) return response + async def record(self): + """Initiate clip recording for a blink mini camera.""" + url = ( + f"{self.sync.urls.base_url}/api/v1/accounts/" + f"{self.sync.blink.account_id}/networks/" + f"{self.network_id}/owls/{self.camera_id}/clip" + ) + response = await api.http_post(self.sync.blink, url) + await api.wait_for_command(self.sync.blink, response) + return response + async def snap_picture(self): """Snap picture for a blink mini camera.""" url = ( @@ -575,6 +586,18 @@ async def async_arm(self, value): await api.wait_for_command(self.sync.blink, response) return response + async def record(self): + """Initiate clip recording for a blink doorbell camera.""" + url = ( + f"{self.sync.urls.base_url}/api/v1/accounts/" + f"{self.sync.blink.account_id}/networks/" + f"{self.sync.network_id}/doorbells/{self.camera_id}/clip" + ) + + response = await api.http_post(self.sync.blink, url) + await api.wait_for_command(self.sync.blink, response) + return response + async def snap_picture(self): """Snap picture for a blink doorbell camera.""" url = (