diff --git a/sentences/en/weather_HassGetWeather.yaml b/sentences/en/weather_HassGetWeather.yaml index c93666e94b..52da7750cd 100644 --- a/sentences/en/weather_HassGetWeather.yaml +++ b/sentences/en/weather_HassGetWeather.yaml @@ -3,8 +3,10 @@ intents: HassGetWeather: data: - sentences: - - "[ the] weather[ like][( for| in| at) ]" - - "[ the] weather[( for| in| at) ] like" + - "[ the] weather[ like]" + - sentences: + - "[ the] weather[ like] (for|in|at) " + - "[ the] weather (for|in|at) [ like]" - "[ the] weather[ like]" requires_context: domain: weather diff --git a/shared/__init__.py b/shared/__init__.py index 65f7622a9b..1f1cd15c3a 100644 --- a/shared/__init__.py +++ b/shared/__init__.py @@ -61,6 +61,9 @@ def get_matched_states( if result.intent.name in ("HassClimateGetTemperature", "HassClimateSetTemperature"): # Match climate entities only states = [state for state in states if state.domain == "climate"] + elif result.intent.name in ("HassGetWeather",): + # Match weather entities only + states = [state for state in states if state.domain == "weather"] # Implement some matching logic from Home Assistant entity_name: Optional[str] = None diff --git a/tests/en/weather_HassGetWeather.yaml b/tests/en/weather_HassGetWeather.yaml index f8c3b3e192..874e34acb4 100644 --- a/tests/en/weather_HassGetWeather.yaml +++ b/tests/en/weather_HassGetWeather.yaml @@ -1,5 +1,12 @@ language: en tests: + - sentences: + - "what's the weather?" + - "what is the weather like" + intent: + name: HassGetWeather + response: 47 °F and raining + - sentences: - "what's the weather like in london?" - "what is the weather in London like"