Entity registry settings: Remove "Override" string + use domain icon as fallback (#7320)

This commit is contained in:
Philip Allgaier 2020-10-17 22:46:34 +02:00 committed by GitHub
parent 6e130cc020
commit 713e0579f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box
import type { PolymerChangedEvent } from "../../../polymer-types";
import { haStyle } from "../../../resources/styles";
import type { HomeAssistant } from "../../../types";
import { domainIcon } from "../../../common/entity/domain_icon";
@customElement("entity-registry-settings")
export class EntityRegistrySettings extends LitElement {
@ -93,7 +94,11 @@ export class EntityRegistrySettings extends LitElement {
.value=${this._icon}
@value-changed=${this._iconChanged}
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")}
.placeholder=${this.entry.original_icon}
.placeholder=${this.entry.original_icon ||
domainIcon(
computeDomain(this.entry.entity_id),
this.hass.states[this.entry.entity_id]
)}
.disabled=${this._submitting}
.errorMessage=${this.hass.localize(
"ui.dialogs.entity_registry.editor.icon_error"

View File

@ -551,8 +551,8 @@
"no_unique_id": "This entity does not have a unique ID, therefore its settings cannot be managed from the UI. See the {faq_link} for more detail.",
"faq": "documentation",
"editor": {
"name": "Name Override",
"icon": "Icon Override",
"name": "Name",
"icon": "Icon",
"icon_error": "Icons should be in the format 'prefix:iconname', e.g. 'mdi:home'",
"entity_id": "Entity ID",
"unavailable": "This entity is not currently available.",