Skip to content

Commit

Permalink
Accept 1 and 0 instead of true and false for booleans to workaround w…
Browse files Browse the repository at this point in the history
  • Loading branch information
brettle committed Jul 14, 2024
1 parent af684b3 commit acaac31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/carlmontrobotics/wpiws/StateDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public static <T> void filterMessageAndIgnoreRobotState(Object receivedObject, C
((BiConsumer<Integer, Boolean>)robotStateProcessor).accept(bd.intValue(), false);
} else if (requestedType == Double.class) {
((BiConsumer<Double, Boolean>)robotStateProcessor).accept(bd.doubleValue(), false);
} else if (requestedType == Boolean.class) {
// Workaround for https://github.com/wpilibsuite/allwpilib/issues/6835
((BiConsumer<Boolean, Boolean>) robotStateProcessor)
.accept(bd.intValue() != 0, false);
} else {
isInvalidValue = true;
}
Expand Down

0 comments on commit acaac31

Please sign in to comment.