From ad3e7ee9f9924ecb1c30f2455c93cbafd943f833 Mon Sep 17 00:00:00 2001 From: junivex <71491452+junivex@users.noreply.github.com> Date: Fri, 18 Sep 2020 21:41:28 +0200 Subject: [PATCH] Update __init__.py "today" in __populate_report should be passed with English (lang='en'), otherwise it is defined as None. The same applies to "today" in ___populate_current, where self.__extract_datetime should be used with English as language. --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index f2c371e4..12add884 100644 --- a/__init__.py +++ b/__init__.py @@ -1262,7 +1262,7 @@ def __handle_typed(self, message, response_type): def __populate_report(self, message): unit = self.__get_requested_unit(message) # Get a date from requests like "weather for next Tuesday" - today, _ = self.__extract_datetime("today") + today, _ = self.__extract_datetime("today", lang='en') when, _ = self.__extract_datetime( message.data.get('utterance'), lang=self.lang) when = when or today # Get todays date if None was found @@ -1379,7 +1379,7 @@ def __populate_current(self, report, unit=None): wind = self.get_wind_speed(forecastWeather) report['wind'] = "{} {}".format(wind[0], wind[1] or "") - report['day'] = self.__to_day(extract_datetime('today')[0], + report['day'] = self.__to_day(self.__extract_datetime("today", lang='en')[0], preface=True) return report