mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Show name for badges without config (#21588)
* Show name for badges without config * also for state label type
This commit is contained in:
parent
3ba572ee37
commit
5c30c1647c
@ -13,6 +13,7 @@ export const ensureBadgeConfig = (
|
|||||||
return {
|
return {
|
||||||
type: "entity",
|
type: "entity",
|
||||||
entity: config,
|
entity: config,
|
||||||
|
display_type: "complete",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if ("type" in config && config.type) {
|
if ("type" in config && config.type) {
|
||||||
|
@ -58,7 +58,7 @@ export class HuiBadge extends ReactiveElement {
|
|||||||
|
|
||||||
private _updateElement(config: LovelaceBadgeConfig) {
|
private _updateElement(config: LovelaceBadgeConfig) {
|
||||||
if (config.type === "state-label") {
|
if (config.type === "state-label") {
|
||||||
config = { ...config, type: "entity" };
|
config = { display_type: "complete", ...config, type: "entity" };
|
||||||
}
|
}
|
||||||
if (!this._element) {
|
if (!this._element) {
|
||||||
return;
|
return;
|
||||||
@ -70,7 +70,7 @@ export class HuiBadge extends ReactiveElement {
|
|||||||
|
|
||||||
private _loadElement(config: LovelaceBadgeConfig) {
|
private _loadElement(config: LovelaceBadgeConfig) {
|
||||||
if (config.type === "state-label") {
|
if (config.type === "state-label") {
|
||||||
config = { ...config, type: "entity" };
|
config = { display_type: "complete", ...config, type: "entity" };
|
||||||
}
|
}
|
||||||
this._element = createBadgeElement(config);
|
this._element = createBadgeElement(config);
|
||||||
this._elementConfig = config;
|
this._elementConfig = config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user