Skip to content

Commit

Permalink
Await addCapability before setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTerBeke committed Jul 1, 2024
1 parent b9d70ad commit 5433e87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/remeha/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class RemehaThermostatDevice extends Device {
} catch (error) { }
}

private _setOptionalCapability(capability: string, value: number | boolean | string | undefined | null): void {
private async _setOptionalCapability(capability: string, value: number | boolean | string | undefined | null): Promise<void> {
if (value) {
this.addCapability(capability)
await this.addCapability(capability)
this.setCapabilityValue(capability, value)
} else {
this.removeCapability(capability)
Expand Down

0 comments on commit 5433e87

Please sign in to comment.