diff --git a/__init__.py b/__init__.py index b86004b5..eaae9fb4 100644 --- a/__init__.py +++ b/__init__.py @@ -283,6 +283,8 @@ def handle_hourly_temperature(self, message: Message): .optionally("Location") .optionally("Unit") .optionally("RelativeDay") + .optionally('Now') + .optionally("Today") ) def handle_high_temperature(self, message: Message): """Handle a request for the high temperature. @@ -303,6 +305,8 @@ def handle_high_temperature(self, message: Message): .optionally("Location") .optionally("Unit") .optionally("RelativeDay") + .optionally("Now") + .optionally("Today") ) def handle_low_temperature(self, message: Message): """Handle a request for the high temperature. @@ -331,11 +335,12 @@ def handle_is_it_hot(self, message: Message): @intent_handler( IntentBuilder("") - .optionally("How") + .optionally("Query") .one_of("Hot", "Cold") .require("ConfirmQuery") .optionally("Location") .optionally("RelativeDay") + .optionally("Today") ) def handle_how_hot_or_cold(self, message): """Handler for temperature requests such as: how cold will it be today? diff --git a/locale/en-us/Temperature.voc b/locale/en-us/Temperature.voc index 857fb5b2..e703b3f9 100644 --- a/locale/en-us/Temperature.voc +++ b/locale/en-us/Temperature.voc @@ -1,7 +1,2 @@ temperature temp -cold -chilly -cool -warm -hot diff --git a/source/dialog.py b/source/dialog.py index 67ced909..84fe138f 100644 --- a/source/dialog.py +++ b/source/dialog.py @@ -169,6 +169,9 @@ def build_temperature_dialog(self, temperature_type: str): self.data = dict(temperature=self.weather.low_temperature) else: self.data = dict(temperature=self.weather.temperature) + self.data.update( + temperature_unit=self.intent_data.unit or self.config.temperature_unit + ) self._add_location() def build_condition_dialog(self, intent_match: bool): @@ -226,7 +229,7 @@ def __init__( def build_weather_dialog(self): """Build the components necessary to speak the forecast for a hour.""" - self.name = ".weather" + self.name += ".weather" self.data = dict( condition=self.weather.condition.description, time=self.weather.date_time.strftime("%H:00"), @@ -240,6 +243,7 @@ def build_temperature_dialog(self, _): self.data = dict( temperature=self.weather.temperature, time=get_time_period(self.weather.date_time), + temperature_unit=self.intent_data.unit or self.config.temperature_unit ) self._add_location() @@ -300,7 +304,10 @@ def build_temperature_dialog(self, temperature_type: str): self.data = dict(temperature=self.weather.temperature.low) else: self.data = dict(temperature=self.weather.temperature.day) - self.data.update(day=get_speakable_day_of_week(self.weather.date_time)) + self.data.update( + day=get_speakable_day_of_week(self.weather.date_time), + temperature_unit = self.intent_data.unit or self.config.temperature_unit + ) self._add_location() def build_condition_dialog(self, intent_match: bool): diff --git a/test/behave/hourly-weather-local.feature b/test/behave/hourly-weather-local.feature index 7e0ac3cb..2f2ac52a 100644 --- a/test/behave/hourly-weather-local.feature +++ b/test/behave/hourly-weather-local.feature @@ -3,7 +3,7 @@ Feature: Mycroft Weather Skill local hourly forecasts Scenario Outline: what is the weather later Given an english speaking user When the user says "" - Then "mycroft-weather" should reply with dialog from "daily.weather.local.dialog" + Then "mycroft-weather" should reply with dialog from "hourly.weather.local.dialog" Examples: What is the weather later | what is the weather later | diff --git a/test/behave/hourly-weather-location.feature b/test/behave/hourly-weather-location.feature index b625c3c5..364dcbbc 100644 --- a/test/behave/hourly-weather-location.feature +++ b/test/behave/hourly-weather-location.feature @@ -3,7 +3,7 @@ Feature: Mycroft Weather Skill hourly forecasts at a specified location Scenario Outline: User asks what the weather is later at a location Given an english speaking user When the user says "" - Then "mycroft-weather" should reply with dialog from "daily.weather.location.dialog" + Then "mycroft-weather" should reply with dialog from "hourly.weather.location.dialog" Examples: What is the weather later | what is the weather later |