diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index e2e5aebd4e..ed1a507966 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -110,11 +110,7 @@ export class HuiDialogEditCard } protected updated(changedProps: PropertyValues): void { - if ( - !this._cardConfig || - this._documentationURL !== undefined || - !changedProps.has("_cardConfig") - ) { + if (!this._cardConfig || !changedProps.has("_cardConfig")) { return; } diff --git a/src/panels/lovelace/editor/get-dashboard-documentation-url.ts b/src/panels/lovelace/editor/get-dashboard-documentation-url.ts index 658e1f2cec..c4e66db8aa 100644 --- a/src/panels/lovelace/editor/get-dashboard-documentation-url.ts +++ b/src/panels/lovelace/editor/get-dashboard-documentation-url.ts @@ -7,6 +7,23 @@ import { import type { HomeAssistant } from "../../../types"; import { documentationUrl } from "../../../util/documentation-url"; +const NON_STANDARD_URLS = { + "energy-date-selection": "energy/#energy-date-picker", + "energy-usage-graph": "energy/#energy-usage-graph", + "energy-solar-graph": "energy/#solar-production-graph", + "energy-gas-graph": "energy/#gas-consumption-graph", + "energy-water-graph": "energy/#water-consumption-graph", + "energy-distribution": "energy/#energy-distribution", + "energy-sources-table": "energy/#energy-sources-table", + "energy-grid-neutrality-gauge": "energy/#grid-neutrality-gauge", + "energy-solar-consumed-gauge": "energy/#solar-consumed-gauge", + "energy-carbon-consumed-gauge": "energy/#carbon-consumed-gauge", + "energy-self-sufficiency-gauge": "energy/#self-sufficiency-gauge", + "energy-devices-graph": "energy/#devices-energy-graph", + "energy-devices-detail-graph": "energy/#detail-devices-energy-graph", + "energy-sankey": "energy/#sankey-energy-graph", +}; + export const getCardDocumentationURL = ( hass: HomeAssistant, type: string @@ -15,7 +32,7 @@ export const getCardDocumentationURL = ( return getCustomCardEntry(stripCustomPrefix(type))?.documentationURL; } - return `${documentationUrl(hass, "/dashboards/")}${type}`; + return `${documentationUrl(hass, "/dashboards/")}${NON_STANDARD_URLS[type] || type}`; }; export const getBadgeDocumentationURL = (