homebridge-tasmota
Version:
Homebridge plugin for Tasmota devices leveraging home assistant auto discovery.
52 lines (51 loc) • 2.45 kB
TypeScript
import { API, Characteristic, DynamicPlatformPlugin, Logger, PlatformAccessory, Service } from 'homebridge';
import { Mqtt } from './lib/Mqtt.js';
import { tasmotaBinarySensorService } from './tasmotaBinarySensorService.js';
import { tasmotaFanService } from './tasmotaFanService.js';
import { tasmotaGarageService } from './tasmotaGarageService.js';
import { tasmotaLightService } from './tasmotaLightService.js';
import { tasmotaSensorService } from './tasmotaSensorService.js';
import { tasmotaSwitchService } from './tasmotaSwitchService.js';
type TasmotaService = tasmotaGarageService | tasmotaSwitchService | tasmotaLightService | tasmotaSensorService | tasmotaBinarySensorService | tasmotaFanService;
/**
* TasmotaPlatform
*/
export declare class tasmotaPlatform implements DynamicPlatformPlugin {
readonly log: Logger;
readonly config: any;
readonly api: API;
readonly Service: typeof Service;
readonly Characteristic: typeof Characteristic;
readonly CustomServices: any;
readonly CustomCharacteristics: any;
readonly accessories: PlatformAccessory[];
private readonly defunctAccessories;
readonly services: Record<string, TasmotaService>;
private discoveryTopicMap;
mqttHost: Mqtt;
private cleanup;
private timeouts;
private timeoutCounter;
private debug;
FakeGatoHistoryService: any;
teleperiod: number;
constructor(log: Logger, config: any, api: API);
/**
* This function is invoked when homebridge restores cached accessories from disk at startup.
* It should be used to setup event handlers for characteristics and update respective values.
*/
configureAccessory(accessory: PlatformAccessory): void;
isTopicAllowed(topic: string, filter: string, filterAllow: Array<string>, filterDeny: Array<string>): boolean;
/**
* This is an example method showing how to register discovered accessories.
* Accessories must only be registered once, previously created accessories
* must not be registered again to prevent "duplicate UUID" errors.
*/
discoverDevices(): void;
discoveryOveride(uniq_id: string, message: any): import("./utils.js").Message;
serviceCleanup(uniq_id: string, existingAccessory: PlatformAccessory): void;
autoCleanup(accessory: PlatformAccessory): number | null;
accessoryCleanup(existingAccessory: PlatformAccessory): void;
cleanupDefunctAccessories(): void;
}
export {};