UNPKG

node-hue-api

Version:
32 lines (31 loc) 1.44 kB
import { model } from '@peter-murray/hue-bridge-model'; import { ApiDefinition } from './http/ApiDefinition'; import { KeyValueType } from '../commonTypes'; import { Api } from './Api'; type LightStateType = model.LightState | KeyValueType; type LightId = number | string | model.Light; type LightsType = model.Light | model.Luminaire | model.Lightsource; export declare class Lights extends ApiDefinition { private _lightStateLimiter; constructor(hueApi: Api); getAll(): Promise<LightsType[]>; getLight(id: LightId): Promise<LightsType>; getLightByName(name: string): Promise<LightsType[]>; /** Discovers the "new" lights detected by the Bridge. */ getNew(): Promise<LightsType[]>; /** Starts a search for "new"/undiscovered Lights by the bridge. This can take up to 30 seconds to complete. */ searchForNew(): Promise<boolean>; getLightAttributesAndState(id: LightId): Promise<object>; getLightState(id: LightId): Promise<object>; /** * Sets the current state for the Light to desired settings. */ setLightState(id: LightId, state: LightStateType): Promise<object>; /** * Renames a Light on the Bridge to the specified name in the Light instance. */ renameLight(light: Lights): Promise<boolean>; deleteLight(id: LightId): Promise<boolean>; _setLightState(id: LightId, state: KeyValueType | LightStateType, device: LightsType): Promise<any>; } export {};