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
1 changed files with 7 additions and 1 deletions

View File

@ -349,7 +349,13 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")}
.placeholder=${this.entry.original_icon || stateObj?.attributes.icon}
.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}
.disabled=${this._submitting}
></ha-icon-picker>