UNPKG

homebridge-kobold

Version:

A Vorwerk Kobold vacuum robot plugin for homebridge.

55 lines (54 loc) 2.04 kB
import type { API, Characteristic, DynamicPlatformPlugin, Logging, PlatformAccessory, PlatformConfig, Service } from 'homebridge'; import type { KoboldRobot } from 'node-kobold-control'; import { type SpotCharacteristicConstructors } from './customCharacteristics.js'; import { KoboldVacuumAccessory } from './platformAccessory.js'; export interface KoboldPlatformConfig extends PlatformConfig { token?: string; language?: string; refresh?: string | number; hidden?: string[] | string; disabled?: string[] | string; } export interface KoboldBoundary { id: string; name: string; type?: string; } export interface RobotRecord { device: KoboldRobot; meta: Record<string, unknown>; availableServices: Record<string, unknown>; mainAccessory?: KoboldVacuumAccessory; timer?: NodeJS.Timeout; lastUpdate?: Date; } type RefreshSetting = number | 'auto'; export declare class KoboldHomebridgePlatform implements DynamicPlatformPlugin { readonly log: Logging; readonly config: PlatformConfig; readonly api: API; readonly Service: typeof Service; readonly Characteristic: typeof Characteristic; readonly accessories: Map<string, PlatformAccessory>; readonly discoveredCacheUUIDs: string[]; readonly robots: RobotRecord[]; nextRoom: string | null; readonly language: string; readonly hiddenServices: string[] | string; readonly refresh: RefreshSetting; readonly spotCharacteristics: SpotCharacteristicConstructors; private readonly token; constructor(log: Logging, config: PlatformConfig, api: API); configureAccessory(accessory: PlatformAccessory): void; isServiceHidden(key: string): boolean; private parseRefresh; private discoverRobots; private loadRobots; private setupMainAccessory; private prepareAccessory; private cleanupAccessories; getRobot(serial: string): RobotRecord | undefined; updateRobot(serial: string): Promise<void>; updateRobotTimer(serial: string): void; } export {};