[hdpowerview] Secondary shade position was inverted (#11552)

* [hdpowerview] get secondary shade position value was inverted

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* [hdpowerview] remove testing Jar from PR

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2021-11-12 00:23:25 +00:00 committed by GitHub
parent e98f7a9591
commit cb13ec6f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ public class ShadePosition {
* Uses a coordinate system that is NOT inverted in relation to OpenHAB
*/
if (posKind2.intValue() != 3) {
return new PercentType(100 - (int) Math.round(position2.doubleValue() / MAX_SHADE * 100));
return new PercentType((int) Math.round(position2.doubleValue() / MAX_SHADE * 100));
}
default:
return UnDefType.UNDEF;

View File

@ -351,7 +351,7 @@ public class HDPowerViewJUnitTests {
pos = shadePos.getState(SECONDARY_ACTUATOR, ZERO_IS_OPEN);
assertEquals(PercentType.class, pos.getClass());
assertEquals(65, ((PercentType) pos).intValue());
assertEquals(35, ((PercentType) pos).intValue());
pos = shadePos.getState(PRIMARY_ACTUATOR, VANE_COORDS);
assertEquals(UnDefType.class, pos.getClass());