Skip to content

Commit

Permalink
Log debug-level statements when the temperature is too low to calcula…
Browse files Browse the repository at this point in the history
…te simmer index and simmer zone (#223)

* Log debug message for simmer index below 70°F

* Other

* Better logs
  • Loading branch information
bachya committed Jul 21, 2022
1 parent 03e4df1 commit 8cda189
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ecowitt2mqtt/helpers/calculator/meteo.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,10 @@ def calculate_simmer_index(
else:
final_value = round(simmer_obj.c, 1)
else:
LOGGER.debug(
"Simmer index is undefined for temperatures below 70°F (temperature: %s°F",
temp_obj.f,
)
final_value = None

return CalculatedDataPoint(
Expand All @@ -620,6 +624,10 @@ def calculate_simmer_zone(
]
final_value = rating.zone
else:
LOGGER.debug(
"Simmer index is undefined for temperatures below 70°F (temperature: %s°F",
temp_obj.f,
)
final_value = None

return CalculatedDataPoint(data_point_key=data_point_key, value=final_value)
Expand Down

0 comments on commit 8cda189

Please sign in to comment.