UNPKG

@felixgeelhaar/govee-api-client

Version:

Enterprise-grade TypeScript client library for the Govee Developer REST API

52 lines 1.72 kB
import { ColorRgb, ColorTemperature, Brightness } from '../value-objects'; export interface PowerState { value: 'on' | 'off'; } export interface ColorState { value: ColorRgb; } export interface ColorTemperatureState { value: ColorTemperature; } export interface BrightnessState { value: Brightness; } export type StateProperty = PowerState | ColorState | ColorTemperatureState | BrightnessState; export declare class DeviceState { private readonly _deviceId; private readonly _model; private readonly _online; private readonly _properties; constructor(deviceId: string, model: string, online: boolean, properties?: Record<string, StateProperty>); private validateDeviceId; private validateModel; get deviceId(): string; get model(): string; get online(): boolean; get properties(): ReadonlyMap<string, StateProperty>; getProperty<T extends StateProperty>(key: string): T | undefined; hasProperty(key: string): boolean; getPowerState(): 'on' | 'off' | undefined; getBrightness(): Brightness | undefined; getColor(): ColorRgb | undefined; getColorTemperature(): ColorTemperature | undefined; isPoweredOn(): boolean; isPoweredOff(): boolean; isOnline(): boolean; isOffline(): boolean; equals(other: DeviceState): boolean; toString(): string; toObject(): { deviceId: string; model: string; online: boolean; properties: Record<string, StateProperty>; }; static fromObject(obj: { deviceId: string; model: string; online: boolean; properties: Record<string, StateProperty>; }): DeviceState; } //# sourceMappingURL=DeviceState.d.ts.map