Skip to content

Commit

Permalink
Invert wind and humidity alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 29, 2024
1 parent 52cf1ae commit 9b113d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lvmapi/routers/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,21 @@ async def summary(request: Request) -> AlertsSummary:
dew_point_alert = None

if not isinstance(weather_data, BaseException) and weather_data.height > 0:
last_weather = weather_data[-1]

wind_alert = is_measurament_safe(
wind_alert = not is_measurament_safe(
weather_data,
"wind_speed_avg",
threshold=35,
reopen_value=30,
)

humidity_alert = is_measurament_safe(
humidity_alert = not is_measurament_safe(
weather_data,
"relative_humidity",
threshold=80,
reopen_value=70,
)

last_weather = weather_data[-1]
dew_point_alert = last_weather["dew_point"][0] > last_weather["temperature"][0]

o2_alerts = {
Expand Down

0 comments on commit 9b113d9

Please sign in to comment.