From 54db19ef0d26a21f5020f736a22ab57790cdb1e5 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 4 Nov 2021 23:38:34 -0700 Subject: [PATCH] homekit: shot recording options if using a linked motion sensor --- plugins/homekit/package-lock.json | 4 ++-- plugins/homekit/package.json | 2 +- plugins/homekit/src/camera-mixin.ts | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/homekit/package-lock.json b/plugins/homekit/package-lock.json index df67239ac..e9d3ab4cd 100644 --- a/plugins/homekit/package-lock.json +++ b/plugins/homekit/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/homekit", - "version": "0.0.117", + "version": "0.0.118", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/homekit", - "version": "0.0.117", + "version": "0.0.118", "dependencies": { "hap-nodejs": "file:../../external/HAP-NodeJS", "lodash": "^4.17.21", diff --git a/plugins/homekit/package.json b/plugins/homekit/package.json index e39cb6f19..0425e8909 100644 --- a/plugins/homekit/package.json +++ b/plugins/homekit/package.json @@ -40,5 +40,5 @@ "@types/qrcode": "^1.4.1", "@types/url-parse": "^1.4.3" }, - "version": "0.0.117" + "version": "0.0.118" } diff --git a/plugins/homekit/src/camera-mixin.ts b/plugins/homekit/src/camera-mixin.ts index 697a536b5..acc190659 100644 --- a/plugins/homekit/src/camera-mixin.ts +++ b/plugins/homekit/src/camera-mixin.ts @@ -47,7 +47,9 @@ export class CameraMixin extends SettingsMixinDeviceBase implements Setting choices: msos.map(mso => mso.name), }); } - if (this.interfaces.includes(ScryptedInterface.MotionSensor)) { + + const hasMotionSensor = this.storage.getItem('linkedMotionSensor') || this.interfaces.includes(ScryptedInterface.MotionSensor); + if (hasMotionSensor) { if (msos?.length) { settings.push({ title: 'Recording Stream', @@ -76,7 +78,7 @@ export class CameraMixin extends SettingsMixinDeviceBase implements Setting let showTranscodeArgs = this.storage.getItem('transcodeStreaming') === 'true' || this.storage.getItem('transcodeStreamingHub') === 'true'; - if (this.interfaces.includes(ScryptedInterface.MotionSensor)) { + if (hasMotionSensor) { settings.push({ title: 'Transcode Recording', key: 'transcodeRecording',