Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierZal committed Apr 24, 2024
1 parent 1857bb2 commit 18b4732
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/nuos/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,14 @@ class NuosDevice extends Device {
}

async #setTargetTemperatureMinMax(
settings: Settings = this.getSettings() as Settings,
{ min, max }: Settings = this.getSettings() as Settings,
): Promise<void> {
const { min, max } = settings
const options = this.getCapabilityOptions('target_temperature')
if (min !== options.min || max !== options.max) {
await this.setCapabilityOptions('target_temperature', {
...options,
...(typeof max === 'undefined' ? {} : { max }),
...(typeof min === 'undefined' ? {} : { min }),
...(typeof max === 'undefined' ? {} : { max }),
})
await this.setWarning(this.homey.__('warnings.settings'))
}
Expand Down

0 comments on commit 18b4732

Please sign in to comment.