diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 9637884550..37208ba078 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -38,9 +38,11 @@ import { fireEvent } from "../../common/dom/fire_event"; import scrollToTarget from "../../common/dom/scroll-to-target"; import { shouldHandleRequestSelectedEvent } from "../../common/mwc/handle-request-selected-event"; import { navigate } from "../../common/navigate"; +import { constructUrlCurrentPath } from "../../common/url/construct-url"; import { addSearchParam, - extractSearchParam, + extractSearchParamsObject, + removeSearchParam, } from "../../common/url/search-params"; import { computeRTLDirection } from "../../common/util/compute_rtl"; import { debounce } from "../../common/util/debounce"; @@ -556,8 +558,16 @@ class HUIRoot extends LitElement { protected firstUpdated() { // Check for requested edit mode - if (extractSearchParam("edit") === "1") { + const searchParams = extractSearchParamsObject(); + if (searchParams.edit === "1") { this.lovelace!.setEditMode(true); + } else if (searchParams.conversation === "1") { + showVoiceCommandDialog(this); + window.history.replaceState( + null, + "", + constructUrlCurrentPath(removeSearchParam("conversation")) + ); } }