From d5de435f060e36be41f0bf404a691924130a19f9 Mon Sep 17 00:00:00 2001 From: Alex Yao <33379584+alexyao2015@users.noreply.github.com> Date: Mon, 18 Mar 2024 07:03:33 -0400 Subject: [PATCH] Fix html5 notification toggle (#20028) * Fix html5 notification toggle * Update src/components/ha-push-notifications-toggle.ts Co-authored-by: Bram Kragten * fix lint --------- Co-authored-by: alexyao2015 Co-authored-by: Bram Kragten --- src/components/ha-push-notifications-toggle.ts | 4 ++-- src/panels/profile/ha-push-notifications-row.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ha-push-notifications-toggle.ts b/src/components/ha-push-notifications-toggle.ts index 2dfc895d74..6c2380b310 100644 --- a/src/components/ha-push-notifications-toggle.ts +++ b/src/components/ha-push-notifications-toggle.ts @@ -17,7 +17,7 @@ export const pushSupported = class HaPushNotificationsToggle extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @state() private _disabled: boolean = false; + @property({ type: Boolean }) public disabled!: boolean; @state() private _pushChecked: boolean = "Notification" in window && Notification.permission === "granted"; @@ -27,7 +27,7 @@ class HaPushNotificationsToggle extends LitElement { protected render(): TemplateResult { return html` diff --git a/src/panels/profile/ha-push-notifications-row.ts b/src/panels/profile/ha-push-notifications-row.ts index a02f02347c..74b9442330 100644 --- a/src/panels/profile/ha-push-notifications-row.ts +++ b/src/panels/profile/ha-push-notifications-row.ts @@ -13,7 +13,7 @@ class HaPushNotificationsRow extends LitElement { @property({ type: Boolean }) public narrow = false; protected render(): TemplateResult { - const platformLoaded = isComponentLoaded(this.hass, "notify.html5"); + const platformLoaded = isComponentLoaded(this.hass, "html5.notify"); let descriptionKey: | "error_use_https" | "error_load_platform"