mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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
|
||||
*/
|
||||
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;
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user