This commit is contained in:
TheUnrealDragon 2026-04-04 12:24:03 +05:30
commit aaccb27f22

View file

@ -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);