Skip to content

Commit

Permalink
Merge 2a268a3 into db88160
Browse files Browse the repository at this point in the history
  • Loading branch information
chmac committed Nov 6, 2019
2 parents db88160 + 2a268a3 commit a9766d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hue-interfaces.ts
Expand Up @@ -383,6 +383,7 @@ export namespace States {
}

export interface Lamp {
lampIndex: number;
state: States.LampState;
type: string;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/hue-node.ts
Expand Up @@ -585,7 +585,7 @@ export class Hue extends HueBridge {
public async getLamps(): Promise<Lamp[]> {
const url = this.buildLampCompositeURL();
const { data } = await this.get(url);
return Object.keys(data).map(k => data[k]);
return Object.keys(data).map(k => ({...data[k], lampIndex: parseInt(k)}));
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/hue-test-constants.ts
Expand Up @@ -47,6 +47,7 @@ export const no_brightness: any = 1;

export const lamp_response: any = {
'1': {
lampIndex: 1,
state: {
on: true,
bri: 144,
Expand Down Expand Up @@ -75,6 +76,7 @@ export const lamp_response: any = {
}
},
'2': {
lampIndex: 2,
state: {
on: false,
bri: 0,
Expand Down

0 comments on commit a9766d1

Please sign in to comment.