Skip to content

Commit

Permalink
Finalize async/await changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnso5 committed Mar 18, 2019
1 parent aa34167 commit 4ee3cb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/hue-node.spec.ts
Expand Up @@ -104,7 +104,7 @@ test.serial('init with retrieval', async t => {
t.pass();
});

test.serial.beforeEach(async t => {
test.serial.beforeEach(async _ => {
hue = new Hue({
ip: ip,
key: key,
Expand Down
12 changes: 6 additions & 6 deletions src/hue-node.ts
Expand Up @@ -98,7 +98,7 @@ export class Hue extends HueBridge {
* @return {Promise<AxiosResponse>} Promise representing the remote call to the Hue bridge
*/
private async putJSON(url: string, data: any): Promise<AxiosResponse> {
return this._http.put(url, data);
return await this._http.put(url, data);
}

/**
Expand All @@ -109,7 +109,7 @@ export class Hue extends HueBridge {
* @return {Promise<AxiosResponse>} Promise representing the remote call to the Hue bridge
*/
private async get(destination: string): Promise<AxiosResponse> {
return this._http.get(destination);
return await this._http.get(destination);
}

/**
Expand All @@ -120,7 +120,7 @@ export class Hue extends HueBridge {
*/
private async getState(lampIndex: number): Promise<AxiosResponse<Lamp>> {
const url = this.buildLampQueryURL(lampIndex);
return this.get(url);
return await this.get(url);
}

/**
Expand Down Expand Up @@ -174,7 +174,7 @@ export class Hue extends HueBridge {
* @return {AxiosPromise} Promise representing the remote call to the Hue bridge
*/
private async put(lampIndex: number, data: any): Promise<AxiosResponse> {
return this.putJSON(this.buildStateURL(lampIndex), data);
return await this.putJSON(this.buildStateURL(lampIndex), data);
}

/**
Expand All @@ -188,7 +188,7 @@ export class Hue extends HueBridge {
groupIndex: number,
action: any
): Promise<AxiosResponse> {
return this.putJSON(this.buildGroupActionURL(groupIndex), action);
return await this.putJSON(this.buildGroupActionURL(groupIndex), action);
}

/**
Expand Down Expand Up @@ -240,7 +240,7 @@ export class Hue extends HueBridge {
private buildBrightenState(
increment?: number
): States.BrightnessIncrementState {
let incrementState = this.buildDimState(increment);
const incrementState = this.buildDimState(increment);
incrementState.bri_inc = Math.abs(incrementState.bri_inc);
return incrementState;
}
Expand Down

0 comments on commit 4ee3cb7

Please sign in to comment.