Skip to content
Snippets Groups Projects
Commit ea26137d authored by jkerdreu's avatar jkerdreu
Browse files

Fix missing keys

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@1995 b32b6428-25c9-4566-ad07-03861ab6144f
parent eaf3565b
No related branches found
No related tags found
No related merge requests found
......@@ -56,12 +56,11 @@ class GW:
def _update(self):
place = self.cfg['config']['place']
weather = self.owm.weather_at_place(place).get_weather()
self.devs[0].attributes['temperature'] = round(weather.get_temperature(unit='celsius')['temp'],1)
self.devs[0].attributes['temperature'] = round(weather.get_temperature(unit='celsius').get('temp',None),1)
self.devs[1].attributes['humidity'] = weather.get_humidity()
self.devs[2].attributes['pressure'] = weather.get_pressure()['press']
self.devs[3].attributes['windStrength'] = weather.get_wind()['speed']
self.devs[3].attributes['windAngle'] = weather.get_wind()['deg']
self.devs[2].attributes['pressure'] = weather.get_pressure().get('press',None)
self.devs[3].attributes['windStrength'] = weather.get_wind().get('speed',None)
self.devs[3].attributes['windAngle'] = weather.get_wind().get('deg',None)
def init(engine):
gw = GW(engine)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment