homebridge-tsvesync
Version:
Homebridge plugin for VeSync devices including Levoit air purifiers, humidifiers, and Etekcity smart outlets
72 lines • 2.35 kB
TypeScript
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, Service, Characteristic } from 'homebridge';
import { PlatformConfig as TSVESyncPlatformConfig } from './types/device.types';
/**
* HomebridgePlatform
* This class is the main constructor for your plugin, this is where you should
* parse the user config and discover/register accessories with Homebridge.
*/
export declare class TSVESyncPlatform implements DynamicPlatformPlugin {
readonly log: Logger;
readonly config: TSVESyncPlatformConfig;
readonly api: API;
readonly Service: typeof Service;
readonly Characteristic: typeof Characteristic;
readonly accessories: PlatformAccessory[];
private readonly deviceAccessories;
private client;
private deviceUpdateInterval?;
private readonly updateInterval;
private readonly debug;
private lastLoginAttempt;
private loginBackoffTime;
private initializationPromise;
private initializationResolver;
private isInitialized;
private readonly logger;
private readonly TOKEN_EXPIRY;
private lastTokenRefresh;
constructor(log: Logger, config: TSVESyncPlatformConfig, api: API);
/**
* Check if platform is ready
*/
isReady(): Promise<void>;
/**
* Initialize the platform
*/
private initializePlatform;
/**
* This function is invoked when homebridge restores cached accessories from disk at startup.
*/
configureAccessory(accessory: PlatformAccessory): void;
/**
* Get all devices from all categories
*/
private getAllDevices;
/**
* Create a serializable device context
*/
private createDeviceContext;
/**
* Ensure client is logged in, but avoid unnecessary logins
*/
private ensureLogin;
/**
* Update device states periodically
*/
private updateDeviceStates;
/**
* Check if a device should be excluded based on configuration
*/
private shouldExcludeDevice;
/**
* This function discovers and registers your devices as accessories
*/
discoverDevices(): Promise<void>;
/**
* Generate a consistent UUID for a device
* @param device The device to generate a UUID for
* @returns The generated UUID string
*/
private generateDeviceUUID;
}
//# sourceMappingURL=platform.d.ts.map