From b3b35e4299153bdab9e98e34b8d1040b32ec9185 Mon Sep 17 00:00:00 2001
From: karwosts <32912880+karwosts@users.noreply.github.com>
Date: Thu, 5 Mar 2026 11:46:44 -0800
Subject: [PATCH] Menu item to reset light favorite colors (#30004)
reset-light-favorites
---
src/dialogs/more-info/ha-more-info-dialog.ts | 53 +++++++++++++++++++-
src/translations/en.json | 2 +
2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts
index da8a41b210..b31bd472af 100644
--- a/src/dialogs/more-info/ha-more-info-dialog.ts
+++ b/src/dialogs/more-info/ha-more-info-dialog.ts
@@ -1,4 +1,5 @@
import {
+ mdiBackupRestore,
mdiChartBoxOutline,
mdiClose,
mdiCodeBraces,
@@ -49,7 +50,10 @@ import type {
EntityRegistryEntry,
ExtEntityRegistryEntry,
} from "../../data/entity/entity_registry";
-import { getExtendedEntityRegistryEntry } from "../../data/entity/entity_registry";
+import {
+ getExtendedEntityRegistryEntry,
+ updateEntityRegistryEntry,
+} from "../../data/entity/entity_registry";
import { lightSupportsFavoriteColors } from "../../data/light";
import type { ItemType } from "../../data/search";
import { SearchableDomains } from "../../data/search";
@@ -75,6 +79,7 @@ import "./ha-more-info-history-and-logbook";
import "./ha-more-info-info";
import "./ha-more-info-settings";
import "./more-info-content";
+import { showConfirmationDialog } from "../generic/show-dialog-box";
export interface MoreInfoDialogParams {
entityId: string | null;
@@ -358,6 +363,9 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) {
case "toggle_edit":
this._toggleInfoEditMode();
break;
+ case "reset_favorites":
+ this._resetFavorites();
+ break;
case "related":
this._goToRelated();
break;
@@ -373,6 +381,36 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) {
}
}
+ private async _resetFavorites() {
+ if (
+ !(await showConfirmationDialog(this, {
+ title: this.hass!.localize(
+ "ui.dialogs.more_info_control.light.reset_favorites"
+ ),
+ text: this.hass!.localize(
+ "ui.dialogs.more_info_control.light.reset_favorites_text"
+ ),
+ dismissText: this.hass!.localize("ui.common.cancel"),
+ confirmText: this.hass!.localize("ui.common.reset"),
+ destructive: true,
+ }))
+ ) {
+ return;
+ }
+
+ const result = await updateEntityRegistryEntry(
+ this.hass,
+ this._entry!.entity_id,
+ {
+ options_domain: "light",
+ options: {
+ favorite_colors: undefined,
+ },
+ }
+ );
+ this._entry = result.entity_entry;
+ }
+
private _showDetails(): void {
import("./ha-more-info-details");
this._childView = {
@@ -592,6 +630,19 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) {
`ui.dialogs.more_info_control.${domain}.edit_mode`
)}
+
+
+ ${this.hass.localize(
+ `ui.dialogs.more_info_control.light.reset_favorites`
+ )}
+
`
: nothing}
diff --git a/src/translations/en.json b/src/translations/en.json
index 2e09ca283f..d93a5791cc 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -1612,6 +1612,8 @@
},
"light": {
"edit_mode": "Edit favorite colors",
+ "reset_favorites": "Reset favorite colors",
+ "reset_favorites_text": "Do you want to reset all favorite colors for this light back to default?",
"toggle": "Toggle",
"color": "Color",
"color_temp": "Temperature",