-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: .gitignore, new file: Assets/International_Morse_Code.png ,…
… new file: BatteryNotifier.py, modified: DownloadYTVideo.py, modified: DrinkWaterNotifier.py, new file: MorseCodeGenerator&Decoder.py, new file: requirements.txt
- Loading branch information
1 parent
764f425
commit 81c4d8c
Showing
7 changed files
with
373 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
.env | ||
.env | ||
venv/ | ||
.vscode/ | ||
*.webm | ||
*.mp4 | ||
*.ogg | ||
*.mp3 | ||
*.wav | ||
*.flac | ||
*.aac | ||
*.m4a | ||
*.mkv |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import time | ||
import psutil | ||
from plyer import notification | ||
|
||
def check_battery(): | ||
battery = psutil.sensors_battery() | ||
battery_percent = battery.percent | ||
battery_plugged = battery.power_plugged | ||
|
||
if battery_plugged and battery_percent == 100: | ||
notification.notify( | ||
title="Battery Full", | ||
message="Battery is fully charged.", | ||
timeout=10 | ||
) | ||
elif not battery_plugged and battery_percent <= 30: | ||
notification.notify( | ||
title="Battery Low", | ||
message=f"Battery is {battery_percent}%. Please plug in the charger.", | ||
timeout=10 | ||
) | ||
elif not battery_plugged and battery_percent % 10 == 0: | ||
notification.notify( | ||
title="Battery Status", | ||
message=f"Battery is {battery_percent}%", | ||
timeout=8 | ||
) | ||
|
||
if __name__ == "__main__": | ||
while True: | ||
check_battery() | ||
time.sleep(60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.