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.

112 lines 4.74 kB
import type { API, Service, WithUUID } from "homebridge"; import type { AcquireServiceTarget, HomebridgePluginLogging, Nullable } from "homebridge-plugin-utils"; import type { DeviceCollectionKey, ProtectDeviceConfig } from "unifi-protect"; import type { ProtectAccessory, ProtectPersistedContextState, ProtectProjectionMap, WithoutIdentity } from "../types.ts"; import { TimerRegistry } from "homebridge-plugin-utils"; import { ProtectBase } from "./device-base.ts"; import type { ProtectNvr } from "../nvr/nvr.ts"; import type { ProtectPlatform } from "../platform.ts"; 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; rtspDefault: string; smartDetect: boolean; smartDetectSensors: boolean; smartOccupancy: string[]; standalone: boolean; substrateDefault: string; syncName: boolean; transcode: boolean; transcodeBitrate: number; transcodeHighLatency: boolean; transcodeHighLatencyBitrate: number; tsbStreaming: boolean; twoWayAudio: boolean; twoWayAudioDirect: boolean; } export interface ProtectDeviceContext { readonly accessory: ProtectAccessory; readonly accessoryName: string; readonly api: API; hasFeature(option: string): boolean; readonly hints: ProtectHints; readonly isReachable: boolean; readonly log: HomebridgePluginLogging; readonly nvr: ProtectNvr; readonly platform: ProtectPlatform; setStatusLed(value: boolean): Promise<boolean>; } export declare abstract class ProtectDevice extends ProtectBase implements ProtectDeviceContext { accessory: ProtectAccessory; protected readonly controller: AbortController; protected readonly device: ProtectProjectionMap[DeviceCollectionKey]; hints: ProtectHints; protected readonly signal: AbortSignal; protected readonly timers: TimerRegistry; constructor(nvr: ProtectNvr, accessory: ProtectAccessory, device: ProtectProjectionMap[DeviceCollectionKey]); get ufp(): Readonly<WithoutIdentity<ProtectDeviceConfig>>; get protectId(): string; get modelKey(): ProtectDeviceConfig["modelKey"]; get recordPresent(): boolean; protected fromRecord<T>(read: (config: this["ufp"]) => T, absent: T): T; protected acquireService(serviceType: AcquireServiceTarget, name?: string, subtype?: string, onServiceCreate?: (svc: Service) => void): Nullable<Service>; protected validService(serviceType: WithUUID<typeof Service>, validate: boolean | ((hasService: boolean) => boolean), subtype?: string): boolean; protected configureHints(): boolean; configureInfo(): boolean; protected resetAccessoryContext(preserved?: ProtectPersistedContextState): void; protected seedContextIdentity(): void; cleanup(): void; protected get mqttId(): string; 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 isReachable(): boolean; protected spawnObservers(): void; protected get observeSignal(): AbortSignal; protected onObserverWake(key: string): void; private deviceConfigSelector; protected get syncedName(): string; protected syncNameFromController(): void; refreshReachability(): Nullable<{ now: boolean; was: boolean; }>; get id(): string; get mac(): string; get name(): string; protected get logName(): string; get accessoryName(): string; set accessoryName(name: string); protected statusLedCommand(value: boolean): () => Promise<unknown>; private hasLedSettings; get statusLed(): boolean; } //# sourceMappingURL=device.d.ts.map