From bb608a05ee0d50d4d1a4753ee95bd9146ea30605 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 20 Jul 2023 14:24:17 -0400 Subject: [PATCH] Sports updates from Assist --- custom_sentences/en/sports.yaml | 35 +++++++++++++++++++++++++++++++++ packages/assist/sports.yaml | 15 ++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 custom_sentences/en/sports.yaml create mode 100644 packages/assist/sports.yaml diff --git a/custom_sentences/en/sports.yaml b/custom_sentences/en/sports.yaml new file mode 100644 index 0000000..7595838 --- /dev/null +++ b/custom_sentences/en/sports.yaml @@ -0,0 +1,35 @@ +language: "en" + +intents: + SportsScore: + data: + - sentences: + - "(what is|give me|what's) the score (for|of|in) the {team} [game]" + - "[give me a] score update for {team} [game]" + - "did [the] {team} win [their game]" + - "(what is the|give me the) status (of|for) the {team} [game]" + - "(is|are|do) [the] {team} (play|playing) today" + +skip_words: + - "please" + - "can you" + +lists: + team: + values: + - in: "(michigan wolverines|michigan)" + out: "michigan_wolverines" + - in: "(ohio state|buckeyes)" + out: "ohio_state_buckeyes" + - in: "(toledo rockets|toledo|rockets)" + out: "toledo_rockets" + - in: "(minnesota vikings|vikings)" + out: "minnesota_vikings" + - in: "(forty niners|san francisco forty niners|49ers)" + out: "san_francisco_49ers" + - in: "(cleveland guardians|guardians)" + out: "cleveland_guardians" + - in: "(minnesota twins|twins)" + out: "minnesota_twins" + - in: "(los angeles dodgers|LA dodgers|dodgers)" + out: "los_angeles_dodgers" \ No newline at end of file diff --git a/packages/assist/sports.yaml b/packages/assist/sports.yaml new file mode 100644 index 0000000..34cf53c --- /dev/null +++ b/packages/assist/sports.yaml @@ -0,0 +1,15 @@ +intent_script: + SportsScore: + speech: + text: > + {% from 'sports.jinja' import sports_pregame, sports_main %} + {% set inhibit = "binary_sensor." + team + "_inhibit" %} + {% set sensor = "sensor." + team %} + {% if is_state(inhibit,'on') %} + I do not have any information about the {{ state_attr(team,'friendly_name') }} at this time. + {% elif states(sensor) in ["NOT_FOUND"] %} + They do not appear to have a game scheduled for today. + {% else %} + {{ sports_pregame(sensor) }} + {{ sports_main(sensor) }} + {% endif %}