This commit is contained in:
Andros Fenollosa 2021-08-29 12:13:40 +02:00
parent 430cc253a2
commit 784dd60736
2 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,11 @@ LIMIT_BELOW_BATTERY = 15
MESSAGE_LIMIT_BELOW_BATTERY = "Connect your charger" MESSAGE_LIMIT_BELOW_BATTERY = "Connect your charger"
FILE_NAME_TEMP = "alert_battery_to_maintain_health" FILE_NAME_TEMP = "alert_battery_to_maintain_health"
PATH_FILE_NAME_TEMP = os.path.join(gettempdir(), FILE_NAME_TEMP) PATH_FILE_NAME_TEMP = os.path.join(gettempdir(), FILE_NAME_TEMP)
NOTIFICATION = Notify(
default_notification_title="Alert battery",
default_application_name="Alert battery",
default_notification_icon=os.path.abspath("alert_battery_to_maintain_health/icons/battery-status.png"),
)
def get_sensor_battery(): def get_sensor_battery():
@ -22,10 +27,9 @@ def get_sensor_battery():
def send_notification(message, title="Battery"): def send_notification(message, title="Battery"):
"""Send native notification""" """Send native notification"""
notification = Notify() NOTIFICATION.title = title
notification.title = title NOTIFICATION.message = message
notification.message = message NOTIFICATION.send()
notification.send()
def create_file_block(): def create_file_block():

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB