-
+
[[localize('ui.panel.shopping-list.microphone_tip')]]
@@ -143,7 +148,10 @@ class HaPanelShoppingList extends LocalizeMixin(PolymerElement) {
return {
hass: Object,
narrow: Boolean,
- canListen: Boolean,
+ conversation: {
+ type: Boolean,
+ computed: "_computeConversation(hass)",
+ },
items: {
type: Array,
value: [],
@@ -207,6 +215,14 @@ class HaPanelShoppingList extends LocalizeMixin(PolymerElement) {
}
}
+ _computeConversation(hass) {
+ return isComponentLoaded(hass, "conversation");
+ }
+
+ _showVoiceCommandDialog() {
+ showVoiceCommandDialog(this);
+ }
+
_saveEdit(ev) {
const { index, item } = ev.model;
const name = ev.target.value;
diff --git a/src/panels/states/ha-panel-states.js b/src/panels/states/ha-panel-states.js
index 39a1a64d5d..34dda5d87a 100644
--- a/src/panels/states/ha-panel-states.js
+++ b/src/panels/states/ha-panel-states.js
@@ -12,7 +12,6 @@ import "@polymer/paper-tabs/paper-tabs";
import "../../components/ha-cards";
import "../../components/ha-icon";
import "../../components/ha-menu-button";
-import "../../components/ha-start-voice-button";
import "../../layouts/ha-app-layout";
@@ -23,6 +22,8 @@ import { computeStateDomain } from "../../common/entity/compute_state_domain";
import computeLocationName from "../../common/config/location_name";
import NavigateMixin from "../../mixins/navigate-mixin";
import { EventsMixin } from "../../mixins/events-mixin";
+import { showVoiceCommandDialog } from "../../dialogs/voice-command-dialog/show-ha-voice-command-dialog";
+import { isComponentLoaded } from "../../common/config/is_component_loaded";
const DEFAULT_VIEW_ENTITY_ID = "group.default_view";
const ALWAYS_SHOW_DOMAIN = ["persistent_notification", "configurator"];
@@ -72,7 +73,12 @@ class PartialCards extends EventsMixin(NavigateMixin(PolymerElement)) {
[[computeTitle(views, defaultView, locationName)]]
-
+
@@ -174,6 +180,11 @@ class PartialCards extends EventsMixin(NavigateMixin(PolymerElement)) {
value: 1,
},
+ conversation: {
+ type: Boolean,
+ computed: "_computeConversation(hass)",
+ },
+
locationName: {
type: String,
value: "",
@@ -241,6 +252,14 @@ class PartialCards extends EventsMixin(NavigateMixin(PolymerElement)) {
);
}
+ _computeConversation(hass) {
+ return isComponentLoaded(hass, "conversation");
+ }
+
+ _showVoiceCommandDialog() {
+ showVoiceCommandDialog(this);
+ }
+
areTabsHidden(views, showTabs) {
return !views || !views.length || !showTabs;
}
diff --git a/src/translations/en.json b/src/translations/en.json
index c843d728d8..a4d67a2193 100755
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -554,6 +554,12 @@
}
},
"dialogs": {
+ "voice_command": {
+ "did_not_hear": "Home Assistant did not hear anything",
+ "how_can_i_help": "How can I help?",
+ "label": "Type a question and press ",
+ "label_voice": "Type and press or tap the microphone icon to speak"
+ },
"confirmation": {
"cancel": "Cancel",
"ok": "OK",
@@ -1698,7 +1704,7 @@
"shopping-list": {
"clear_completed": "Clear completed",
"add_item": "Add item",
- "microphone_tip": "Tap the microphone on the top right and say “Add candy to my shopping list”"
+ "microphone_tip": "Tap the microphone on the top right and say or type “Add candy to my shopping list”"
},
"page-authorize": {
"initializing": "Initializing",
diff --git a/yarn.lock b/yarn.lock
index 77ee588941..bd5bb940c6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2037,6 +2037,11 @@
dependencies:
"@types/node" "*"
+"@types/webspeechapi@^0.0.29":
+ version "0.0.29"
+ resolved "https://registry.yarnpkg.com/@types/webspeechapi/-/webspeechapi-0.0.29.tgz#8f3c6b31b779df7a9bbac7f89acfce0c3bcb1972"
+ integrity sha512-AYEhqEJLdR08YPBOwYa73IHTiGU4DdngbKbtZdW+bzuM7s8LzKBed0Fwgl/a3oMqMY227qOT+3Lpr5A0WSmm+A==
+
"@types/whatwg-url@^6.4.0":
version "6.4.0"
resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-6.4.0.tgz#1e59b8c64bc0dbdf66d037cf8449d1c3d5270237"