From 27edbe5c0f6066766e61b9707b9571fe6e4a873a Mon Sep 17 00:00:00 2001 From: tschmidty69 Date: Thu, 25 Jan 2018 01:50:36 -0500 Subject: [PATCH] Snips - (fix) removed endSession mqtt response on error and unknown intents (#11908) * Remove snips endSession response on unknownIntent * Removed snips_response for unknown and error. --- homeassistant/components/snips.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/snips.py b/homeassistant/components/snips.py index 5a317b09e87..5c35e43881e 100644 --- a/homeassistant/components/snips.py +++ b/homeassistant/components/snips.py @@ -106,14 +106,14 @@ def async_setup(hass, config): request['intent']['intentName']) except intent.IntentError: _LOGGER.exception("Error while handling intent: %s.", intent_type) - snips_response = "Error while handling intent" - notification = {'sessionId': request.get('sessionId', 'default'), - 'text': snips_response} + if snips_response: + notification = {'sessionId': request.get('sessionId', 'default'), + 'text': snips_response} - _LOGGER.debug("send_response %s", json.dumps(notification)) - mqtt.async_publish(hass, 'hermes/dialogueManager/endSession', - json.dumps(notification)) + _LOGGER.debug("send_response %s", json.dumps(notification)) + mqtt.async_publish(hass, 'hermes/dialogueManager/endSession', + json.dumps(notification)) yield from hass.components.mqtt.async_subscribe( INTENT_TOPIC, message_received)