v0.0.4
This commit is contained in:
parent
a934520cd9
commit
aaccb27f22
1 changed files with 35 additions and 23 deletions
|
|
@ -103,7 +103,7 @@ public class WaterLevelService extends Service {
|
|||
else {
|
||||
Instant currentTimestamp = Instant.now();
|
||||
Duration duration = Duration.between(prevAlertTimestamp, currentTimestamp);
|
||||
if(duration.toMinutes() > 30) {
|
||||
if(duration.toMinutes() > 60) {
|
||||
duration_passed = true;
|
||||
}
|
||||
prevAlertTimestamp = currentTimestamp;
|
||||
|
|
@ -113,9 +113,12 @@ public class WaterLevelService extends Service {
|
|||
.setSmallIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setContentTitle("Water Level Sensor")
|
||||
.setContentText("Water Level is below alert threshold")
|
||||
.setPriority(Notification.PRIORITY_HIGH);
|
||||
.setPriority(Notification.PRIORITY_LOW);
|
||||
manager.notify(2, builder.build());
|
||||
Log.d("UDP Service", "Notification sent");
|
||||
if(!started) {
|
||||
started = true;
|
||||
}
|
||||
}
|
||||
DatagramPacket send_packet = new DatagramPacket(buffer, buffer.length, InetAddress.getByName("localhost"), 8180);
|
||||
socket_send.send(send_packet);
|
||||
|
|
|
|||
Loading…
Reference in a new issue