Fix iterating over NoneType exception (#23648)
* Fix iterating over NoneType exception When self._dark_sky is None, don't try to return self._dark_sky.units * Fix wrong checkpull/24022/head
parent
fbd7c72283
commit
eae306c3f1
|
@ -103,6 +103,8 @@ class DarkSkyWeather(WeatherEntity):
|
|||
@property
|
||||
def temperature_unit(self):
|
||||
"""Return the unit of measurement."""
|
||||
if self._dark_sky.units is None:
|
||||
return None
|
||||
return TEMP_FAHRENHEIT if 'us' in self._dark_sky.units \
|
||||
else TEMP_CELSIUS
|
||||
|
||||
|
|
Loading…
Reference in New Issue