Skip to content
Snippets Groups Projects
Unverified Commit f8ab98d2 authored by MatthewFlamm's avatar MatthewFlamm Committed by GitHub
Browse files

Fix falsey comparisons in NWS weather (#44486)

parent cfb02b53
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,7 @@ class NWSWeather(WeatherEntity):
temp_c = None
if self.observation:
temp_c = self.observation.get("temperature")
if temp_c:
if temp_c is not None:
return convert_temperature(temp_c, TEMP_CELSIUS, TEMP_FAHRENHEIT)
return None
......@@ -273,7 +273,7 @@ class NWSWeather(WeatherEntity):
data[ATTR_FORECAST_WIND_BEARING] = forecast_entry.get("windBearing")
wind_speed = forecast_entry.get("windSpeedAvg")
if wind_speed:
if wind_speed is not None:
if self.is_metric:
data[ATTR_FORECAST_WIND_SPEED] = round(
convert_distance(wind_speed, LENGTH_MILES, LENGTH_KILOMETERS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment