mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Allow the pi to be shutdown from the app via bluetooth.
This commit is contained in:
parent
a43222049d
commit
2a5674b736
|
@ -3,7 +3,7 @@
|
|||
<groupId>com.lanternsoftware.currentmonitor</groupId>
|
||||
<artifactId>lantern-currentmonitor</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.2</version>
|
||||
<name>lantern-currentmonitor</name>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -154,6 +154,14 @@ public class MonitorApp {
|
|||
LOG.error("Exception occurred while trying to reboot", _e);
|
||||
}
|
||||
break;
|
||||
case Shutdown:
|
||||
LOG.info("Shutting down Pi...");
|
||||
try {
|
||||
Runtime.getRuntime().exec(new String[]{"shutdown","now"});
|
||||
} catch (IOException _e) {
|
||||
LOG.error("Exception occurred while trying to shutdown", _e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -17,7 +17,8 @@ public enum HubConfigCharacteristic {
|
|||
Flash(9, CharacteristicFlag.WRITE),
|
||||
Host(10, CharacteristicFlag.WRITE),
|
||||
Log(11, CharacteristicFlag.READ),
|
||||
NetworkDetails(12, CharacteristicFlag.READ);
|
||||
NetworkDetails(12, CharacteristicFlag.READ),
|
||||
Shutdown(13, CharacteristicFlag.WRITE);
|
||||
|
||||
public final int idx;
|
||||
public final UUID uuid;
|
||||
|
|
Loading…
Reference in New Issue
Block a user