homebridge-ring 13.0.0 → 13.1.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,5 +1,29 @@
1
1
  # homebridge-ring
2
2
 
3
+ ## 13.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1a1ee4b`](https://github.com/dgreif/ring/commit/1a1ee4b7fe44ead78577ff22d2d13b9133c9737b) Thanks [@dgreif](https://github.com/dgreif)! - Add support for water valves. Note, these have not been tested extensively so please let us know if you run into issues.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`2f5d646`](https://github.com/dgreif/ring/commit/2f5d646471abcae2e20a3929aab44e292e67d9ab) Thanks [@dgreif](https://github.com/dgreif)! - Update dependencies
12
+
13
+ - Updated dependencies [[`1a1ee4b`](https://github.com/dgreif/ring/commit/1a1ee4b7fe44ead78577ff22d2d13b9133c9737b), [`2f5d646`](https://github.com/dgreif/ring/commit/2f5d646471abcae2e20a3929aab44e292e67d9ab)]:
14
+ - ring-client-api@13.1.0
15
+
16
+ ## 13.0.1
17
+
18
+ ### Patch Changes
19
+
20
+ - [`cf08a3e`](https://github.com/dgreif/ring/commit/cf08a3e07b5e550bcddfc789fbaa72050a4a0311) Thanks [@dgreif](https://github.com/dgreif)! - Update push-receiver, which should lead to more reliable push notification handling
21
+
22
+ - [`1552181`](https://github.com/dgreif/ring/commit/1552181b47d9f9dba031c3a592591f90369a7970) Thanks [@dgreif](https://github.com/dgreif)! - Set panic button names in such a way that they are properly reflected in the Home app. Note, this only impacts users who have the `showPanicButtons` option enabled. These users will likely see a new warning about "Configured Name" not being a supported characteristic of "Switch", which can be ignored.
23
+
24
+ - Updated dependencies [[`cf08a3e`](https://github.com/dgreif/ring/commit/cf08a3e07b5e550bcddfc789fbaa72050a4a0311)]:
25
+ - ring-client-api@13.0.1
26
+
3
27
  ## 13.0.0
4
28
 
5
29
  ### Major Changes
package/README.md CHANGED
@@ -209,6 +209,8 @@ Note: Although homebridge has support for HomeKit Secure Video (HKSV), I will no
209
209
  - Set Thermostat mode to heat/cool/off
210
210
  - Set target temperature
211
211
  - View current temperature and heating/cooling status
212
+ - Water Valves (**untested**)
213
+ - Open/Close the valve
212
214
 
213
215
  ### Chimes
214
216
 
@@ -16,6 +16,7 @@ const burglarStates = [
16
16
  function matchesAnyAlarmState({ alarmInfo }, targetStates) {
17
17
  return Boolean(alarmInfo && targetStates.includes(alarmInfo.state));
18
18
  }
19
+ const burglarAlarmName = 'Burglar Alarm', fireAlarmName = 'Fire Alarm';
19
20
  class PanicButtons extends base_data_accessory_1.BaseDataAccessory {
20
21
  constructor(device, accessory, config) {
21
22
  super();
@@ -27,7 +28,7 @@ class PanicButtons extends base_data_accessory_1.BaseDataAccessory {
27
28
  characteristicType: Characteristic.On,
28
29
  serviceType: Service.Switch,
29
30
  serviceSubType: 'Burglar',
30
- name: 'Burglar Alarm',
31
+ name: burglarAlarmName,
31
32
  getValue: (data) => matchesAnyAlarmState(data, burglarStates),
32
33
  setValue: (on) => {
33
34
  if (on) {
@@ -38,11 +39,25 @@ class PanicButtons extends base_data_accessory_1.BaseDataAccessory {
38
39
  return this.device.location.setAlarmMode('none');
39
40
  },
40
41
  });
42
+ this.registerCharacteristic({
43
+ characteristicType: Characteristic.Name,
44
+ serviceType: Service.Switch,
45
+ serviceSubType: 'Burglar',
46
+ name: burglarAlarmName,
47
+ getValue: () => burglarAlarmName,
48
+ });
49
+ this.registerCharacteristic({
50
+ characteristicType: Characteristic.ConfiguredName,
51
+ serviceType: Service.Switch,
52
+ serviceSubType: 'Burglar',
53
+ name: burglarAlarmName,
54
+ getValue: () => burglarAlarmName,
55
+ });
41
56
  this.registerCharacteristic({
42
57
  characteristicType: Characteristic.On,
43
58
  serviceType: Service.Switch,
44
59
  serviceSubType: 'Fire',
45
- name: 'Fire Alarm',
60
+ name: fireAlarmName,
46
61
  getValue: (data) => matchesAnyAlarmState(data, fireStates),
47
62
  setValue: (on) => {
48
63
  if (on) {
@@ -53,6 +68,20 @@ class PanicButtons extends base_data_accessory_1.BaseDataAccessory {
53
68
  return this.device.location.setAlarmMode('none');
54
69
  },
55
70
  });
71
+ this.registerCharacteristic({
72
+ characteristicType: Characteristic.Name,
73
+ serviceType: Service.Switch,
74
+ serviceSubType: 'Fire',
75
+ name: fireAlarmName,
76
+ getValue: () => fireAlarmName,
77
+ });
78
+ this.registerCharacteristic({
79
+ characteristicType: Characteristic.ConfiguredName,
80
+ serviceType: Service.Switch,
81
+ serviceSubType: 'Fire',
82
+ name: fireAlarmName,
83
+ getValue: () => fireAlarmName,
84
+ });
56
85
  }
57
86
  initBase() {
58
87
  const { Characteristic, Service } = hap_1.hap;
@@ -30,6 +30,7 @@ const thermostat_1 = require("./thermostat");
30
30
  const unknown_zwave_switch_1 = require("./unknown-zwave-switch");
31
31
  const util_2 = require("./util");
32
32
  const intercom_1 = require("./intercom");
33
+ const valve_1 = require("./valve");
33
34
  const ignoreHiddenDeviceTypes = [
34
35
  ring_client_api_1.RingDeviceType.RingNetAdapter,
35
36
  ring_client_api_1.RingDeviceType.ZigbeeAdapter,
@@ -95,6 +96,8 @@ function getAccessoryClass(device) {
95
96
  return water_sensor_1.WaterSensor;
96
97
  case ring_client_api_1.RingDeviceType.Thermostat:
97
98
  return thermostat_1.Thermostat;
99
+ case ring_client_api_1.RingDeviceType.WaterValve:
100
+ return valve_1.Valve;
98
101
  case ring_client_api_1.RingDeviceType.UnknownZWave:
99
102
  return unknown_zwave_switch_1.UnknownZWaveSwitchSwitch;
100
103
  }
package/lib/valve.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Valve = void 0;
4
+ const base_device_accessory_1 = require("./base-device-accessory");
5
+ const hap_1 = require("./hap");
6
+ const util_1 = require("ring-client-api/util");
7
+ class Valve extends base_device_accessory_1.BaseDeviceAccessory {
8
+ constructor(device, accessory, config) {
9
+ super();
10
+ this.device = device;
11
+ this.accessory = accessory;
12
+ this.config = config;
13
+ const { Characteristic, Service } = hap_1.hap;
14
+ this.registerCharacteristic({
15
+ characteristicType: Characteristic.On,
16
+ serviceType: Service.Switch,
17
+ getValue: (data) => this.isOpen(data.valveState),
18
+ setValue: (value) => this.setOnState(value),
19
+ });
20
+ }
21
+ isOpen(status) {
22
+ if (status === 'open') {
23
+ return true;
24
+ }
25
+ return false;
26
+ }
27
+ setOnState(on) {
28
+ (0, util_1.logInfo)(`Turning ${this.device.name} ${on ? 'On' : 'Off'}`);
29
+ if (on) {
30
+ return this.device.sendCommand('valve.open');
31
+ }
32
+ return this.device.sendCommand('valve.close');
33
+ }
34
+ }
35
+ exports.Valve = Valve;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-ring",
3
3
  "displayName": "Ring",
4
- "version": "13.0.0",
4
+ "version": "13.1.0",
5
5
  "description": "Homebridge plugin for Ring doorbells, cameras, security alarm system and smart lighting",
6
6
  "main": "lib/index.js",
7
7
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@homebridge/camera-utils": "^2.2.6",
16
16
  "@homebridge/plugin-ui-utils": "^1.0.3",
17
- "ring-client-api": "13.0.0",
17
+ "ring-client-api": "13.1.0",
18
18
  "werift": "0.19.4"
19
19
  },
20
20
  "devDependencies": {
@@ -23,7 +23,7 @@
23
23
  "homebridge": "1.8.4",
24
24
  "nodemon": "^3.1.4",
25
25
  "tsconfig": "*",
26
- "typescript": "5.5.3"
26
+ "typescript": "5.5.4"
27
27
  },
28
28
  "engines": {
29
29
  "node": "^18 || ^20",