Fix html5 notification toggle (#20028)

* Fix html5 notification toggle

* Update src/components/ha-push-notifications-toggle.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* fix lint

---------

Co-authored-by: alexyao2015 <alexyao2015@users.noreply.github.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Alex Yao 2024-03-18 07:03:33 -04:00 committed by GitHub
parent 9e3dfaa400
commit d5de435f06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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`
<ha-switch
.disabled=${this._disabled || this._loading}
.disabled=${this.disabled || this._loading}
.checked=${this._pushChecked}
@change=${this._handlePushChange}
></ha-switch>

View File

@ -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"