homebridge-unifi-occupancy-lite
Version:
Lightweight UniFi occupancy sensor plugin for Homebridge using API tokens only. Works with UDM Pro/SE, UDM, UDR and other UniFi OS devices.
69 lines (68 loc) • 1.69 kB
TypeScript
export interface DeviceConfig {
name: string;
hostname?: string;
ip?: string;
mac?: string;
minTrafficAmount?: number;
}
export interface ResidentConfig {
name: string;
devices: DeviceConfig[];
}
export interface WifiPointConfig {
name: string;
ip?: string;
mac?: string;
}
export declare class Device {
name: string;
hostname?: string;
ip?: string;
mac?: string;
minTrafficAmount?: number;
lastSeen?: Date;
isOnline: boolean;
currentAccessPoint?: string;
trafficBytes: number;
constructor(config: DeviceConfig);
/**
* Check if this device matches the given UniFi client
*/
matchesClient(client: any): boolean;
/**
* Update device status from UniFi client data
*/
updateFromClient(client: any, trafficData?: {
rx_bytes: number;
tx_bytes: number;
} | null): void;
}
export declare class Resident {
name: string;
devices: Device[];
isHome: boolean;
constructor(config: ResidentConfig);
/**
* Update resident status based on device presence
*/
updatePresence(): void;
/**
* Get devices connected to specific access point
*/
getDevicesAtAccessPoint(accessPointMac: string): Device[];
}
export declare class WifiPoint {
name: string;
ip?: string;
mac?: string;
hasResidents: boolean;
constructor(config: WifiPointConfig);
/**
* Check if this wifi point matches the given access point
*/
matchesAccessPoint(accessPoint: any): boolean;
/**
* Update presence based on residents at this access point
*/
updatePresence(residents: Resident[]): void;
}