Skip to content

Commit

Permalink
Fixes GH-192
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Oct 21, 2023
1 parent c8f6317 commit 9fe0d10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/user/weewx_wdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2045,12 +2045,14 @@ def get_windrose_data(self, start_ts, end_ts, context):

# Calculate percentages.
num_of_values = len(list(windSpeed_vt[0]))
for index, data in enumerate(windrose_data):
for p_index, percent in enumerate(data["r"]):
windrose_data[index]["r"][p_index] = round(
# todo: division by zero
(percent / num_of_values) * 100
)

if num_of_values > 0:
for index, data in enumerate(windrose_data):
for p_index, percent in enumerate(data["r"]):
windrose_data[index]["r"][p_index] = round(
# todo: division by zero
(percent / num_of_values) * 100
)

return windrose_data

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ See https://github.com/Daveiano/weewx-wdc/compare/v3.2.0...11eed6b3#diff-ba225fb
- Bugfix: Removed accidentally added Climatogram on year and stats page
- Bugfix: Fixed encoding issue when using special chars in oridinate labels
- Bugfix: Wind and Gust speed have a space between unit and comma (and added missing apostrophe to Yesterday's and Today's) GH-200
- Bugfix: Division by zero in get_windrose_data GH-192
- Added `show_min_max` configuration to gauges config, added ordinal display for windDir gauge min/max
- Only show 3 decimals for the geocode provided by weewx-forecast GH-191
- Make sidebar scrollable (if there are too many items) GH-193

0 comments on commit 9fe0d10

Please sign in to comment.