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

Commit

Permalink
Add diffrent message when alert level drops
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSzewczuk committed Oct 27, 2024
1 parent 84f4742 commit 46f42e1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ def send_notification(alert_level, avg_pm25, avg_pm10, avg_pm1):
"Więcej informacji znajdziesz tutaj: <https://czystybialystok.pl|CzystyBialystok.pl>\n"
"powered by <https://airalert.dlsk.tech/|AirAlert>"
)
elif alert_level < current_alert_level:
emoji = EMOJIS[alert_level]
message = (
f"{emoji} Poziom zagrożenia spadł: {alert_level}\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"
"Więcej informacji znajdziesz tutaj: <https://czystybialystok.pl|CzystyBialystok.pl>\n"
"powered by <https://airalert.dlsk.tech/|AirAlert>"
)
else:
emoji = EMOJIS[alert_level]
alert_text = "podwyższony" if alert_level == 1 else "wysoki"
Expand All @@ -95,7 +105,7 @@ def send_notification(alert_level, avg_pm25, avg_pm10, avg_pm1):
f"PM10: {avg_pm10:.2f} µg/m3\n"
f"PM1: {avg_pm1:.2f} µg/m3\n"
f"Poziom zagrożenia: {alert_level}\n"
f"Więcej informacji znajdziesz tutaj: <https://czystybialystok.pl|CzystyBialystok.pl>\n"
"Więcej informacji znajdziesz tutaj: <https://czystybialystok.pl|CzystyBialystok.pl>\n"
"powered by <https://airalert.dlsk.tech/|AirAlert>"
)

Expand Down

0 comments on commit 46f42e1

Please sign in to comment.