Update todo intent slot schema (#122335)

* Update todo intent slot schema

* Update intent.py

* ruff
pull/122993/head
Denis Shulyaka 2024-07-31 10:37:55 +03:00 committed by GitHub
parent 5a04d982d9
commit beb2ef121e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,8 @@
from __future__ import annotations
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.helpers import intent
from homeassistant.helpers.entity_component import EntityComponent
@ -21,7 +23,10 @@ class ListAddItemIntent(intent.IntentHandler):
intent_type = INTENT_LIST_ADD_ITEM
description = "Add item to a todo list"
slot_schema = {"item": intent.non_empty_string, "name": intent.non_empty_string}
slot_schema = {
vol.Required("item"): intent.non_empty_string,
vol.Required("name"): intent.non_empty_string,
}
platforms = {DOMAIN}
async def async_handle(self, intent_obj: intent.Intent) -> intent.IntentResponse: