From b87b2b0aae8bd48120ab9932e91cbedcd2301c0a Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 11 Oct 2021 00:45:23 -0700 Subject: [PATCH] unifi-protect: object types refactor --- plugins/unifi-protect/package-lock.json | 4 ++-- plugins/unifi-protect/package.json | 2 +- plugins/unifi-protect/src/main.ts | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/unifi-protect/package-lock.json b/plugins/unifi-protect/package-lock.json index 74f503451..ae5eaad7e 100644 --- a/plugins/unifi-protect/package-lock.json +++ b/plugins/unifi-protect/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.42", + "version": "0.0.43", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/unifi-protect", - "version": "0.0.42", + "version": "0.0.43", "license": "Apache", "dependencies": { "@types/ws": "^7.4.7", diff --git a/plugins/unifi-protect/package.json b/plugins/unifi-protect/package.json index 1bbd739f9..7cb5825b6 100644 --- a/plugins/unifi-protect/package.json +++ b/plugins/unifi-protect/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.42", + "version": "0.0.43", "description": "Unifi Protect Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/unifi-protect/src/main.ts b/plugins/unifi-protect/src/main.ts index 58a0bfc22..6816f5203 100644 --- a/plugins/unifi-protect/src/main.ts +++ b/plugins/unifi-protect/src/main.ts @@ -1,4 +1,4 @@ -import sdk, { ScryptedDeviceBase, DeviceProvider, Settings, Setting, ScryptedDeviceType, VideoCamera, MediaObject, Device, MotionSensor, ScryptedInterface, Camera, MediaStreamOptions, Intercom, ScryptedMimeTypes, FFMpegInput, ObjectDetection, ObjectDetector, PictureOptions } from "@scrypted/sdk"; +import sdk, { ScryptedDeviceBase, DeviceProvider, Settings, Setting, ScryptedDeviceType, VideoCamera, MediaObject, Device, MotionSensor, ScryptedInterface, Camera, MediaStreamOptions, Intercom, ScryptedMimeTypes, FFMpegInput, ObjectDetection, ObjectDetector, PictureOptions, ObjectDetectionTypes } from "@scrypted/sdk"; import { ProtectApi } from "./unifi-protect/src/protect-api"; import { ProtectApiUpdates, ProtectNvrUpdatePayloadCameraUpdate, ProtectNvrUpdatePayloadEventAdd } from "./unifi-protect/src/protect-api-updates"; import { ProtectCameraChannelConfig, ProtectCameraConfigInterface } from "./unifi-protect/src/protect-types"; @@ -31,8 +31,10 @@ class UnifiCamera extends ScryptedDeviceBase implements Camera, VideoCamera, Mot } } - async getObjectTypes(): Promise { - return this.findCamera().featureFlags.smartDetectTypes; + async getObjectTypes(): Promise { + return { + detections: this.findCamera().featureFlags.smartDetectTypes, + } } async getDetectionInput(detectionId: any): Promise {