Skip to content

Commit

Permalink
Do not re-init on every interval
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTerBeke committed Jul 2, 2024
1 parent 7e9a356 commit 9a9c5ce
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/uponor/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class UponorThermostatDevice extends Device {
this._updateAddress(discoveryResult.address, true)
}

async onDiscoveryLastSeenChanged(discoveryResult: DiscoveryResultMAC): Promise<void> {
this._updateAddress(discoveryResult.address, true)
}

async onSettings({ newSettings }: { newSettings: { [key: string]: any } }): Promise<void> {
const addressUpdated = await this._updateAddress(newSettings.address as string)
if (!addressUpdated) throw new Error(`Could not connect to Uponor controller on IP address ${newSettings.address}`)
Expand Down Expand Up @@ -77,7 +73,7 @@ class UponorThermostatDevice extends Device {
this._syncInterval = setInterval(this._syncAttributes.bind(this), POLL_INTERVAL_MS)
this._syncAttributes()
} catch (error) {
this.setUnavailable(`Could not connect to Uponor controller on IP address ${address}`)
this.setUnavailable(`Error connecting to Uponor controller: ${error}`)
}
}

Expand Down

0 comments on commit 9a9c5ce

Please sign in to comment.