Skip to content

Commit

Permalink
unifi-protect: older controller fix for doorbells
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jul 24, 2023
1 parent 08a8428 commit 19f8bfb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/unifi-protect/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/unifi-protect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/unifi-protect",
"version": "0.0.135",
"version": "0.0.136",
"description": "Unifi Protect Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",
Expand Down
5 changes: 3 additions & 2 deletions plugins/unifi-protect/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device

const managementUrl = `https://${this.storage.getItem('ip')}/protect/timelapse/${camera.id}`;

const isDoorbell = camera.featureFlags.isDoorbell || camera.featureFlags.hasChime;
const d: Device = {
providerNativeId: this.nativeId,
name: camera.name,
Expand All @@ -355,11 +356,11 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device
ScryptedInterface.VideoCameraConfiguration,
ScryptedInterface.MotionSensor,
],
type: camera.featureFlags.isDoorbell
type: isDoorbell
? ScryptedDeviceType.Doorbell
: ScryptedDeviceType.Camera,
};
if (camera.featureFlags.isDoorbell) {
if (isDoorbell) {
d.interfaces.push(ScryptedInterface.BinarySensor);
}
if (camera.featureFlags.hasSpeaker) {
Expand Down

0 comments on commit 19f8bfb

Please sign in to comment.