mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Voice dialog: Handle when not hearing anything.
This commit is contained in:
parent
23f0744fe2
commit
7c313a1083
@ -171,14 +171,18 @@ Polymer({
|
||||
this.recognition.abort();
|
||||
var text = this.results.final || this.results.interim;
|
||||
this.results = null;
|
||||
if (text === '') {
|
||||
text = '<Home Assistant did not hear anything>';
|
||||
}
|
||||
this.push('_conversation', { who: 'user', text: text, error: true });
|
||||
}.bind(this);
|
||||
this.recognition.onend = function () {
|
||||
// Already handled by onerror
|
||||
if (this.results == null) {
|
||||
return;
|
||||
}
|
||||
var text = this.results.final || this.results.interim;
|
||||
this.results = null;
|
||||
|
||||
if (text === '') return;
|
||||
|
||||
this.push('_conversation', { who: 'user', text: text });
|
||||
|
||||
this.hass.callApi('post', 'conversation/process', { text: text })
|
||||
|
Loading…
x
Reference in New Issue
Block a user