diff --git a/lib/view/line.py b/lib/view/line.py index e701bdf..571d756 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -145,7 +145,7 @@ def render_wind(data, query): degree = "" if degree: - wind_direction = WIND_DIRECTION[((degree+22)%360)//45] + wind_direction = WIND_DIRECTION[int(((degree+22.5)%360)/45.0)] else: wind_direction = "" diff --git a/lib/view/v2.py b/lib/view/v2.py index b3baefb..c9d8ed6 100644 --- a/lib/view/v2.py +++ b/lib/view/v2.py @@ -350,7 +350,7 @@ def draw_wind(data, color_data): degree = int(degree) if degree: - wind_direction = constants.WIND_DIRECTION[((degree+22)%360)//45] + wind_direction = constants.WIND_DIRECTION[int(((degree+22.5)%360)/45.0)] else: wind_direction = ""