@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
97 lines • 3.93 kB
TypeScript
import { Optional, DeltaMap } from '../../../../../common';
import { DiyEffect } from '../../../../../data';
import { DeviceOpState, DeviceState, ModeState, LightEffectState, LightEffect, StateCommandAndStatus, ColorTempState, MeasurementData } from '../../../states';
import { DeviceModel } from '../../../devices.model';
import { BehaviorSubject } from 'rxjs';
export declare enum RGBICModes {
SCENE = 4,
MIC = 19,
DIY = 10,
SEGMENT_COLOR = 21,
WHOLE_COLOR = 2
}
export declare class SceneModeState extends LightEffectState {
constructor(device: DeviceModel, opType?: number, identifier?: number[]);
parseOpCommand(opCommand: number[]): void;
protected readonly stateToCommand: (nextState: LightEffect) => Optional<StateCommandAndStatus>;
}
export declare const MicModeStateName: 'micMode';
export type MicModeStateName = typeof MicModeStateName;
export type MicMode = {
micScene?: number;
sensitivity?: number;
calm?: boolean;
autoColor?: boolean;
color?: {
red: number;
blue: number;
green: number;
};
};
export declare class MicModeState extends DeviceOpState<MicModeStateName, MicMode> {
constructor(device: DeviceModel, opType?: number, identifier?: number[]);
parseOpCommand(opCommand: number[]): void;
protected readonly stateToCommand: (nextState: MicMode) => Optional<StateCommandAndStatus>;
}
export declare const DiyModeStateName: 'diyEffect';
export type DiyModeStateName = typeof DiyModeStateName;
export declare class DiyModeState extends DeviceOpState<DiyModeStateName, Partial<DiyEffect>> {
readonly effects: DeltaMap<number, DiyEffect>;
readonly activeEffectCode: BehaviorSubject<number | undefined>;
constructor(device: DeviceModel);
parseOpCommand(opCommand: number[]): void;
protected readonly stateToCommand: (state: Partial<DiyEffect>) => Optional<StateCommandAndStatus>;
}
export declare class ColorTemperatureModeState extends ColorTempState {
constructor(device: DeviceModel);
parseOpCommand(opCommand: number[]): void;
protected readonly stateToCommand: (nextState: MeasurementData) => Optional<StateCommandAndStatus>;
}
export declare const SegmentColorModeStateName: 'segmentColorMode';
export type SegmentColorModeStateName = typeof SegmentColorModeStateName;
type Color = {
red: number;
green: number;
blue: number;
};
export type Segment = {
id?: number;
brightness?: number;
color?: Color;
};
export declare class SegmentColorModeState extends DeviceOpState<SegmentColorModeStateName, Segment[]> {
private segments;
constructor(device: DeviceModel, opType?: number, identifier?: number[]);
parseMultiOpCommand(opCommands: number[][]): void;
protected readonly stateToCommand: (nextState: Segment[]) => Optional<StateCommandAndStatus>;
}
export declare const WholeColorModeStateName: 'wholeColorMode';
export type WholeColorModeStateName = typeof WholeColorModeStateName;
export type ColorData = {
state?: {
mode?: number;
color?: {
red: number;
green: number;
blue: number;
};
};
};
export type WholeColor = {
red?: number;
green?: number;
blue?: number;
};
export declare class ColorModeState extends DeviceOpState<WholeColorModeStateName, WholeColor> {
constructor(device: DeviceModel, opType?: number, identifier?: number[]);
parseState(data: ColorData): void;
parseOpCommand(opCommand: number[]): void;
protected readonly stateToCommand: (state: WholeColor) => Optional<StateCommandAndStatus>;
}
export declare class RGBICActiveState extends ModeState {
constructor(device: DeviceModel, states: Optional<DeviceState<string, any>>[]);
protected readonly stateToCommand: () => undefined;
setState(nextState: Optional<DeviceState<string, unknown>>): string[];
}
export {};
//# sourceMappingURL=rgbic-light.modes.d.ts.map