Skip to content

Commit

Permalink
Fix min max states
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson committed Dec 8, 2024
1 parent a25c02f commit 19e5de3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/device/curtain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,13 +878,13 @@ export class Curtain extends deviceBase {

async setMinMax(): Promise<void> {
if ((this.device as curtainConfig).set_min) {
if (Number(this.WindowCovering.CurrentPosition) <= (this.device as curtainConfig).set_min!) {
this.WindowCovering.CurrentPosition = 0
if (Number(this.WindowCovering.CurrentPosition) >= (this.device as curtainConfig).set_min!) {
this.WindowCovering.CurrentPosition = 100
}
}
if ((this.device as curtainConfig).set_max) {
if (Number(this.WindowCovering.CurrentPosition) >= (this.device as curtainConfig).set_max!) {
this.WindowCovering.CurrentPosition = 100
if (Number(this.WindowCovering.CurrentPosition) <= (this.device as curtainConfig).set_max!) {
this.WindowCovering.CurrentPosition = 0
}
}
if (this.device.history) {
Expand Down

0 comments on commit 19e5de3

Please sign in to comment.