homebridge-ring 11.7.0-beta.5 → 11.7.0

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,66 +1,27 @@
1
1
  # homebridge-ring
2
2
 
3
- ## 11.7.0-beta.5
3
+ ## 11.7.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [`f59e357`](https://github.com/dgreif/ring/commit/f59e35713fb82595a4f25f4226c660fb635896ed) Thanks [@dgreif](https://github.com/dgreif)! - Add true doorbell service for intercoms. This can trigger Homepods to chime when the intercom doorbell is pressed
8
-
9
- ### Patch Changes
10
-
11
- - Updated dependencies []:
12
- - ring-client-api@11.7.0-beta.5
13
-
14
- ## 11.7.0-beta.4
15
-
16
- ### Minor Changes
17
-
18
- - [`24987d8`](https://github.com/dgreif/ring/commit/24987d885ea7d61daad7dc5029bea11a869ab893) Thanks [@dgreif](https://github.com/dgreif)! - Add programmable switch for intercom doorbell press
19
-
20
- - [`e845b44`](https://github.com/dgreif/ring/commit/e845b44cf870fa8e5d83f3f3116cdc6d1b4f9576) Thanks [@dgreif](https://github.com/dgreif)! - Automatically subscribe for ding events on intercoms
21
-
22
- ### Patch Changes
23
-
24
- - Updated dependencies [[`3ebefaf`](https://github.com/dgreif/ring/commit/3ebefaf24d6e6afa4c25096f8181be63b9e0dbe4), [`e845b44`](https://github.com/dgreif/ring/commit/e845b44cf870fa8e5d83f3f3116cdc6d1b4f9576)]:
25
- - ring-client-api@11.7.0-beta.4
26
-
27
- ## 11.7.0-beta.3
28
-
29
- ### Patch Changes
30
-
31
- - [`05f9745`](https://github.com/dgreif/ring/commit/05f9745bbac98b9d7fc0ca5c7f687b8b0c3fd8e3) Thanks [@dgreif](https://github.com/dgreif)! - Fixed a typo which caused all cameras to be recognized as wired cameras. This lead to slower notifications for battery cameras and removed the battery level in HomeKit. Big thanks to @satrik for pointing me in the right direction to track down these issues!
32
-
33
- - Updated dependencies [[`05f9745`](https://github.com/dgreif/ring/commit/05f9745bbac98b9d7fc0ca5c7f687b8b0c3fd8e3)]:
34
- - ring-client-api@11.7.0-beta.3
35
-
36
- ## 11.7.0-beta.2
7
+ - [`4fe3fed`](https://github.com/dgreif/ring/commit/4fe3fed87b6fac5f4f4661f80693be44c35f75f4) Thanks [@dgreif](https://github.com/dgreif)! - Add support of Intercoms. Currently the only supported features are unlocking and checking the battery level.
37
8
 
38
- ### Patch Changes
9
+ - [`9847506`](https://github.com/dgreif/ring/commit/98475068c9e568d3400a2e88d7de0fdb34b102c9) Thanks [@dgreif](https://github.com/dgreif)! - Add programmable switch for intercom doorbell press
39
10
 
40
- - [`581080a`](https://github.com/dgreif/ring/commit/581080aca6c94b6e36090c39e2ad1850d6a85677) Thanks [@dgreif](https://github.com/dgreif)! - Fix payload sent for unlocking doors via Ring Intercom
11
+ - [`a862bd2`](https://github.com/dgreif/ring/commit/a862bd28d52c9c85709ba2f0fc2c912b7886e836) Thanks [@dgreif](https://github.com/dgreif)! - Add true doorbell service for intercoms. This can trigger Homepods to chime when the intercom doorbell is pressed
41
12
 
42
- - Updated dependencies [[`581080a`](https://github.com/dgreif/ring/commit/581080aca6c94b6e36090c39e2ad1850d6a85677)]:
43
- - ring-client-api@11.7.0-beta.2
13
+ - [`836c580`](https://github.com/dgreif/ring/commit/836c580c4247324e18c92674f11840385c989c5f) Thanks [@dgreif](https://github.com/dgreif)! - Automatically subscribe for ding events on intercoms
44
14
 
45
- ## 11.7.0-beta.1
15
+ - [`56a7894`](https://github.com/dgreif/ring/commit/56a7894c3e5515b7d8678cb3902b593078449446) Thanks [@dgreif](https://github.com/dgreif)! - Detect unlock notification from intercom
46
16
 
47
17
  ### Patch Changes
48
18
 
49
- - [`f28de89`](https://github.com/dgreif/ring/commit/f28de891df284d56c39c73322ea72f972ce19270) Thanks [@dgreif](https://github.com/dgreif)! - Temporarily log push notification content to debug intercom notifications
50
-
51
- - Updated dependencies [[`f28de89`](https://github.com/dgreif/ring/commit/f28de891df284d56c39c73322ea72f972ce19270)]:
52
- - ring-client-api@11.7.0-beta.1
19
+ - [`503e34f`](https://github.com/dgreif/ring/commit/503e34fb92d59304b0d33d7ab12216f4c38bddba) Thanks [@dgreif](https://github.com/dgreif)! - Fixed a typo which caused all cameras to be recognized as wired cameras. This lead to slower notifications for battery cameras and removed the battery level in HomeKit. Big thanks to @satrik for pointing me in the right direction to track down these issues!
53
20
 
54
- ## 11.7.0-beta.0
55
-
56
- ### Minor Changes
57
-
58
- - [`4fe3fed`](https://github.com/dgreif/ring/commit/4fe3fed87b6fac5f4f4661f80693be44c35f75f4) Thanks [@dgreif](https://github.com/dgreif)! - Add support of Intercoms. Currently the only supported features are unlocking and checking the battery level.
59
-
60
- ### Patch Changes
21
+ - [`321c983`](https://github.com/dgreif/ring/commit/321c9831ed4208c14f09b943543c6f05f7f170f7) Thanks [@dgreif](https://github.com/dgreif)! - Fix payload sent for unlocking doors via Ring Intercom
61
22
 
62
- - Updated dependencies [[`4fe3fed`](https://github.com/dgreif/ring/commit/4fe3fed87b6fac5f4f4661f80693be44c35f75f4)]:
63
- - ring-client-api@11.7.0-beta.0
23
+ - Updated dependencies [[`503e34f`](https://github.com/dgreif/ring/commit/503e34fb92d59304b0d33d7ab12216f4c38bddba), [`4fe3fed`](https://github.com/dgreif/ring/commit/4fe3fed87b6fac5f4f4661f80693be44c35f75f4), [`321c983`](https://github.com/dgreif/ring/commit/321c9831ed4208c14f09b943543c6f05f7f170f7), [`c084848`](https://github.com/dgreif/ring/commit/c0848484388ade6308387e2047186325d4880f52), [`836c580`](https://github.com/dgreif/ring/commit/836c580c4247324e18c92674f11840385c989c5f), [`56a7894`](https://github.com/dgreif/ring/commit/56a7894c3e5515b7d8678cb3902b593078449446)]:
24
+ - ring-client-api@11.7.0
64
25
 
65
26
  ## 11.6.0
66
27
 
package/lib/intercom.js CHANGED
@@ -12,7 +12,29 @@ class Intercom extends base_data_accessory_1.BaseDataAccessory {
12
12
  this.accessory = accessory;
13
13
  this.config = config;
14
14
  this.unlocking = false;
15
- const { Characteristic, Service } = hap_1.hap, lockService = this.getService(Service.LockMechanism), { LockCurrentState, LockTargetState, ProgrammableSwitchEvent } = Characteristic, programableSwitchService = this.getService(Service.StatelessProgrammableSwitch), onDoorbellPressed = device.onDing.pipe((0, operators_1.throttleTime)(15000), (0, operators_1.map)(() => ProgrammableSwitchEvent.SINGLE_PRESS));
15
+ const { Characteristic, Service } = hap_1.hap, lockService = this.getService(Service.LockMechanism), { LockCurrentState, LockTargetState, ProgrammableSwitchEvent } = Characteristic, programableSwitchService = this.getService(Service.StatelessProgrammableSwitch), onDoorbellPressed = device.onDing.pipe((0, operators_1.throttleTime)(15000), (0, operators_1.map)(() => ProgrammableSwitchEvent.SINGLE_PRESS)), syncLockState = () => {
16
+ const state = this.getLockState();
17
+ lockService
18
+ .getCharacteristic(Characteristic.LockCurrentState)
19
+ .updateValue(state);
20
+ lockService
21
+ .getCharacteristic(Characteristic.LockTargetState)
22
+ .updateValue(state);
23
+ }, markAsUnlocked = () => {
24
+ // Mark the lock as unlocked, wait 5 seconds, then mark it as locked again
25
+ clearTimeout(this.unlockTimeout);
26
+ this.unlocking = true;
27
+ // Update current state to reflect that the lock is unlocked
28
+ syncLockState();
29
+ // Leave the door in an "unlocked" state for 5 seconds
30
+ // After that, set the lock back to "locked" for both current and target state
31
+ this.unlockTimeout = setTimeout(() => {
32
+ this.unlocking = false;
33
+ syncLockState();
34
+ }, 5000);
35
+ };
36
+ // Subscribe to unlock events coming from push notifications, which will catch an unlock from the Ring app
37
+ device.onUnlocked.subscribe(markAsUnlocked);
16
38
  // Lock Service
17
39
  this.registerCharacteristic({
18
40
  characteristicType: LockCurrentState,
@@ -33,21 +55,7 @@ class Intercom extends base_data_accessory_1.BaseDataAccessory {
33
55
  this.unlocking = false;
34
56
  });
35
57
  (0, util_1.logInfo)(`Unlock response: ${JSON.stringify(response)}`);
36
- // Update current state to reflect that the lock is unlocked
37
- lockService
38
- .getCharacteristic(Characteristic.LockCurrentState)
39
- .updateValue(this.getLockState());
40
- // Leave the door in an "unlocked" state for 5 seconds
41
- // After that, set the lock back to "locked" for both current and target state
42
- this.unlockTimeout = setTimeout(() => {
43
- this.unlocking = false;
44
- lockService
45
- .getCharacteristic(Characteristic.LockCurrentState)
46
- .updateValue(this.getLockState());
47
- lockService
48
- .getCharacteristic(Characteristic.LockTargetState)
49
- .updateValue(this.getLockState());
50
- }, 5000);
58
+ markAsUnlocked();
51
59
  }
52
60
  else {
53
61
  // If the user locks the door from the home app, we can't do anything but set the states back to "locked"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-ring",
3
- "version": "11.7.0-beta.5",
3
+ "version": "11.7.0",
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,7 +13,7 @@
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.0-beta.5"
16
+ "ring-client-api": "11.7.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "concurrently": "^7.5.0",