homebridge-homeconnect
Version:
A Homebridge plugin that connects Home Connect appliances to Apple HomeKit
75 lines • 4.4 kB
TypeScript
import { Characteristic, Service } from 'homebridge';
import { ApplianceBase } from './appliance-generic.js';
import { Constructor } from './utils.js';
import { OptionKey, OptionValue } from './api-value.js';
export interface FanLevel<Key extends OptionKey = OptionKey> {
key: Key;
value: OptionValue<Key>;
}
export interface FanLevelPercent<Key extends OptionKey = OptionKey> extends FanLevel<Key> {
percent: number;
siri?: string;
}
export interface UpdateFanHCValue {
active?: number;
auto?: number;
percent?: number;
boost?: boolean;
}
export declare function HasFan<TBase extends Constructor<ApplianceBase>>(Base: TBase): {
new (...args: any[]): {
readonly activeService: Service;
boostService?: Service;
fanSupportsAuto?: boolean;
fanLevels: FanLevelPercent[];
fanPercentStep: number;
initHasFan(): Promise<void>;
addFan(updateHC: (value?: UpdateFanHCValue) => Promise<void>): void;
addFanBoost(updateHC: (value?: UpdateFanHCValue) => Promise<void>): Service;
updateFanHC({ active, auto, percent, boost }: UpdateFanHCValue): Promise<void>;
setFan(active: boolean, auto: boolean, percent: number, boost?: boolean): Promise<void>;
fromFanSpeedPercent(percent: number): FanLevelPercent;
toFanSpeedPercent(option: FanLevel): number;
readonly Service: typeof Service;
readonly Characteristic: typeof Characteristic;
readonly config: import("./config-types.js").ApplianceConfig;
readonly schema: import("./homebridge-ui/schema-data.js").ConfigSchemaData;
readonly optionalFeatures: import("./homebridge-ui/schema-data.js").SchemaOptionalFeature[];
readonly cache: import("./persist-cache.js").PersistCache;
readonly cachedOperation: Record<string, string>;
readonly cachedPromise: Map<string, Promise<unknown>>;
readonly asyncInitTasks: {
name: string;
promise: Promise<void>;
}[];
serviceNames: import("./service-name.js").ServiceNames;
readonly accessoryInformationService: Service;
readonly obsoleteServices: Service[];
readonly log: import("homebridge").Logger;
readonly platform: import("./platform.js").HomeConnectPlatform;
readonly device: import("./homeconnect-device.js").HomeConnectDevice;
readonly accessory: import("homebridge").PlatformAccessory;
asyncInitialise(name: string, promise: Promise<void>): void;
waitAsyncInitialisation(): Promise<void>;
makeService(serviceConstructor: typeof Service & {
new (displayName?: string, subtype?: string): Service;
UUID: string;
}, 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(): void;
getCached<Type>(key: string, operation: () => Promise<Type>): Promise<Type>;
doCachedOperation<Type>(key: string, operation: () => Promise<Type>): Promise<Type>;
makeSerialised<Value extends import("./serialised.js").SerialisedValue, Returns = void>(operation: import("./serialised.js").SerialisedOperation<Value, Returns>, defaultValue?: Value): (value?: Value) => Promise<Returns>;
makeSerialisedObject<Value extends object, Returns = void>(operation: import("./serialised.js").SerialisedOperation<Value, Returns>): (value?: Value) => Promise<Returns>;
onSet<Type>(handler: import("./appliance-generic.js").OnSetHandler<Type>, assertIsType: (value: unknown) => asserts value is Type): import("homebridge").CharacteristicSetHandler;
onSetBoolean(handler: import("./appliance-generic.js").OnSetHandler<boolean>): import("homebridge").CharacteristicSetHandler;
onSetNumber(handler: import("./appliance-generic.js").OnSetHandler<number>): import("homebridge").CharacteristicSetHandler;
onSetString(handler: import("./appliance-generic.js").OnSetHandler<string>): import("homebridge").CharacteristicSetHandler;
trap<Type>(when: string, promise: Promise<Type> | Type, canThrow?: boolean): Promise<Type | undefined>;
};
} & TBase;
//# sourceMappingURL=has-fan.d.ts.map