UNPKG

homebridge-unifi-protect

Version:

Homebridge UniFi Protect plugin providing complete HomeKit integration for the entire UniFi Protect ecosystem with full support for most features including HomeKit Secure Video, multiple controllers, blazing fast performance, and much more.

92 lines (91 loc) 3.8 kB
import type { API, HAP, PlatformAccessory, Service, WithUUID } from "homebridge"; import { type HomebridgePluginLogging, type Nullable } from "homebridge-plugin-utils"; import type { ProtectApi, ProtectEventPacket, ProtectNvrConfig } from "unifi-protect"; import { type ProtectDeviceConfigTypes } from "../protect-types.js"; import type { ProtectNvr } from "../protect-nvr.js"; import type { ProtectPlatform } from "../protect-platform.js"; export interface ProtectHints { crop: boolean; cropOptions: { height: number; width: number; x: number; y: number; }; enabled: boolean; hardwareDecoding: boolean; hardwareTranscoding: boolean; highResSnapshots: boolean; hksvRecordingIndicator: boolean; ledStatus: boolean; logDoorbell: boolean; logHksv: boolean; logMotion: boolean; motionDuration: number; nightVision: boolean; occupancyDuration: number; probesize: number; recordingDefault: string; smartDetect: boolean; smartDetectSensors: boolean; smartOccupancy: string[]; standalone: boolean; streamingDefault: string; syncName: boolean; transcode: boolean; transcodeBitrate: number; transcodeHighLatency: boolean; transcodeHighLatencyBitrate: number; tsbStreaming: boolean; twoWayAudio: boolean; twoWayAudioDirect: boolean; } export declare abstract class ProtectBase { readonly api: API; private debug; protected readonly hap: HAP; readonly log: HomebridgePluginLogging; readonly nvr: ProtectNvr; ufpApi: ProtectApi; readonly platform: ProtectPlatform; constructor(nvr: ProtectNvr); protected setInfo(accessory: PlatformAccessory, device: ProtectDeviceConfigTypes | ProtectNvrConfig): boolean; get name(): string; } export declare abstract class ProtectDevice extends ProtectBase { accessory: PlatformAccessory; hints: ProtectHints; protected listeners: { [index: string]: (packet: ProtectEventPacket) => void; }; ufp: ProtectDeviceConfigTypes; constructor(nvr: ProtectNvr, accessory: PlatformAccessory); protected acquireService(serviceType: WithUUID<typeof Service>, name?: string, subtype?: string, onServiceCreate?: (svc: Service) => void): Nullable<Service>; protected validService(serviceType: WithUUID<typeof Service>, validate: boolean, subtype?: string): boolean; protected configureHints(): boolean; configureInfo(): boolean; cleanup(): void; protected publish(topic: string, message: string): void; protected subscribeGet(topic: string, type: string, getValue: () => string): void; protected subscribeSet(topic: string, type: string, setValue: (value: string, rawValue: string) => Promise<void> | void): void; protected configureMotionSensor(isEnabled?: boolean, isInitialized?: boolean): boolean; private configureMotionSwitch; private configureMotionTrigger; protected configureOccupancySensor(isEnabled?: boolean, isInitialized?: boolean): boolean; protected configureStatusLedSwitch(isEnabled?: boolean): boolean; setStatusLed(value: boolean): Promise<boolean>; getFeatureFloat(option: string): Nullable<number | undefined>; getFeatureNumber(option: string): Nullable<number | undefined>; getFeatureValue(option: string): Nullable<string | undefined>; hasFeature(option: string): boolean; isDeviceFeature(option: string): boolean; logFeature(option: string, message: string, nvrMessage?: string): void; isReservedName(name?: string): boolean; get isOnline(): boolean; get id(): string; get name(): string; get accessoryName(): string; set accessoryName(name: string); protected statusLedCommand(value: boolean): object; get statusLed(): boolean; }