diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 0c6ff704df46..db9de78d53b1 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -340,9 +340,24 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { @selected=${this._switchAsChanged} @closed=${stopPropagation} > - - ${domainToName(this.hass.localize, "switch")} + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.device_classes.switch.switch" + )} + + + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.device_classes.switch.outlet" + )} +
  • ${this._switchAsDomainsSorted( SWITCH_AS_DOMAINS, @@ -570,7 +585,15 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { if (ev.target.value === "") { return; } - this._switchAs = ev.target.value; + + // If value is "outlet" that means the user kept the "switch" domain, but actually changed + // the device_class of the switch to "outlet". + const switchAs = ev.target.value === "outlet" ? "switch" : ev.target.value; + this._switchAs = switchAs; + + if (ev.target.value === "outlet" || ev.target.value === "switch") { + this._deviceClass = ev.target.value; + } } private _areaPicked(ev: CustomEvent) { diff --git a/src/translations/en.json b/src/translations/en.json index 2db7accc834b..9594a5b6fddf 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -844,6 +844,10 @@ "curtain": "Curtain", "damper": "Damper", "shutter": "Shutter" + }, + "switch": { + "outlet": "Outlet", + "switch": "Switch" } }, "unavailable": "This entity is unavailable.",