homebridge-ring 11.7.2 → 11.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # homebridge-ring
2
2
 
3
+ ## 11.7.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d19bdc`](https://github.com/dgreif/ring/commit/8d19bdc4b1fc609561788c47c2eaffda6e48b0ef) Thanks [@dgreif](https://github.com/dgreif)! - For battery cameras, wait up to 2 seconds for snapshot to be avaliable after a montion/ding event. These events often trigger an immediate notification without the snapshot uuid, quickly followed by a similar notification including the uuid. This new wait period should more consisitently provide a snapshot image for montion/ding notifications in HomeKit
8
+
9
+ - [`28b68cb`](https://github.com/dgreif/ring/commit/28b68cb20fb03c9b1f468aab0602cbf462eeb299) Thanks [@dgreif](https://github.com/dgreif)! - Clean snapshot uuid before requesting image
10
+
11
+ - Updated dependencies [[`28b68cb`](https://github.com/dgreif/ring/commit/28b68cb20fb03c9b1f468aab0602cbf462eeb299)]:
12
+ - ring-client-api@11.7.4
13
+
14
+ ## 11.7.3
15
+
16
+ ### Patch Changes
17
+
18
+ - [`ede65a3`](https://github.com/dgreif/ring/commit/ede65a3dbe92b3562a0cf973cb6225999560c2e7) Thanks [@dgreif](https://github.com/dgreif)! - Update dependencies
19
+
20
+ - Updated dependencies [[`ede65a3`](https://github.com/dgreif/ring/commit/ede65a3dbe92b3562a0cf973cb6225999560c2e7)]:
21
+ - ring-client-api@11.7.3
22
+
3
23
  ## 11.7.2
4
24
 
5
25
  ### Patch Changes
package/lib/camera.js CHANGED
@@ -7,6 +7,7 @@ const operators_1 = require("rxjs/operators");
7
7
  const camera_source_1 = require("./camera-source");
8
8
  const target_value_timer_1 = require("./target-value-timer");
9
9
  const util_1 = require("ring-client-api/util");
10
+ const rxjs_1 = require("rxjs");
10
11
  class Camera extends base_data_accessory_1.BaseDataAccessory {
11
12
  constructor(device, accessory, config) {
12
13
  super();
@@ -165,7 +166,20 @@ class Camera extends base_data_accessory_1.BaseDataAccessory {
165
166
  }
166
167
  }
167
168
  async loadSnapshotForEvent(eventDescription, characteristicValue) {
168
- const latestNotification = this.device.latestNotification, imageUuid = latestNotification?.ding.image_uuid;
169
+ let imageUuid = this.device.latestNotificationSnapshotUuid;
170
+ /**
171
+ * Battery cameras may recieve an initial notification with no image uuid,
172
+ * followed shortly by a second notification with the image uuid. We need to
173
+ * wait for the second notification before we can load the snapshot.
174
+ */
175
+ if (this.device.operatingOnBattery && !imageUuid) {
176
+ await Promise.race([
177
+ (0, rxjs_1.firstValueFrom)(this.device.onNewNotification.pipe((0, operators_1.filter)((notification) => Boolean(notification.ding.image_uuid)))),
178
+ // wait up to 2 seconds for the second notification
179
+ (0, util_1.delay)(2000),
180
+ ]);
181
+ imageUuid = this.device.latestNotificationSnapshotUuid;
182
+ }
169
183
  if (this.device.operatingOnBattery && !imageUuid) {
170
184
  // battery cameras cannot fetch a new snapshot while recording is in progress
171
185
  (0, util_1.logInfo)(this.device.name + ' ' + eventDescription);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-ring",
3
- "version": "11.7.2",
3
+ "version": "11.7.4",
4
4
  "description": "Homebridge plugin for Ring doorbells, cameras, security alarm system and smart lighting",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -13,16 +13,16 @@
13
13
  "dependencies": {
14
14
  "@homebridge/camera-utils": "^2.2.0",
15
15
  "@homebridge/plugin-ui-utils": "^0.0.19",
16
- "ring-client-api": "11.7.2"
16
+ "ring-client-api": "11.7.4"
17
17
  },
18
18
  "devDependencies": {
19
19
  "concurrently": "^7.6.0",
20
- "eslint-config-shared": "0.0.0",
20
+ "eslint-config-shared": "*",
21
21
  "homebridge": "1.6.0",
22
- "homebridge-ui": "0.0.0",
23
- "nodemon": "^2.0.20",
24
- "tsconfig": "0.0.0",
25
- "typescript": "4.9.5"
22
+ "homebridge-ui": "*",
23
+ "nodemon": "^2.0.22",
24
+ "tsconfig": "*",
25
+ "typescript": "5.0.2"
26
26
  },
27
27
  "engines": {
28
28
  "node": "^16 || ^18",