diff --git a/weather_to_freemobile.py b/weather_to_freemobile.py index 8312c7b..35b8816 100755 --- a/weather_to_freemobile.py +++ b/weather_to_freemobile.py @@ -65,8 +65,10 @@ class WeatherToFreemobile(): #17649060-between-hours-of-12-midnight-and-7am-gmt-we-are-receiving #-the-wrong-data-for-most-locations if( abs(weather_date.date()-datetime.date.today()) - < datetime.timedelta(days=number_of_days) + >= datetime.timedelta(days=number_of_days) ): + logging.info('Skipped {} (cf. API Bug)'.format(weather_date)) + else: temp = weather.get_temperature(unit='celsius') return_message.append( '{} : {} (min {}ºC, max {}ºC, rain:{}mm)'.format( @@ -77,8 +79,6 @@ class WeatherToFreemobile(): weather.get_rain().get('all',0) ) ) - else: - logging.info('Skipped {} (cf. API Bug)'.format(weather_date)) logging.info("Got the following weather: {}".format(return_message)) return "\n".join(return_message)