Resolves #164 Allow to open cover if it is not fully opened

This commit is contained in:
Yegor Vialov
2018-11-04 21:55:37 +02:00
parent a7830df628
commit 1f0bd8059b

View File

@ -42,7 +42,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"));
bool get canBeOpened => ((state != "opening") && (state != "open")) || (state == "open" && supportSetPosition && currentPosition > 0.0 && currentPosition < 100.0);
bool get canBeClosed => ((state != "closing") && (state != "closed"));
bool get canTiltBeOpened => currentTiltPosition < 100;
bool get canTiltBeClosed => currentTiltPosition > 0;