Skip to content

Commit

Permalink
hap: fix camera init without sensor (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
leedsalex committed Mar 18, 2023
1 parent 21eeab6 commit a520357
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "plugins/homekit/HAP-NodeJS"]
path = external/HAP-NodeJS
url = ../../koush/HAP-NodeJS
[submodule "plugins/unifi-protect/src/unifi-protect"]
path = external/unifi-protect
url = ../../koush/unifi-protect.git
Expand Down
1 change: 0 additions & 1 deletion external/HAP-NodeJS
Submodule HAP-NodeJS deleted from 3fe1f9
6 changes: 3 additions & 3 deletions plugins/homekit/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/homekit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/homekit",
"version": "1.2.16",
"version": "1.2.17",
"description": "HomeKit Plugin for Scrypted",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
Expand Down
7 changes: 4 additions & 3 deletions plugins/homekit/src/types/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ addSupportedType({
const detectAudio = storage.getItem('detectAudio') === 'true';
const needAudioMotionService = device.interfaces.includes(ScryptedInterface.AudioSensor) && detectAudio;
const linkedMotionSensor = storage.getItem('linkedMotionSensor');
const isRecordingEnabled = !!linkedMotionSensor || device.interfaces.includes(ScryptedInterface.MotionSensor) || needAudioMotionService

const storageKeySelectedRecordingConfiguration = 'selectedRecordingConfiguration';

let configuration: CameraRecordingConfiguration;
const openRecordingStreams = new Map<number, Deferred<any>>();
if (linkedMotionSensor || device.interfaces.includes(ScryptedInterface.MotionSensor) || needAudioMotionService) {
if (isRecordingEnabled) {
recordingDelegate = {
updateRecordingConfiguration(newConfiguration: CameraRecordingConfiguration ) {
configuration = newConfiguration;
Expand Down Expand Up @@ -193,12 +194,12 @@ addSupportedType({
cameraStreamCount: 8,
delegate,
streamingOptions,
recording: {
recording: !isRecordingEnabled ? undefined : {
options: recordingOptions,
delegate: recordingDelegate,
},
sensors: {
motion: true,
motion: isRecordingEnabled,
},
});

Expand Down

0 comments on commit a520357

Please sign in to comment.