Rename base sankey chart tag so it doesn't conflict with the custom card (#23600)

This commit is contained in:
Petar Petrov 2025-01-06 14:42:43 +02:00 committed by GitHub
parent 3d1817a6b9
commit 63c658e5b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -49,8 +49,8 @@ const NODE_WIDTH = 15;
const FONT_SIZE = 12; const FONT_SIZE = 12;
const MIN_DISTANCE = FONT_SIZE / 2; const MIN_DISTANCE = FONT_SIZE / 2;
@customElement("sankey-chart") @customElement("ha-sankey-chart")
export class SankeyChart extends LitElement { export class HaSankeyChart extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: false }) public data: SankeyChartData = { @property({ attribute: false }) public data: SankeyChartData = {
@ -539,6 +539,6 @@ export class SankeyChart extends LitElement {
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
"sankey-chart": SankeyChart; "ha-sankey-chart": HaSankeyChart;
} }
} }

View File

@ -18,8 +18,8 @@ import { SubscribeMixin } from "../../../../mixins/subscribe-mixin";
import type { HomeAssistant } from "../../../../types"; import type { HomeAssistant } from "../../../../types";
import type { LovelaceCard, LovelaceGridOptions } from "../../types"; import type { LovelaceCard, LovelaceGridOptions } from "../../types";
import type { EnergySankeyCardConfig } from "../types"; import type { EnergySankeyCardConfig } from "../types";
import "../../../../components/chart/sankey-chart"; import "../../../../components/chart/ha-sankey-chart";
import type { Link, Node } from "../../../../components/chart/sankey-chart"; import type { Link, Node } from "../../../../components/chart/ha-sankey-chart";
import { getGraphColorByIndex } from "../../../../common/color/colors"; import { getGraphColorByIndex } from "../../../../common/color/colors";
import { formatNumber } from "../../../../common/number/format_number"; import { formatNumber } from "../../../../common/number/format_number";
@ -399,13 +399,13 @@ class HuiEnergySankeyCard
<ha-card .header=${this._config.title}> <ha-card .header=${this._config.title}>
<div class="card-content"> <div class="card-content">
${hasData ${hasData
? html`<sankey-chart ? html`<ha-sankey-chart
.data=${{ nodes, links }} .data=${{ nodes, links }}
.vertical=${this._config.layout === "vertical"} .vertical=${this._config.layout === "vertical"}
.loadingText=${this.hass.localize( .loadingText=${this.hass.localize(
"ui.panel.lovelace.cards.energy.loading" "ui.panel.lovelace.cards.energy.loading"
)} )}
></sankey-chart>` ></ha-sankey-chart>`
: html`${this.hass.localize( : html`${this.hass.localize(
"ui.panel.lovelace.cards.energy.no_data_period" "ui.panel.lovelace.cards.energy.no_data_period"
)}`} )}`}