homebridge-am43-blinds-bluez
Version:
A homebridge plugin to control AM43 based shade motors in HomeKit. These include the A OK and Zemismart bluetooth based motors. This plugin requires a Homebridge host that supports Bluetooth 4.0
46 lines (45 loc) • 1.81 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from "events";
import { PerDeviceConfig } from "./types";
import { Logger } from "homebridge";
export declare class AM43Device extends EventEmitter {
private uuid;
private config;
private primaryServiceUUID;
private controlCharacteristicUUID;
private notificationCallback;
tiltMotor: AM43Device | null;
private log;
name: string;
id: string;
position: number;
targetPosition: number | null;
tilt: number | null;
targetTilt: number | null;
batteryPercentage: number;
hasRunFirstConnect: boolean;
constructor({ uuid, config, interactionTimeout, log, }: {
uuid: string;
config: PerDeviceConfig;
interactionTimeout: number;
log: Logger;
});
firstConnect(): Promise<boolean>;
addTiltMotor(subDevice: AM43Device): void;
get description(): string;
setTilt(tilt: number): Promise<boolean>;
private subscribeToNotifications;
reconnect(): Promise<void>;
disconnect(): Promise<void>;
private unsubscribeToNotifications;
private setupLongUUIDs;
authWithPassCode(passcode: string): Promise<boolean>;
callbackOrTimeout(once: "ble:position", successCallback: (position: number) => void, timeoutCallback: () => void): void;
callbackOrTimeout(once: "ble:auth" | "ble:position_set", successCallback: (success: boolean) => void, timeoutCallback: () => void): void;
callbackOrTimeout(once: "ble:battery", successCallback: (percentage: number) => void, timeoutCallback: () => void): void;
updatePosition(): Promise<number | false>;
updateTilt(): Promise<number | false>;
updateBatteryStatus(): Promise<number | false>;
getDirection(): 0 | 1 | 2 | undefined;
setPosition(target: number): Promise<boolean>;
}