UNPKG

homebridge-homeconnect

Version:

A Homebridge plugin that connects Home Connect appliances to Apple HomeKit

106 lines 6.09 kB
import { Characteristic, CharacteristicValue, Logger, Nullable, PlatformAccessory, Service } from 'homebridge'; import { PersistCache } from './persist-cache.js'; import { ApplianceConfig } from './config-types.js'; import { HomeConnectDevice } from './homeconnect-device.js'; import { SerialisedOperation, SerialisedValue } from './serialised.js'; import { HomeConnectPlatform } from './platform.js'; import { ConfigSchemaData, SchemaOptionalFeature } from './homebridge-ui/schema-data.js'; import { ServiceNames } from './service-name.js'; type ServiceConstructor = typeof Service & { new (displayName?: string, subtype?: string): Service; UUID: string; }; export type OnSetHandler<Type> = (value: Type) => unknown; export declare class ApplianceBase { readonly log: Logger; readonly platform: HomeConnectPlatform; readonly device: HomeConnectDevice; readonly accessory: PlatformAccessory; readonly Service: typeof Service; readonly Characteristic: typeof Characteristic; readonly config: ApplianceConfig; readonly schema: ConfigSchemaData; readonly optionalFeatures: SchemaOptionalFeature[]; readonly cache: PersistCache; readonly cachedOperation: Record<string, string>; readonly cachedPromise: Map<string, Promise<unknown>>; readonly asyncInitTasks: { name: string; promise: Promise<void>; }[]; serviceNames: ServiceNames; readonly accessoryInformationService: Service; readonly obsoleteServices: Service[]; disconnectedHapStatusError: boolean; constructor(log: Logger, platform: HomeConnectPlatform, device: HomeConnectDevice, accessory: PlatformAccessory); asyncInitialise(name: string, promise: Promise<void>): void; waitAsyncInitialisation(): Promise<void>; makeService(serviceConstructor: ServiceConstructor, suffix?: string, subtype?: string): Service; cleanupServices(): void; cleanupOldVersions(): void; unregister(): void; identify(): Promise<void>; hasOptionalFeature(service: string, name: string, group?: string, enableByDefault?: boolean): boolean; setOptionalFeatures(): Promise<void>; getCached<Type>(key: string, operation: () => Promise<Type>): Promise<Type>; doCachedOperation<Type>(key: string, operation: () => Promise<Type>): Promise<Type>; makeSerialised<Value extends SerialisedValue, Returns = void>(operation: SerialisedOperation<Value, Returns>, defaultValue?: Value): (value?: Value) => Promise<Returns>; makeSerialisedObject<Value extends object, Returns = void>(operation: SerialisedOperation<Value, Returns>): (value?: Value) => Promise<Returns>; registerDisconnectedOnGet(): void; onGet(characteristic: Characteristic): Nullable<CharacteristicValue>; onSet<Type>(assertIsType: (value: unknown) => asserts value is Type, characteristic: Characteristic, handler: OnSetHandler<Type>): Characteristic; onSetBoolean(...args: [Characteristic, OnSetHandler<boolean>]): Characteristic; onSetNumber(...args: [Characteristic, OnSetHandler<number>]): Characteristic; onSetString(...args: [Characteristic, OnSetHandler<string>]): Characteristic; } export type ApplianceConstructorArgs = ConstructorParameters<typeof ApplianceBase>; export declare const ApplianceGeneric: { new (...args: any[]): { readonly powerService?: Service; defaultOffValue?: import("./api-value-types.js").PowerState; initHasPower(): Promise<void>; updatePowerHK(): void; hasPowerOff(offValue: import("./api-value-types.js").PowerState): void; readonly Service: typeof Service; readonly Characteristic: typeof Characteristic; readonly config: ApplianceConfig; readonly schema: ConfigSchemaData; readonly optionalFeatures: SchemaOptionalFeature[]; readonly cache: PersistCache; readonly cachedOperation: Record<string, string>; readonly cachedPromise: Map<string, Promise<unknown>>; readonly asyncInitTasks: { name: string; promise: Promise<void>; }[]; serviceNames: ServiceNames; readonly accessoryInformationService: Service; readonly obsoleteServices: Service[]; disconnectedHapStatusError: boolean; readonly log: Logger; readonly platform: HomeConnectPlatform; readonly device: HomeConnectDevice; readonly accessory: PlatformAccessory; asyncInitialise(name: string, promise: Promise<void>): void; waitAsyncInitialisation(): Promise<void>; makeService(serviceConstructor: ServiceConstructor, suffix?: string, subtype?: string): Service; cleanupServices(): void; cleanupOldVersions(): void; unregister(): void; identify(): Promise<void>; hasOptionalFeature(service: string, name: string, group?: string, enableByDefault?: boolean): boolean; setOptionalFeatures(): Promise<void>; getCached<Type>(key: string, operation: () => Promise<Type>): Promise<Type>; doCachedOperation<Type>(key: string, operation: () => Promise<Type>): Promise<Type>; makeSerialised<Value extends SerialisedValue, Returns = void>(operation: SerialisedOperation<Value, Returns>, defaultValue?: Value): (value?: Value) => Promise<Returns>; makeSerialisedObject<Value extends object, Returns = void>(operation: SerialisedOperation<Value, Returns>): (value?: Value) => Promise<Returns>; registerDisconnectedOnGet(): void; onGet(characteristic: Characteristic): Nullable<CharacteristicValue>; onSet<Type>(assertIsType: (value: unknown) => asserts value is Type, characteristic: Characteristic, handler: OnSetHandler<Type>): Characteristic; onSetBoolean(args_0: Characteristic, args_1: OnSetHandler<boolean>): Characteristic; onSetNumber(args_0: Characteristic, args_1: OnSetHandler<number>): Characteristic; onSetString(args_0: Characteristic, args_1: OnSetHandler<string>): Characteristic; }; } & typeof ApplianceBase; export {}; //# sourceMappingURL=appliance-generic.d.ts.map