Temporarily fix yahoo weather API issue and add unit test. (#10737)

* Temporarily fix yahoo weather API issue and add unit test.

* Add test data.
This commit is contained in:
cgtobi authored and Paulus Schoutsen committed 2017-11-23 12:45:56 -08:00
1 parent f2dea4615f
commit 47183ce02e
4 files changed
+390 -4

No files matched your search

+5 -3
View File
@@ -160,13 +160,15 @@ class YahooWeatherSensor(Entity):
self._code = self._data.yahoo.Forecast[self._forecast]['code']
self._state = self._data.yahoo.Forecast[self._forecast]['high']
elif self._type == 'wind_speed':
self._state = self._data.yahoo.Wind['speed']
self._state = round(float(self._data.yahoo.Wind['speed'])/1.61, 2)
elif self._type == 'humidity':
self._state = self._data.yahoo.Atmosphere['humidity']
elif self._type == 'pressure':
self._state = self._data.yahoo.Atmosphere['pressure']
self._state = round(
float(self._data.yahoo.Atmosphere['pressure'])/33.8637526, 2)
elif self._type == 'visibility':
self._state = self._data.yahoo.Atmosphere['visibility']
self._state = round(
float(self._data.yahoo.Atmosphere['visibility'])/1.61, 2)
class YahooWeatherData(object):