From 6b3921d78fb09c061d551c30617f0a1bca280cf9 Mon Sep 17 00:00:00 2001 From: Chris ter Beke <1134120+ChrisTerBeke@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:47:12 +0200 Subject: [PATCH] Simplify _setTargetTemperature --- drivers/uponor/device.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/uponor/device.ts b/drivers/uponor/device.ts index 8c846e6..9893570 100644 --- a/drivers/uponor/device.ts +++ b/drivers/uponor/device.ts @@ -111,16 +111,14 @@ class UponorThermostatDevice extends Device { } private async _setTargetTemperature(value: number): Promise { - 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() } }