Add intent_script debug logging (#82060)

This commit is contained in:
Matthieu 2022-11-17 20:59:13 +01:00 committed by GitHub
parent 47c66dbed4
commit b5390f55ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
"""Handle intents with scripts."""
import copy
import logging
import voluptuous as vol
@ -8,6 +9,8 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, intent, script, template
from homeassistant.helpers.typing import ConfigType
_LOGGER = logging.getLogger(__name__)
DOMAIN = "intent_script"
CONF_INTENTS = "intents"
@ -83,6 +86,16 @@ class ScriptIntentHandler(intent.IntentHandler):
is_async_action = self.config.get(CONF_ASYNC_ACTION)
slots = {key: value["value"] for key, value in intent_obj.slots.items()}
_LOGGER.debug(
"Intent named %s received with slots: %s",
intent_obj.intent_type,
{
key: value
for key, value in slots.items()
if not key.startswith("_") and not key.endswith("_raw_value")
},
)
if action is not None:
if is_async_action:
intent_obj.hass.async_create_task(