ring: fix light status update

This commit is contained in:
Koushik Dutta
2022-04-04 14:44:20 -07:00
parent 1ed1f14b06
commit 6e48a5e2ba
3 changed files with 7 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/ring",
"version": "0.0.71",
"version": "0.0.72",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/ring",
"version": "0.0.71",
"version": "0.0.72",
"dependencies": {
"@koush/ring-client-api": "file:../../external/ring-client-api",
"@types/node": "^16.6.1",

View File

@@ -42,5 +42,5 @@
"@scrypted/sdk": "file:../../sdk",
"typescript": "^4.6.2"
},
"version": "0.0.71"
"version": "0.0.72"
}

View File

@@ -529,8 +529,10 @@ class RingCameraDevice extends ScryptedDeviceBase implements Intercom, Settings,
}
updateState(data: CameraData) {
if (data.led_status)
this.on = data.led_status === 'on';
if (this.findCamera().hasLight && data.led_status) {
const light = this.getDevice(undefined);
light.on = data.led_status === 'on';
}
}
}