From 2e906dfe985c0df1eca903fe75d684d3722f36f0 Mon Sep 17 00:00:00 2001 From: Kev Date: Fri, 15 Mar 2024 21:16:35 -0400 Subject: [PATCH] Fix Wind Gust Speed Units --- custom_components/pirateweather/manifest.json | 2 +- custom_components/pirateweather/weather.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/pirateweather/manifest.json b/custom_components/pirateweather/manifest.json index ecf328a..52fb2dd 100644 --- a/custom_components/pirateweather/manifest.json +++ b/custom_components/pirateweather/manifest.json @@ -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" } diff --git a/custom_components/pirateweather/weather.py b/custom_components/pirateweather/weather.py index cae3ce8..b3961b3 100644 --- a/custom_components/pirateweather/weather.py +++ b/custom_components/pirateweather/weather.py @@ -94,6 +94,7 @@ "hail": ATTR_CONDITION_HAIL, "thunderstorm": ATTR_CONDITION_LIGHTNING, "tornado": ATTR_CONDITION_EXCEPTIONAL, + "none": ATTR_CONDITION_EXCEPTIONAL, } CONF_UNITS = "units" @@ -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), } @@ -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( @@ -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")