import { HomebridgeAccessory, TuyaWebPlatform } from "../platform"; import { Categories, Characteristic, CharacteristicGetCallback, CharacteristicValue, Logger, Nullable, Service, WithUUID } from "homebridge"; import { ErrorCallback } from "../errors"; import { GeneralCharacteristic } from "./characteristics"; import { DeviceState, TuyaApiMethod, TuyaApiPayload, TuyaDevice } from "../api/response"; import { TuyaDeviceDefaults } from "../config"; export declare type CharacteristicConstructor = WithUUID<{ new (): Characteristic; }>; declare type UpdateCallback = (data?: DeviceState, callback?: CharacteristicGetCallback) => void; export declare abstract class BaseAccessory { readonly platform: TuyaWebPlatform; readonly deviceConfig: TuyaDevice; private readonly categoryType; readonly log: Logger; private readonly serviceType; readonly service?: Service; readonly deviceId: string; private updateCallbackList; /** * The characteristics that this device-type could theoretically support. */ abstract get accessorySupportedCharacteristics(): GeneralCharacteristic[]; /** * The characteristics that this device-type is required to support. */ abstract get requiredCharacteristics(): GeneralCharacteristic[]; /** * The characteristics that this device actually supports. */ get deviceSupportedCharacteristics(): GeneralCharacteristic[]; readonly homebridgeAccessory: HomebridgeAccessory; constructor(platform: TuyaWebPlatform, homebridgeAccessory: HomebridgeAccessory | undefined, deviceConfig: TuyaDevice, categoryType: Categories); private get cache(); /** private get defaultCharacteristics(): CharacteristicConstructor[] { return [ this.platform.Characteristic.Manufacturer, this.platform.Characteristic.Model, this.platform.Characteristic.Name, this.platform.Characteristic.SerialNumber, ]; } */ private initializeCharacteristics; private cleanupServices; /** * Should validate and correct the supplied overwrite configuration for this device. * @param config * @returns A list of all errors in this config. */ validateConfigOverwrites(config?: Partial): string[]; get name(): string; setTuyaCharacteristic(characteristic: CharacteristicConstructor, data: DeviceState): void; setCharacteristic(characteristic: CharacteristicConstructor, value: Nullable, updateHomekit?: boolean): void; onIdentify(): void; cachedValue(always?: boolean): Nullable; private debouncedDeviceStateRequest; private debouncedDeviceStateRequestPromise?; resolveDeviceStateRequest(): Promise; getDeviceState(): Promise; setDeviceState(method: Method, payload: TuyaApiPayload, cache: T): Promise; updateAccessory(device: TuyaDevice): void; private updateState; addUpdateCallback(char: CharacteristicConstructor, callback: UpdateCallback): void; handleError(type: "SET" | "GET", callback: ErrorCallback): ErrorCallback; private shortcutLog; protected debug(message: string, ...args: unknown[]): void; protected info(message: string, ...args: unknown[]): void; protected warn(message: string, ...args: unknown[]): void; protected error(message: string, ...args: unknown[]): void; } export {}; //# sourceMappingURL=BaseAccessory.d.ts.map