Skip to content

Commit

Permalink
Align rounding of daily wind values to the hourly ones
Browse files Browse the repository at this point in the history
  • Loading branch information
hg1337 committed Aug 6, 2023
1 parent 85345d3 commit aac93db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/dwd/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,12 @@ def values(self) -> dict[str, Any]:
)
if len(wind_gust_speed_values) > 0:
wind_gust_speed = max(wind_gust_speed_values)
result[ATTR_FORECAST_NATIVE_WIND_GUST_SPEED] = round(wind_gust_speed, 1)
result[ATTR_FORECAST_NATIVE_WIND_GUST_SPEED] = round(wind_gust_speed, 0)

wind_speed_values = self._get_hourly_values(ATTR_FORECAST_NATIVE_WIND_SPEED)
if len(wind_speed_values) > 0:
wind_speed = sum(wind_speed_values) / len(wind_speed_values)
result[ATTR_FORECAST_NATIVE_WIND_SPEED] = round(wind_speed, 1)
result[ATTR_FORECAST_NATIVE_WIND_SPEED] = round(wind_speed, 0)

cloud_coverage_sum = 0
cloud_coverage_items = 0
Expand Down

0 comments on commit aac93db

Please sign in to comment.