1
mirror of https://github.com/home-assistant/frontend synced 2024-09-30 15:52:53 +02:00

Show icon preview when changing device class (#14472)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Paul Bottein 2022-11-29 15:27:10 +01:00 committed by GitHub
parent aeeacc6cad
commit c0240eed67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,7 +349,13 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")} .label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")}
.placeholder=${this.entry.original_icon || stateObj?.attributes.icon} .placeholder=${this.entry.original_icon || stateObj?.attributes.icon}
.fallbackPath=${!this._icon && !stateObj?.attributes.icon && stateObj .fallbackPath=${!this._icon && !stateObj?.attributes.icon && stateObj
? domainIcon(computeDomain(stateObj.entity_id), stateObj) ? domainIcon(computeDomain(stateObj.entity_id), {
...stateObj,
attributes: {
...stateObj.attributes,
device_class: this._deviceClass,
},
})
: undefined} : undefined}
.disabled=${this._submitting} .disabled=${this._submitting}
></ha-icon-picker> ></ha-icon-picker>