mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add intent_script debug logging (#82060)
This commit is contained in:
parent
47c66dbed4
commit
b5390f55ce
@ -1,5 +1,6 @@
|
|||||||
"""Handle intents with scripts."""
|
"""Handle intents with scripts."""
|
||||||
import copy
|
import copy
|
||||||
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
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 import config_validation as cv, intent, script, template
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DOMAIN = "intent_script"
|
DOMAIN = "intent_script"
|
||||||
|
|
||||||
CONF_INTENTS = "intents"
|
CONF_INTENTS = "intents"
|
||||||
@ -83,6 +86,16 @@ class ScriptIntentHandler(intent.IntentHandler):
|
|||||||
is_async_action = self.config.get(CONF_ASYNC_ACTION)
|
is_async_action = self.config.get(CONF_ASYNC_ACTION)
|
||||||
slots = {key: value["value"] for key, value in intent_obj.slots.items()}
|
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 action is not None:
|
||||||
if is_async_action:
|
if is_async_action:
|
||||||
intent_obj.hass.async_create_task(
|
intent_obj.hass.async_create_task(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user