Skip to content

Commit

Permalink
Accept an XYPoint in setAllColors.
Browse files Browse the repository at this point in the history
  • Loading branch information
chmac committed Nov 6, 2019
1 parent 11d0573 commit 5bfbe1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hue-node.ts
Expand Up @@ -355,13 +355,14 @@ export class Hue extends HueBridge {
* Sets all connected lamps to the approximate CIE x,y equivalent of
* the provided hex color.
*
* @param {string} color String representing a hexadecimal color value.
* @param {string | XYPoint} color String representing a hexadecimal color value (or an XYPoint)
* @return {Promise<HueBridgeGroupActionResponse>} Promise representing the remote call
*/
public async setAllColors(
color: string
color: string | XYPoint
): Promise<HueBridgeGroupActionResponse> {
const cieColor: XYPoint = this.colors.getCIEColor(color);
const cieColor: XYPoint =
color instanceof XYPoint ? color : this.colors.getCIEColor(color);
const xyState: States.ColorState = this.buildXYState(cieColor);

const { data } = await this.putGroupAction(0, xyState);
Expand Down

0 comments on commit 5bfbe1c

Please sign in to comment.