Skip to content

Commit 19e5de3

Browse files
committed
Fix min max states
1 parent a25c02f commit 19e5de3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/device/curtain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,13 @@ export class Curtain extends deviceBase {
878878

879879
async setMinMax(): Promise<void> {
880880
if ((this.device as curtainConfig).set_min) {
881-
if (Number(this.WindowCovering.CurrentPosition) <= (this.device as curtainConfig).set_min!) {
882-
this.WindowCovering.CurrentPosition = 0
881+
if (Number(this.WindowCovering.CurrentPosition) >= (this.device as curtainConfig).set_min!) {
882+
this.WindowCovering.CurrentPosition = 100
883883
}
884884
}
885885
if ((this.device as curtainConfig).set_max) {
886-
if (Number(this.WindowCovering.CurrentPosition) >= (this.device as curtainConfig).set_max!) {
887-
this.WindowCovering.CurrentPosition = 100
886+
if (Number(this.WindowCovering.CurrentPosition) <= (this.device as curtainConfig).set_max!) {
887+
this.WindowCovering.CurrentPosition = 0
888888
}
889889
}
890890
if (this.device.history) {

0 commit comments

Comments
 (0)