Skip to content

Commit

Permalink
Merge pull request #201 from Pirate-Weather/wind-gust-fix
Browse files Browse the repository at this point in the history
Fix Wind Gust Speed Units
  • Loading branch information
cloneofghosts authored Mar 16, 2024
2 parents 4e7acc8 + 2e906df commit 0fd3cbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/pirateweather/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/alexander0042/pirate-weather-ha/issues",
"requirements": ["python-forecastio==1.4.0"],
"version": "1.4.5"
"version": "1.4.5.1"
}
7 changes: 4 additions & 3 deletions custom_components/pirateweather/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"hail": ATTR_CONDITION_HAIL,
"thunderstorm": ATTR_CONDITION_LIGHTNING,
"tornado": ATTR_CONDITION_EXCEPTIONAL,
"none": ATTR_CONDITION_EXCEPTIONAL,
}

CONF_UNITS = "units"
Expand Down Expand Up @@ -140,7 +141,7 @@ def _map_daily_forecast(forecast) -> Forecast:
"humidity": round(forecast.d.get("humidity") * 100, 2),
"cloud_coverage": round(forecast.d.get("cloudCover") * 100, 0),
"native_wind_speed": round(forecast.d.get("windSpeed"), 2),
"wind_gust_speed": round(forecast.d.get("windGust"), 2),
"native_wind_gust_speed": round(forecast.d.get("windGust"), 2),
"wind_bearing": round(forecast.d.get("windBearing"), 0),
}

Expand All @@ -155,7 +156,7 @@ def _map_hourly_forecast(forecast) -> Forecast:
"native_pressure": forecast.d.get("pressure"),
"native_wind_speed": round(forecast.d.get("windSpeed"), 2),
"wind_bearing": round(forecast.d.get("windBearing"), 0),
"wind_gust_speed": round(forecast.d.get("windGust"), 2),
"native_wind_gust_speed": round(forecast.d.get("windGust"), 2),
"humidity": round(forecast.d.get("humidity") * 100, 2),
"native_precipitation": round(forecast.d.get("precipIntensity"), 2),
"precipitation_probability": round(
Expand Down Expand Up @@ -290,7 +291,7 @@ def native_wind_speed(self):
return round(windspeed, 2)

@property
def wind_gust_speed(self):
def native_wind_gust_speed(self):
"""Return the wind gust speed."""
windGust = self._weather_coordinator.data.currently().d.get("windGust")

Expand Down

0 comments on commit 0fd3cbf

Please sign in to comment.