Skip to content

Commit

Permalink
Bump to Pi4J 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FDelporte committed Jul 29, 2024
1 parent f47bdd0 commit b852320
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ public Pi4JController(@Autowired Pi4JService pi4JService) {

@GetMapping("/led/{state}")
public Boolean setLedStatus(@PathVariable Boolean state) {
logger.info("REST request to change the LED state to {}", state);
return pi4JService.setLedState(state);
}

@GetMapping("/button")
public DigitalState setLedStatus() {
logger.info("REST request to get the BUTTON state");
return pi4JService.getButtonState();
}

@GetMapping("/lcd/{line}/{text}")
public Boolean setLcdText(@PathVariable Integer line, @PathVariable String text) {
logger.info("REST request to set on line {} of the LCD: '{}'", line, text);
return pi4JService.setLcdText(line, text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class ContextConfiguration {
public ContextConfiguration() {
try {
if (BoardInfoHelper.current().getBoardModel() == BoardModel.UNKNOWN) {
logger.warn("The Pi4J library could not detect that this system is a Raspberry Pi board.");
logger.warn("For this reason, Mock implementations will be loaded for all I/O.");
logger.warn("This means, you can test most functionality of the Pi4J library, but it will not try to interact with I/Os.");
this.pi4j = Pi4J.newContextBuilder()
.add(new MockPlatform())
.add(MockAnalogInputProvider.newInstance(),
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<properties>
<java.version>17</java.version>
<spring-boot.version>3.2.5</spring-boot.version>
<pi4j.version>2.6.0</pi4j.version>
<pi4j.version>2.6.1</pi4j.version>

<!-- Plugins -->
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
Expand Down

0 comments on commit b852320

Please sign in to comment.