From ae5f20f7cbde0e19d636c7085dfa24997970306e Mon Sep 17 00:00:00 2001 From: Nick Townsend Date: Wed, 2 Aug 2023 18:02:47 +0100 Subject: [PATCH] Fix notification delay with doorbell_graham_cracker * The low cost wired Ring doorbell cannot take snapshots whilst recording which leads to a ~15sec delay in the HomeKit notifications. This patch bypasses the snapshot load for these devices only. See issue #933. --- packages/homebridge-ring/camera.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/homebridge-ring/camera.ts b/packages/homebridge-ring/camera.ts index 42f61820..263e240a 100644 --- a/packages/homebridge-ring/camera.ts +++ b/packages/homebridge-ring/camera.ts @@ -215,6 +215,19 @@ export class Camera extends BaseDataAccessory { ) { let imageUuid = this.device.latestNotificationSnapshotUuid + /** + * The low cost wired doorbell is effectively a battery camera and + * cannot fetch a new snapshot while recording is in progress + * See: https://github.com/dgreif/ring/issues/933 + */ + if (this.device.deviceType === 'doorbell_graham_cracker' && !imageUuid) { + logInfo( + this.device.name + + ` ${eventDescription}. Bypassing snapshot load before sending event to HomeKit` + ) + return characteristicValue + } + /** * Battery cameras may receive an initial notification with no image uuid, * followed shortly by a second notification with the image uuid. We need to