mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 02:06:42 +00:00
Only update device class if changed by user (#13551)
This commit is contained in:
parent
604e5d5e09
commit
2bf0c5d72d
@ -872,10 +872,17 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
name: this._name.trim() || null,
|
name: this._name.trim() || null,
|
||||||
icon: this._icon.trim() || null,
|
icon: this._icon.trim() || null,
|
||||||
area_id: this._areaId || null,
|
area_id: this._areaId || null,
|
||||||
device_class: this._deviceClass || null,
|
|
||||||
new_entity_id: this._entityId.trim(),
|
new_entity_id: this._entityId.trim(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Only update device class if changed by user
|
||||||
|
if (
|
||||||
|
this._deviceClass !==
|
||||||
|
(this.entry.device_class || this.entry.original_device_class)
|
||||||
|
) {
|
||||||
|
params.device_class = this._deviceClass;
|
||||||
|
}
|
||||||
|
|
||||||
const stateObj: HassEntity | undefined =
|
const stateObj: HassEntity | undefined =
|
||||||
this.hass.states[this.entry.entity_id];
|
this.hass.states[this.entry.entity_id];
|
||||||
const domain = computeDomain(this.entry.entity_id);
|
const domain = computeDomain(this.entry.entity_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user