Skip to content

Commit

Permalink
Add HassListAddItem intent (#1626)
Browse files Browse the repository at this point in the history
* Add HassListAddItem intent

* Shorten response

* Fix test
  • Loading branch information
synesthesiam authored Nov 13, 2023
1 parent 1cb75bd commit 07ffc5a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions intents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,19 @@ HassGetWeather:
name:
description: "Name of the weather entity to use"
required: false

# -----------------------------------------------------------------------------
# todo
# -----------------------------------------------------------------------------

HassListAddItem:
supported: false
domain: todo
description: "Adds an item to a todo list"
slots:
item:
description: "Item to add"
required: true
name:
description: "Name of the list"
required: true
5 changes: 5 additions & 0 deletions responses/en/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: "en"
responses:
intents:
HassListAddItem:
item_added: "Added {{ slots.item }}"
13 changes: 13 additions & 0 deletions sentences/en/todo_HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: "en"
intents:
HassListAddItem:
data:
- sentences:
- add <item> to<my_list>
- put <item> (on|in)<my_list>
response: item_added
requires_context:
domain: todo
expansion_rules:
my_list: "[ my| the] {name}[ list]"
item: "{shopping_list_item:item}"
4 changes: 4 additions & 0 deletions tests/en/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,7 @@ entities:
- name: "John"
id: "person.john"
state: "not_home"

- name: "Trader Joe[']s"
id: "todo.trader_joes"
state: ""
11 changes: 11 additions & 0 deletions tests/en/todo_HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: en
tests:
- sentences:
- add apples to my trader joes list
- put apples on the trader joes list
intent:
name: HassListAddItem
slots:
item: "apples "
name: "Trader Joes"
response: Added apples

0 comments on commit 07ffc5a

Please sign in to comment.