Template cover has supported_features = 11, but it supports setting position.
This commit is contained in:
Yegor Vialov 2018-11-06 14:10:34 +02:00 committed by GitHub
parent 69fd37d4fe
commit efd06ca547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ class CoverEntity extends Entity {
double get currentPosition => _getDoubleAttributeValue('current_position');
double get currentTiltPosition => _getDoubleAttributeValue('current_tilt_position');
bool get canBeOpened => ((state != "opening") && (state != "open")) || (state == "open" && supportSetPosition && currentPosition > 0.0 && currentPosition < 100.0);
bool get canBeOpened => ((state != "opening") && (state != "open")) || (state == "open" && currentPosition != null && currentPosition > 0.0 && currentPosition < 100.0);
bool get canBeClosed => ((state != "closing") && (state != "closed"));
bool get canTiltBeOpened => currentTiltPosition < 100;
bool get canTiltBeClosed => currentTiltPosition > 0;
@ -57,4 +57,4 @@ class CoverEntity extends Entity {
return CoverControlWidget();
}
}
}