Skip to content

Commit

Permalink
Simplify _setTargetTemperature
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTerBeke committed Jul 2, 2024
1 parent ab4c4b6 commit 6b3921d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/uponor/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,14 @@ class UponorThermostatDevice extends Device {
}

private async _setTargetTemperature(value: number): Promise<void> {
if (!this._client) return
if (!this._client) return this.setUnavailable('No Uponor client')
const { controllerID, thermostatID } = this.getData()

try {
const { controllerID, thermostatID } = this.getData()
await this._client.setTargetTemperature(controllerID, thermostatID, value)
} catch (error) {
this.setUnavailable('Could not send data to Uponor controller')
}

await this._syncAttributes()
}
}

Expand Down

0 comments on commit 6b3921d

Please sign in to comment.