From e278b463fda60fd8bc76c85ab1a7ad820d696545 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 25 Sep 2025 16:54:11 +0200 Subject: [PATCH] Fix analytics switches (#27181) --- src/components/ha-analytics.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/ha-analytics.ts b/src/components/ha-analytics.ts index dc74af02e0..7915c38d5a 100644 --- a/src/components/ha-analytics.ts +++ b/src/components/ha-analytics.ts @@ -1,5 +1,5 @@ import type { CSSResultGroup, TemplateResult } from "lit"; -import { css, html, LitElement } from "lit"; +import { css, html, LitElement, nothing } from "lit"; import { customElement, property } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import type { LocalizeFunc } from "../common/translations/localize"; @@ -73,14 +73,18 @@ export class HaAnalytics extends LitElement { .checked=${this.analytics?.preferences[preference]} .preference=${preference} name=${preference} - ?disabled=${baseEnabled} > - - ${this.localize( - `ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled` - )} - + ${baseEnabled + ? nothing + : html` + ${this.localize( + `ui.panel.${this.translationKeyPanel}.analytics.need_base_enabled` + )} + `} `