UNPKG

ws2801-client

Version:

A client for the webserver for the WS2801-Pi module.

27 lines (26 loc) 1.24 kB
import { LedColor, LedStrip } from './types/index'; export declare class WS2801Client { private httpClient; private socketClient; constructor(baseUrl: string, apiKey?: string); setApiKey(apiKey: string): void; dispose(): void; loginRequired(): Promise<boolean>; register(username: string, password: string): Promise<string>; login(username: string, password: string): Promise<string>; getLedStrip(): Promise<LedStrip>; fillLedStrip(color: LedColor, brightness?: number): Promise<LedStrip>; clearLedStrip(): Promise<LedStrip>; setLed(ledIndex: number, color: LedColor, brightness?: number): Promise<LedStrip>; setLedStrip(ledStrip: LedStrip, brightness?: number): Promise<LedStrip>; setBrightness(brightness: number | 'auto'): Promise<void>; getBrightness(): Promise<number | 'auto'>; onLedStripChanged(callback: (ledStrip: LedStrip) => void | Promise<void>): string; onBrightnessChanged(callback: (brightness: number) => void | Promise<void>): string; removeListener(id: string): void; startAnimation(animationScript: string): Promise<{ finishPromise: Promise<void>; }>; stopAnimation(): Promise<void>; waitForAnimationToFinish(): Promise<void>; }