From 63c658e5b930469fda56d8f6f9f7ed4c8d79a0b4 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Mon, 6 Jan 2025 14:42:43 +0200 Subject: [PATCH] Rename base sankey chart tag so it doesn't conflict with the custom card (#23600) --- .../chart/{sankey-chart.ts => ha-sankey-chart.ts} | 6 +++--- .../lovelace/cards/energy/hui-energy-sankey-card.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/components/chart/{sankey-chart.ts => ha-sankey-chart.ts} (99%) diff --git a/src/components/chart/sankey-chart.ts b/src/components/chart/ha-sankey-chart.ts similarity index 99% rename from src/components/chart/sankey-chart.ts rename to src/components/chart/ha-sankey-chart.ts index f9315b73ef78..7dcff4fbc9a3 100644 --- a/src/components/chart/sankey-chart.ts +++ b/src/components/chart/ha-sankey-chart.ts @@ -49,8 +49,8 @@ const NODE_WIDTH = 15; const FONT_SIZE = 12; const MIN_DISTANCE = FONT_SIZE / 2; -@customElement("sankey-chart") -export class SankeyChart extends LitElement { +@customElement("ha-sankey-chart") +export class HaSankeyChart extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public data: SankeyChartData = { @@ -539,6 +539,6 @@ export class SankeyChart extends LitElement { declare global { interface HTMLElementTagNameMap { - "sankey-chart": SankeyChart; + "ha-sankey-chart": HaSankeyChart; } } diff --git a/src/panels/lovelace/cards/energy/hui-energy-sankey-card.ts b/src/panels/lovelace/cards/energy/hui-energy-sankey-card.ts index a80f4b480d35..d5630916ef53 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-sankey-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-sankey-card.ts @@ -18,8 +18,8 @@ import { SubscribeMixin } from "../../../../mixins/subscribe-mixin"; import type { HomeAssistant } from "../../../../types"; import type { LovelaceCard, LovelaceGridOptions } from "../../types"; import type { EnergySankeyCardConfig } from "../types"; -import "../../../../components/chart/sankey-chart"; -import type { Link, Node } from "../../../../components/chart/sankey-chart"; +import "../../../../components/chart/ha-sankey-chart"; +import type { Link, Node } from "../../../../components/chart/ha-sankey-chart"; import { getGraphColorByIndex } from "../../../../common/color/colors"; import { formatNumber } from "../../../../common/number/format_number"; @@ -399,13 +399,13 @@ class HuiEnergySankeyCard
${hasData - ? html`` + >` : html`${this.hass.localize( "ui.panel.lovelace.cards.energy.no_data_period" )}`}