ring-client-api 14.2.0 → 14.3.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/lib/ring-camera.js +4 -0
- package/lib/ring-chime.d.ts +1 -0
- package/lib/ring-chime.js +13 -1
- package/lib/ring-types.d.ts +17 -2
- package/lib/streaming/simple-webrtc-session.js +4 -0
- package/package.json +7 -7
package/lib/ring-camera.js
CHANGED
|
@@ -275,6 +275,10 @@ export class RingCamera extends Subscribed {
|
|
|
275
275
|
return new WebrtcConnection(response.ticket, this, options);
|
|
276
276
|
}
|
|
277
277
|
async startLiveCall(options = {}) {
|
|
278
|
+
// Check if live view is disabled by camera settings/modes
|
|
279
|
+
if (this.data.settings?.live_view_disabled === true) {
|
|
280
|
+
throw new Error(`Live view is currently disabled for ${this.name}. This camera has been disabled via mode settings in the Ring app. Enable live view for this camera in the Ring app to start streaming.`);
|
|
281
|
+
}
|
|
278
282
|
const connection = await this.createStreamingConnection(options);
|
|
279
283
|
return new StreamingSession(this, connection);
|
|
280
284
|
}
|
package/lib/ring-chime.d.ts
CHANGED
package/lib/ring-chime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChimeModel } from "./ring-types.js";
|
|
2
|
-
import { clientApi } from "./rest-client.js";
|
|
2
|
+
import { clientApi, deviceApi } from "./rest-client.js";
|
|
3
3
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
4
|
const settingsWhichRequireReboot = [
|
|
5
5
|
'ding_audio_id',
|
|
@@ -107,4 +107,16 @@ export class RingChime {
|
|
|
107
107
|
});
|
|
108
108
|
return response.device_health;
|
|
109
109
|
}
|
|
110
|
+
async setNightlightEnabled(enabled) {
|
|
111
|
+
await this.restClient.request({
|
|
112
|
+
url: deviceApi(`devices/${this.id}/settings`),
|
|
113
|
+
method: 'PATCH',
|
|
114
|
+
json: {
|
|
115
|
+
night_light_settings: {
|
|
116
|
+
light_sensor_enabled: enabled,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
this.requestUpdate();
|
|
121
|
+
}
|
|
110
122
|
}
|
package/lib/ring-types.d.ts
CHANGED
|
@@ -158,10 +158,18 @@ export interface RingDeviceData {
|
|
|
158
158
|
};
|
|
159
159
|
alarmStatus?: 'active';
|
|
160
160
|
co?: {
|
|
161
|
-
alarmStatus?: 'active';
|
|
161
|
+
alarmStatus?: 'active' | 'inactive';
|
|
162
162
|
};
|
|
163
163
|
smoke?: {
|
|
164
|
-
alarmStatus?: 'active';
|
|
164
|
+
alarmStatus?: 'active' | 'inactive';
|
|
165
|
+
};
|
|
166
|
+
components?: {
|
|
167
|
+
'alarm.co'?: {
|
|
168
|
+
alarmStatus?: 'active' | 'inactive';
|
|
169
|
+
};
|
|
170
|
+
'alarm.smoke'?: {
|
|
171
|
+
alarmStatus?: 'active' | 'inactive';
|
|
172
|
+
};
|
|
165
173
|
};
|
|
166
174
|
flood?: {
|
|
167
175
|
faulted?: boolean;
|
|
@@ -258,7 +266,11 @@ export interface ChimeData {
|
|
|
258
266
|
ding_audio_id: string;
|
|
259
267
|
motion_audio_user_id: string;
|
|
260
268
|
motion_audio_id: string;
|
|
269
|
+
night_light_settings?: {
|
|
270
|
+
light_sensor_enabled: boolean;
|
|
271
|
+
};
|
|
261
272
|
};
|
|
273
|
+
night_light_state?: string;
|
|
262
274
|
features: {
|
|
263
275
|
ringtones_enabled: boolean;
|
|
264
276
|
};
|
|
@@ -292,6 +304,9 @@ export interface ChimeUpdate {
|
|
|
292
304
|
ding_audio_id?: string;
|
|
293
305
|
motion_audio_user_id?: string;
|
|
294
306
|
motion_audio_id?: string;
|
|
307
|
+
night_light_settings?: {
|
|
308
|
+
light_sensor_enabled?: boolean;
|
|
309
|
+
};
|
|
295
310
|
};
|
|
296
311
|
}
|
|
297
312
|
export interface RingtoneOptions {
|
|
@@ -11,6 +11,10 @@ export class SimpleWebRtcSession {
|
|
|
11
11
|
this.restClient = restClient;
|
|
12
12
|
}
|
|
13
13
|
async start(sdp) {
|
|
14
|
+
// Check if live view is disabled by camera settings/modes
|
|
15
|
+
if (this.camera.data.settings?.live_view_disabled === true) {
|
|
16
|
+
throw new Error(`Live view is currently disabled for ${this.camera.name}. This camera has been disabled via mode settings in the Ring app. Enable live view for this camera in the Ring app to start streaming.`);
|
|
17
|
+
}
|
|
14
18
|
const response = await this.restClient.request({
|
|
15
19
|
method: 'POST',
|
|
16
20
|
url: liveViewUrl('start'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ring-client-api",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
"debug": "^4.4.3",
|
|
25
25
|
"json-bigint": "^1.0.0",
|
|
26
26
|
"rxjs": "^7.8.2",
|
|
27
|
-
"systeminformation": "^5.
|
|
28
|
-
"undici": "^7.
|
|
27
|
+
"systeminformation": "^5.30.7",
|
|
28
|
+
"undici": "^7.19.2",
|
|
29
29
|
"uuid": "^13.0.0",
|
|
30
|
-
"werift": "0.22.
|
|
30
|
+
"werift": "0.22.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/debug": "4.1.12",
|
|
34
34
|
"@types/json-bigint": "^1.0.4",
|
|
35
|
-
"@types/node": "
|
|
35
|
+
"@types/node": "25.1.0",
|
|
36
36
|
"@types/uuid": "11.0.0",
|
|
37
37
|
"@types/ws": "^8.18.1",
|
|
38
38
|
"eslint-config-shared": "*",
|
|
39
|
-
"msw": "^2.12.
|
|
39
|
+
"msw": "^2.12.7",
|
|
40
40
|
"tsconfig": "*",
|
|
41
41
|
"typescript": "5.9.3",
|
|
42
|
-
"vitest": "^4.0.
|
|
42
|
+
"vitest": "^4.0.18"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": "^20 || ^22 || ^24"
|