Skip to content

Commit e9ec96c

Browse files
authored
Fix tests before adding new tests
1 parent fd31a83 commit e9ec96c

4 files changed

Lines changed: 15 additions & 69 deletions

File tree

blinkpy/api.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -613,22 +613,21 @@ async def request_camera_snooze(
613613
:param product_type: Camera product type "owl", "catalina", "doorbell", or "hawk"
614614
:param data: string w/JSON dict of parameters/values to update
615615
"""
616-
product_lookup = {
617-
"catalina": "cameras",
618-
"owl": "owls",
619-
"doorbell": "doorbells"
620-
}
621-
616+
product_lookup = {"catalina": "cameras", "owl": "owls", "doorbell": "doorbells"}
617+
622618
if product_type not in product_lookup:
623619
_LOGGER.info(
624620
"Camera %s with product type %s snooze update not implemented.",
625621
camera_id,
626622
product_type,
627623
)
628624
return None
629-
630-
url_root = f"{blink.urls.base_url}/api/v1/accounts/{blink.account_id"}/networks/{network}"
631-
url = f"{url_root}/product_lookup[product_type]/{camera_id}/snooze"
625+
626+
url_root = (
627+
f"{blink.urls.base_url}/api/v1/accounts/{blink.account_id}"
628+
f"/networks/{network}"
629+
)
630+
url = f"{url_root}/{product_lookup[product_type]}/{camera_id}/snooze"
632631
return await http_post(blink, url, json=True, data=data)
633632

634633

blinkpy/camera.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,18 @@ async def snooze_till(self):
203203
except TypeError:
204204
return None
205205
except (IndexError, KeyError, ValueError) as e:
206-
_LOGGER.warning("Exception %s: Encountered a likely malformed response from the snooze API endpoint. Response: %s", e, response_data)
206+
_LOGGER.warning(
207+
"Exception %s: Encountered a likely malformed response "
208+
"from the snooze API endpoint. Response: %s",
209+
e,
210+
response_data,
211+
)
207212
return None
208213

209214
async def async_snooze(self, snooze_time=240):
210215
"""
211216
Set camera snooze status.
212-
217+
213218
:param snooze_time: Time in minutes to snooze camera. Default is 240 (4 hours).
214219
"""
215220
data = dumps({"snooze_time": snooze_time})

creds.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

test.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)