[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:
parent
e98f7a9591
commit
cb13ec6f1a
@ -236,7 +236,7 @@ public class ShadePosition {
|
|||||||
* Uses a coordinate system that is NOT inverted in relation to OpenHAB
|
* Uses a coordinate system that is NOT inverted in relation to OpenHAB
|
||||||
*/
|
*/
|
||||||
if (posKind2.intValue() != 3) {
|
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:
|
default:
|
||||||
return UnDefType.UNDEF;
|
return UnDefType.UNDEF;
|
||||||
|
|||||||
@ -351,7 +351,7 @@ public class HDPowerViewJUnitTests {
|
|||||||
|
|
||||||
pos = shadePos.getState(SECONDARY_ACTUATOR, ZERO_IS_OPEN);
|
pos = shadePos.getState(SECONDARY_ACTUATOR, ZERO_IS_OPEN);
|
||||||
assertEquals(PercentType.class, pos.getClass());
|
assertEquals(PercentType.class, pos.getClass());
|
||||||
assertEquals(65, ((PercentType) pos).intValue());
|
assertEquals(35, ((PercentType) pos).intValue());
|
||||||
|
|
||||||
pos = shadePos.getState(PRIMARY_ACTUATOR, VANE_COORDS);
|
pos = shadePos.getState(PRIMARY_ACTUATOR, VANE_COORDS);
|
||||||
assertEquals(UnDefType.class, pos.getClass());
|
assertEquals(UnDefType.class, pos.getClass());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user