Skip to content

Commit

Permalink
Fix min max states (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson authored Dec 11, 2024
1 parent 6238d49 commit 9869884
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 @@ -876,13 +876,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 9869884

Please sign in to comment.