Skip to content

Per Camera Snooze#1273

Open
austinc3030 wants to merge 4 commits into
fronzbot:devfrom
dynacylabs:feature/per-camera-snooze
Open

Per Camera Snooze#1273
austinc3030 wants to merge 4 commits into
fronzbot:devfrom
dynacylabs:feature/per-camera-snooze

Conversation

@austinc3030

Copy link
Copy Markdown
Contributor

Description:

Adds async_snooze() and a snoozed property to BlinkCamera so individual cameras can be snoozed. A new request_camera_snooze() API function handles routing to the right endpoint per product type (catalina/sedona → cameras, owl/hawk → owls, doorbell/lotus → doorbells).

Checklist:

  • Local tests with tox run successfully PR cannot be meged unless tests pass
  • Changes tested locally to ensure platform still works as intended
  • Tests added to verify new code works

- Add snoozed async property to BlinkCamera (checks all camera types)
- Add async_snooze() method to BlinkCamera
- Add request_camera_snooze() API function routing by product type
- Tests
Copilot AI review requested due to automatic review settings July 20, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds per-camera snoozing support to BlinkPy by exposing a camera-level snooze API and a convenient camera property for reading snooze state, with product-type-specific endpoint routing.

Changes:

  • Added BlinkCamera.async_snooze() to set snooze duration and refresh homescreen for applicable product types.
  • Added BlinkCamera.snoozed async property to report current snooze state for both config-based and homescreen-based devices.
  • Added api.request_camera_snooze() plus tests covering routing and camera behaviors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_cameras.py Adds test coverage for per-camera snooze and snooze-state reading across product types and edge cases.
tests/test_api.py Adds API-level test ensuring request_camera_snooze() routes per product type and returns expected responses.
blinkpy/camera.py Implements snoozed async property and async_snooze() on BlinkCamera.
blinkpy/api.py Extends request_get_config() for sedona and introduces request_camera_snooze() endpoint routing helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread blinkpy/camera.py
Comment on lines +201 to +205
for device in self.sync.blink.homescreen.get(collection_key, []):
if int(device.get("id")) == int(self.camera_id):
snooze_value = device.get("snooze")
return bool(snooze_value)
return False

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit 70046de — replaced int() ID comparison in snoozed with str() to prevent TypeError from aborting the search loop on missing/non-numeric IDs, and extended request_update_config() to accept sedona alongside catalina to match request_get_config().

Comment thread blinkpy/api.py
Comment on lines +581 to 582
elif product_type in ["catalina", "sedona"]:
url = f"{blink.urls.base_url}/network/{network}/camera/{camera_id}/config"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit 70046de — replaced int() ID comparison in snoozed with str() to prevent TypeError from aborting the search loop on missing/non-numeric IDs, and extended request_update_config() to accept sedona alongside catalina to match request_get_config().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants