homebridge-kasa-python
Version:
Plugin that uses Python-Kasa API to communicate with Kasa Devices.
31 lines (30 loc) • 1.52 kB
TypeScript
import { Categories, Characteristic, CharacteristicValue, HapStatusError, Logger, Nullable, PlatformAccessory, Service, WithUUID } from 'homebridge';
import DeviceManager from './deviceManager.js';
import type KasaPythonPlatform from '../platform.js';
import type { KasaDevice } from './kasaDevices.js';
import type { KasaPythonAccessoryContext } from '../platform.js';
export default abstract class HomeKitDevice {
readonly platform: KasaPythonPlatform;
kasaDevice: KasaDevice;
readonly category: Categories;
readonly categoryName: string;
readonly log: Logger;
protected deviceManager: DeviceManager | undefined;
homebridgeAccessory: PlatformAccessory<KasaPythonAccessoryContext>;
isUpdating: boolean;
constructor(platform: KasaPythonPlatform, kasaDevice: KasaDevice, category: Categories, categoryName: string);
private initializeAccessory;
private updateAccessory;
private correctAccessoryProperties;
get id(): string;
get name(): string;
get manufacturer(): string;
get model(): string;
get serialNumber(): string;
get firmwareRevision(): string;
abstract identify(): void;
abstract updateAfterPeriodicDiscovery(): void;
abstract startPolling(): void;
addService(serviceConstructor: WithUUID<typeof this.platform.Service>, name: string, subType?: string): Service;
updateValue(service: Service, characteristic: Characteristic, deviceAlias: string, value: Nullable<CharacteristicValue> | Error | HapStatusError): void;
}