Skip to content

Commit

Permalink
Fix some minor issues related to stability of devices
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTerBeke committed Jun 18, 2024
1 parent 10ef252 commit 725f217
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 15 deletions.
9 changes: 1 addition & 8 deletions drivers/uponor/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ class UponorThermostatDevice extends Device {

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}`)
}
}

async onDeleted(): Promise<void> {
this._uninit()
if (!addressUpdated) throw new Error(`Could not connect to Uponor controller on IP address ${newSettings.address}`)
}

private _getAddress(): string | undefined {
Expand Down Expand Up @@ -96,7 +90,6 @@ class UponorThermostatDevice extends Device {
}

async _uninit(): Promise<void> {
this.setUnavailable()
clearInterval(this._syncInterval as NodeJS.Timeout)
this._syncInterval = undefined
this._client = undefined
Expand Down
121 changes: 114 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"test": "homey app validate"
},
"dependencies": {
"homey-log": "^2.1.0",
"node-fetch": "^2.6.1",
"source-map-support": "^0.5.21"
},
Expand Down

0 comments on commit 725f217

Please sign in to comment.