diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index 0b14444536..f63f3592e4 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -22,6 +22,7 @@ import { styleMap } from "lit-html/directives/style-map"; import { fireEvent } from "../../common/dom/fire_event"; import { computeRTLDirection } from "../../common/util/compute_rtl"; import { debounce } from "../../common/util/debounce"; +import type { MediaPlayerItem } from "../../data/media-player"; import { browseLocalMediaPlayer, browseMediaPlayer, @@ -30,11 +31,11 @@ import { MediaPickedEvent, MediaPlayerBrowseAction, } from "../../data/media-player"; -import type { MediaPlayerItem } from "../../data/media-player"; import { showAlertDialog } from "../../dialogs/generic/show-dialog-box"; import { installResizeObserver } from "../../panels/lovelace/common/install-resize-observer"; import { haStyle } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; +import { documentationUrl } from "../../util/documentation-url"; import "../entity/ha-entity-picker"; import "../ha-button-menu"; import "../ha-card"; @@ -511,7 +512,10 @@ export class HaMediaPlayerBrowse extends LitElement {
Check the documentation${this.hass.localize( diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index f76f44ac67..5a39e7eac8 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -39,6 +39,7 @@ import "../../../layouts/ha-app-layout"; import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { documentationUrl } from "../../../util/documentation-url"; import "../ha-config-section"; import { configSections } from "../ha-panel-config"; import "./action/ha-automation-action"; @@ -159,7 +160,10 @@ export class HaAutomationEditor extends LitElement { "ui.panel.config.automation.editor.modes.description", "documentation_link", html`${this.hass.localize( @@ -247,7 +251,10 @@ export class HaAutomationEditor extends LitElement { )}
@@ -276,7 +283,10 @@ export class HaAutomationEditor extends LitElement { )} @@ -305,7 +315,10 @@ export class HaAutomationEditor extends LitElement { )} diff --git a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts index b590848f99..1561ed7420 100644 --- a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts +++ b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts @@ -14,6 +14,7 @@ import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialo import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; import { haStyle } from "../../../../resources/styles"; import { HomeAssistant } from "../../../../types"; +import { documentationUrl } from "../../../../util/documentation-url"; import { WebhookDialogParams } from "./show-dialog-manage-cloudhook"; const inputLabel = "Public URL – Click to copy to clipboard"; @@ -37,8 +38,11 @@ export class DialogManageCloudhook extends LitElement { const { webhook, cloudhook } = this._params; const docsUrl = webhook.domain === "automation" - ? "https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger" - : `https://www.home-assistant.io/integrations/${webhook.domain}/`; + ? documentationUrl( + this.hass!, + "/docs/automation/trigger/#webhook-trigger" + ) + : documentationUrl(this.hass!, `/integrations/${webhook.domain}/`); return html`[[localize('ui.panel.config.cloud.register.information4')]]
diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts
index 7d220ba93c..b9860c0589 100644
--- a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts
+++ b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts
@@ -1,20 +1,20 @@
-import "../../../../../components/ha-icon-button";
-import "../../../../../components/ha-circular-progress";
import { UnsubscribeFunc } from "home-assistant-js-websocket";
import {
css,
CSSResult,
customElement,
html,
+ internalProperty,
LitElement,
property,
- internalProperty,
TemplateResult,
} from "lit-element";
import "../../../../../components/buttons/ha-call-api-button";
import "../../../../../components/buttons/ha-call-service-button";
import "../../../../../components/ha-card";
+import "../../../../../components/ha-circular-progress";
import "../../../../../components/ha-icon";
+import "../../../../../components/ha-icon-button";
import "../../../../../components/ha-service-description";
import {
fetchNetworkStatus,
@@ -26,6 +26,7 @@ import {
} from "../../../../../data/zwave";
import { haStyle } from "../../../../../resources/styles";
import { HomeAssistant } from "../../../../../types";
+import { documentationUrl } from "../../../../../util/documentation-url";
import "../../../ha-config-section";
@customElement("zwave-network")
@@ -71,7 +72,10 @@ export class ZwaveNetwork extends LitElement {
)}
diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts
index 94c50807c1..043d407607 100644
--- a/src/panels/config/person/dialog-person-detail.ts
+++ b/src/panels/config/person/dialog-person-detail.ts
@@ -4,23 +4,24 @@ import {
css,
CSSResult,
html,
+ internalProperty,
LitElement,
property,
- internalProperty,
TemplateResult,
} from "lit-element";
import memoizeOne from "memoize-one";
-import "../../../components/ha-picture-upload";
-import type { HaPictureUpload } from "../../../components/ha-picture-upload";
import "../../../components/entity/ha-entities-picker";
import { createCloseHeading } from "../../../components/ha-dialog";
+import "../../../components/ha-picture-upload";
+import type { HaPictureUpload } from "../../../components/ha-picture-upload";
import "../../../components/user/ha-user-picker";
import { PersonMutableParams } from "../../../data/person";
+import { CropOptions } from "../../../dialogs/image-cropper-dialog/show-image-cropper-dialog";
import { PolymerChangedEvent } from "../../../polymer-types";
import { haStyleDialog } from "../../../resources/styles";
import { HomeAssistant } from "../../../types";
+import { documentationUrl } from "../../../util/documentation-url";
import { PersonDetailDialogParams } from "./show-dialog-person-detail";
-import { CropOptions } from "../../../dialogs/image-cropper-dialog/show-image-cropper-dialog";
const includeDomains = ["device_tracker"];
@@ -153,7 +154,10 @@ class DialogPersonDetail extends LitElement {
diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts
index 9e4ce3cc07..6d248bac05 100644
--- a/src/panels/config/script/ha-script-editor.ts
+++ b/src/panels/config/script/ha-script-editor.ts
@@ -1,46 +1,47 @@
+import "@material/mwc-fab";
+import { mdiContentSave } from "@mdi/js";
import "@polymer/app-layout/app-header/app-header";
-import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light";
import "@polymer/app-layout/app-toolbar/app-toolbar";
-import "../../../components/ha-icon-button";
+import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light";
+import { PaperListboxElement } from "@polymer/paper-listbox";
import {
css,
CSSResult,
html,
+ internalProperty,
LitElement,
property,
- internalProperty,
PropertyValues,
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import { computeObjectId } from "../../../common/entity/compute_object_id";
import { navigate } from "../../../common/navigate";
+import { slugify } from "../../../common/string/slugify";
import { computeRTL } from "../../../common/util/compute_rtl";
import "../../../components/ha-card";
+import "../../../components/ha-icon-button";
import "../../../components/ha-icon-input";
-import { showToast } from "../../../util/toast";
-import "@material/mwc-fab";
+import "../../../components/ha-svg-icon";
import {
Action,
deleteScript,
getScriptEditorInitData,
- ScriptConfig,
- triggerScript,
MODES,
MODES_MAX,
+ ScriptConfig,
+ triggerScript,
} from "../../../data/script";
import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box";
import "../../../layouts/ha-app-layout";
import { haStyle } from "../../../resources/styles";
import { HomeAssistant, Route } from "../../../types";
+import { documentationUrl } from "../../../util/documentation-url";
+import { showToast } from "../../../util/toast";
import "../automation/action/ha-automation-action";
import { HaDeviceAction } from "../automation/action/types/ha-automation-action-device_id";
import "../ha-config-section";
import { configSections } from "../ha-panel-config";
-import "../../../components/ha-svg-icon";
-import { mdiContentSave } from "@mdi/js";
-import { PaperListboxElement } from "@polymer/paper-listbox";
-import { slugify } from "../../../common/string/slugify";
export class HaScriptEditor extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@@ -148,7 +149,10 @@ export class HaScriptEditor extends LitElement {
"ui.panel.config.script.editor.modes.description",
"documentation_link",
html`${this.hass.localize(
@@ -197,18 +201,20 @@ export class HaScriptEditor extends LitElement {
diff --git a/src/panels/developer-tools/event/developer-tools-event.js b/src/panels/developer-tools/event/developer-tools-event.js
index 4466d48f10..ec7526fee9 100644
--- a/src/panels/developer-tools/event/developer-tools-event.js
+++ b/src/panels/developer-tools/event/developer-tools-event.js
@@ -9,6 +9,7 @@ import "../../../components/ha-code-editor";
import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box";
import { EventsMixin } from "../../../mixins/events-mixin";
import LocalizeMixin from "../../../mixins/localize-mixin";
+import { documentationUrl } from "../../../util/documentation-url";
import "../../../styles/polymer-ha-style";
import "./event-subscribe-card";
import "./events-list";
@@ -61,7 +62,7 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) {
[[localize( 'ui.panel.developer-tools.tabs.events.description' )]]
@@ -149,6 +150,10 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) {
}
}
+ _computeDocumentationUrl(hass) {
+ return documentationUrl(hass, "/docs/configuration/events/");
+ }
+
_computeValidJSON(parsedJSON) {
return parsedJSON !== ERROR_SENTINEL;
}
diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts
index c9ca775fbf..d41e8fed1e 100644
--- a/src/panels/developer-tools/template/developer-tools-template.ts
+++ b/src/panels/developer-tools/template/developer-tools-template.ts
@@ -19,6 +19,7 @@ import {
} from "../../../data/ws-templates";
import { haStyle } from "../../../resources/styles";
import { HomeAssistant } from "../../../types";
+import { documentationUrl } from "../../../util/documentation-url";
const DEMO_TEMPLATE = `{## Imitate available variables: ##}
{% set my_test_json = {
@@ -107,7 +108,10 @@ class HaPanelDevTemplate extends LitElement {