From 713e0579f8ccc73d1ea6c287d45a61372e5f39b7 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Sat, 17 Oct 2020 22:46:34 +0200 Subject: [PATCH] Entity registry settings: Remove "Override" string + use domain icon as fallback (#7320) --- src/panels/config/entities/entity-registry-settings.ts | 7 ++++++- src/translations/en.json | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 5ac897dc78..e6b7ea577d 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -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" diff --git a/src/translations/en.json b/src/translations/en.json index dd8cbd7bbc..fc62990841 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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.",