Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Update alert message to include the current pollution level
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSzewczuk committed Oct 27, 2024
1 parent 46f42e1 commit 2dadf6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ def send_notification(alert_level, avg_pm25, avg_pm10, avg_pm1):
)
else:
emoji = EMOJIS[alert_level]
alert_text = "podwyższony" if alert_level == 1 else "wysoki"
if alert_level == 1:
alert_text = "podwyższony"
elif alert_level == 2:
alert_text = "wysoki"
elif alert_level == 3:
alert_text = "bardzo wysoki"
message = (
f"{emoji} Uwaga! {alert_text.capitalize()} poziom zanieczyszczeń:\n"
f"{emoji} Uwaga! Wzrost poziomu zanieczyszczeń! Aktualnie poziom zanieczyszczenia jest {alert_text}.\n"
f"PM2.5: {avg_pm25:.2f} µg/m3\n"
f"PM10: {avg_pm10:.2f} µg/m3\n"
f"PM1: {avg_pm1:.2f} µg/m3\n"
Expand Down

0 comments on commit 2dadf6b

Please sign in to comment.