Skip to content

Commit 5873386

Browse files
authored
Update Battery-Notification.py
1 parent 0d86656 commit 5873386

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Battery-Notification/Battery-Notification.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,4 @@
2020
timeout = 5
2121
)
2222
percent = cur_per
23-
battery = psutil.sensors_battery()
24-
percent = battery.percent
25-
time.sleep(60*2)
26-
battery = psutil.sensors_battery()
27-
cur_per = battery.percent
28-
change = cur_per - percent
29-
diff = abs(change)
30-
#We calculate the change in the battery and show notification if battery level increases or decreases
31-
if(diff >= threshold):
32-
notification.notify(
33-
title = "Battery Percentage",
34-
message = str(percent) + "% Battery Remaining",
35-
timeout = 5
36-
)
3723
continue

0 commit comments

Comments
 (0)