fritz-smh / domogik-plugin-weather

Other
2 stars 3 forks source link

Data parsing #9

Closed overload08 closed 7 years ago

overload08 commented 7 years ago

2017-01-24 12:37:36,217 domogik-weather DEBUG Raw data for 583959 : {u'query': {u'count': 1, u'lang': u'en-US', u'results': {u'channel': {u'lastBuildDate': u'Tue, 24 Jan 2017 12:37 PM CET', u'atmosphere': {u'pressure': u'1015.0', u'rising': u'0', u'visibility': u'14.1', u'humidity': u'93'}, u'description': u'Yahoo! Weather for Chalons-En-Champagne, Champagne-Ardenne, FR', u'language': u'en-us', u'title': u'Yahoo! Weather - Chalons-En-Champagne, Champagne-Ardenne, FR', u'image': {u'url': u'http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif', u'width': u'142', u'height': u'18', u'link': u'http://weather.yahoo.com', u'title': u'Yahoo! Weather'}, u'item': {u'description': u'<![CDATA[\n
\nCurrent Conditions:\n
Snow Showers\n
\n
\nForecast:\n
Tue - Mostly Cloudy. High: 33Low: 24\n
Wed - Partly Cloudy. High: 32Low: 23\n
Thu - Sunny. High: 37Low: 19\n
Fri - Partly Cloudy. High: 46Low: 23\n
Sat - Partly Cloudy. High: 44Low: 33\n
\n
\nFull Forecast at Yahoo! Weather\n
\n
\n(provided by The Weather Channel)\n
\n]]>', u'pubDate': u'Tue, 24 Jan 2017 12:00 PM CET', u'title': u'Conditions for Chalons-En-Champagne, Champagne-Ardenne, FR at 12:00 PM CET', u'long': u'4.36569', u'forecast': [{u'code': u'28', u'text': u'Mostly Cloudy', u'high': u'33', u'low': u'24', u'date': u'24 Jan 2017', u'day': u'Tue'}, {u'code': u'30', u'text': u'Partly Cloudy', u'high': u'32', u'low': u'23', u'date': u'25 Jan 2017', u'day': u'Wed'}, {u'code': u'32', u'text': u'Sunny', u'high': u'37', u'low': u'19', u'date': u'26 Jan 2017', u'day': u'Thu'}, {u'code': u'30', u'text': u'Partly Cloudy', u'high': u'46', u'low': u'23', u'date': u'27 Jan 2017', u'day': u'Fri'}, {u'code': u'30', u'text': u'Partly Cloudy', u'high': u'44', u'low': u'33', u'date': u'28 Jan 2017', u'day': u'Sat'}, {u'code': u'30', u'text': u'Partly Cloudy', u'high': u'40', u'low': u'31', u'date': u'29 Jan 2017', u'day': u'Sun'}, {u'code': u'28', u'text': u'Mostly Cloudy', u'high': u'46', u'low': u'31', u'date': u'30 Jan 2017', u'day': u'Mon'}, {u'code': u'28', u'text': u'Mostly Cloudy', u'high': u'47', u'low': u'38', u'date': u'31 Jan 2017', u'day': u'Tue'}, {u'code': u'28', u'text': u'Mostly Cloudy', u'high': u'48', u'low': u'37', u'date': u'01 Feb 2017', u'day': u'Wed'}, {u'code': u'28', u'text': u'Mostly Cloudy', u'high': u'49', u'low': u'38', u'date': u'02 Feb 2017', u'day': u'Thu'}], u'link': u'http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-583959/', u'lat': u'48.95612', u'guid': {u'isPermaLink': u'false'}, u'condition': {u'date': u'Tue, 24 Jan 2017 12:00 PM CET', u'text': u'Snow Showers', u'code': u'14', u'temp': u'29'}}, u'link': u'http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-583959/', u'location': {u'city': u'Chalons-En-Champagne', u'region': u' Champagne-Ardenne', u'country': u'France'}, u'ttl': u'60', u'units': {u'distance': u'mi', u'speed': u'mph', u'temperature': u'F', u'pressure': u'in'}, u'astronomy': {u'sunset': u'5:28 pm', u'sunrise': u'8:22 am'}, u'wind': {u'direction': u'15', u'speed': u'7', u'chill': u'25'}}}, u'created': u'2017-01-24T11:37:49Z'}} 2017-01-24 12:37:36,217 domogik-weather DEBUG Values for 583959 on pressure : 1015.0 2017-01-24 12:37:36,218 domogik-weather DEBUG normal send 2017-01-24 12:37:36,218 domogik-weather DEBUG Values for 583959 on temp_feels_like : -4 2017-01-24 12:37:36,218 domogik-weather DEBUG normal send 2017-01-24 12:37:36,220 domogik-weather DEBUG Values for 583959 on humidity : 93 2017-01-24 12:37:36,220 domogik-weather DEBUG normal send 2017-01-24 12:37:36,222 domogik-weather DEBUG Values for 583959 on last_updated : Tue, 24 Jan 2017 12:37 PM CET 2017-01-24 12:37:36,222 domogik-weather DEBUG normal send 2017-01-24 12:37:36,222 domogik-weather DEBUG Values for 583959 on current_station : Chalons-En-Champagne (France) 2017-01-24 12:37:36,222 domogik-weather DEBUG normal send 2017-01-24 12:37:36,223 domogik-weather DEBUG Values for 583959 on temp : -2 2017-01-24 12:37:36,223 domogik-weather DEBUG normal send 2017-01-24 12:37:36,223 domogik-weather DEBUG Values for 583959 on text : Snow Showers 2017-01-24 12:37:36,224 domogik-weather DEBUG normal send 2017-01-24 12:37:36,226 domogik-weather DEBUG Values for 583959 on code : 14 2017-01-24 12:37:36,226 domogik-weather DEBUG normal send 2017-01-24 12:37:36,227 domogik-weather DEBUG Values for 583959 on visibility : 14.1 2017-01-24 12:37:36,228 domogik-weather DEBUG normal send 2017-01-24 12:37:36,229 domogik-weather DEBUG Values for 583959 on direction : 15 2017-01-24 12:37:36,229 domogik-weather DEBUG normal send 2017-01-24 12:37:36,231 domogik-weather DEBUG Values for 583959 on speed : 7.0 2017-01-24 12:37:36,231 domogik-weather DEBUG normal send 2017-01-24 12:37:36,234 domogik-weather ERROR Error while getting data from Yahoo weather : Traceback (most recent call last): File "/var/lib/domogik/domogik_packages/plugin_weather/lib/weather.py", line 194, in get_weather sunset_time = time.strftime("%H:%M:%S", time.strptime(sunset, "%I:%M %p")) File "/usr/lib/python2.7/_strptime.py", line 467, in _strptime_time return _strptime(data_string, format)[0] File "/usr/lib/python2.7/_strptime.py", line 328, in _strptime data_string[found.end():]) ValueError: unconverted data remains: pm

2017-01-24 12:37:36,235 domogik-weather INFO Wait for 15 minutes

overload08 commented 7 years ago

Bug on sunset and sunrise only

fritz-smh commented 7 years ago

Fixed in 1.8