mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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 {
|
||||
type: "entity",
|
||||
entity: config,
|
||||
display_type: "complete",
|
||||
};
|
||||
}
|
||||
if ("type" in config && config.type) {
|
||||
|
@ -58,7 +58,7 @@ export class HuiBadge extends ReactiveElement {
|
||||
|
||||
private _updateElement(config: LovelaceBadgeConfig) {
|
||||
if (config.type === "state-label") {
|
||||
config = { ...config, type: "entity" };
|
||||
config = { display_type: "complete", ...config, type: "entity" };
|
||||
}
|
||||
if (!this._element) {
|
||||
return;
|
||||
@ -70,7 +70,7 @@ export class HuiBadge extends ReactiveElement {
|
||||
|
||||
private _loadElement(config: LovelaceBadgeConfig) {
|
||||
if (config.type === "state-label") {
|
||||
config = { ...config, type: "entity" };
|
||||
config = { display_type: "complete", ...config, type: "entity" };
|
||||
}
|
||||
this._element = createBadgeElement(config);
|
||||
this._elementConfig = config;
|
||||
|
Loading…
x
Reference in New Issue
Block a user