ring: update webrtc stream endpoint, start phasing out rtsp stream

This commit is contained in:
Koushik Dutta
2023-10-17 09:12:03 -07:00
parent e26e53899e
commit 190914efd1
5 changed files with 18 additions and 11 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/ring",
"version": "0.0.133",
"version": "0.0.135",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/ring",
"version": "0.0.133",
"version": "0.0.135",
"dependencies": {
"@koush/ring-client-api": "file:../../external/ring-client-api",
"@scrypted/common": "file:../../common",

View File

@@ -44,5 +44,5 @@
"got": "11.8.6",
"socket.io-client": "^2.5.0"
},
"version": "0.0.133"
"version": "0.0.135"
}

View File

@@ -61,7 +61,7 @@ class RingLight extends ScryptedDeviceBase implements Battery, TamperSensor, Mot
}
private isBeamDevice() {
return [RingDeviceType.BeamsMultiLevelSwitch, RingDeviceType.BeamsSwitch, RingDeviceType.BeamsTransformerSwitch].includes(this.device.deviceType);
return [RingDeviceType.BeamsMultiLevelSwitch, RingDeviceType.BeamsSwitch, RingDeviceType.BeamsTransformerSwitch].includes(this.device.deviceType);
}
updateState(data: RingDeviceData) {
@@ -80,7 +80,7 @@ class RingLight extends ScryptedDeviceBase implements Battery, TamperSensor, Mot
return this.device.setInfo({ device: { v1: { on: false } } });
}
}
turnOn(): Promise<void> {
if (this.isBeamDevice()) {
this.device.sendCommand('light-mode.set', { lightMode: 'on' });
@@ -118,7 +118,7 @@ class RingSwitch extends ScryptedDeviceBase implements OnOff {
turnOff(): Promise<void> {
return this.device.setInfo({ device: { v1: { on: false } } });
}
turnOn(): Promise<void> {
return this.device.setInfo({ device: { v1: { on: true } } });
}
@@ -162,7 +162,7 @@ export class RingLocationDevice extends ScryptedDeviceBase implements DeviceProv
this.location = location;
this.location.onLocationMode.subscribe(mode => this.updateLocationMode(mode));
// if the location has a base station, updates when arming/disarming are not sent to the `onLocationMode` subscription
// instead we subscribe to the security panel, which is updated during arming actions
this.location.getSecurityPanel().then(panel => {
@@ -193,8 +193,9 @@ export class RingLocationDevice extends ScryptedDeviceBase implements DeviceProv
ScryptedInterface.RTCSignalingChannel,
];
if (!camera.isRingEdgeEnabled) {
if (this.plugin.settingsStorage.values.legacyRtspStream)
interfaces.push(ScryptedInterface.VideoCamera);
interfaces.push(
ScryptedInterface.VideoCamera,
ScryptedInterface.Intercom,
ScryptedInterface.VideoClips,
);
@@ -237,7 +238,7 @@ export class RingLocationDevice extends ScryptedDeviceBase implements DeviceProv
switch (data.deviceType) {
case RingDeviceType.ContactSensor:
case RingDeviceType.RetrofitZone:
case RingDeviceType.RetrofitZone:
case RingDeviceType.TiltSensor:
case RingDeviceType.GlassbreakSensor:
nativeId = locationDevice.id.toString() + '-sensor';
@@ -346,7 +347,7 @@ export class RingLocationDevice extends ScryptedDeviceBase implements DeviceProv
return this.devices.get(nativeId);
}
async releaseDevice(id: string, nativeId: string): Promise<void> {}
async releaseDevice(id: string, nativeId: string): Promise<void> { }
updateLocationMode(locationMode: LocationMode) {
let mode: SecuritySystemMode;

View File

@@ -84,6 +84,12 @@ class RingPlugin extends ScryptedDeviceBase implements DeviceProvider, Settings
],
defaultValue: 'Disabled',
},
legacyRtspStream: {
title: 'Legacy RTSP Streaming',
description: 'Enable legacy RTSP Stream support. No longer supported and is being phased out by Ring.',
type: 'boolean',
persistedDefaultValue: true,
},
});
constructor() {