From a1b492367327b26b36887efa1ee8a617279e4a10 Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Wed, 11 Feb 2026 09:00:16 +0000 Subject: [PATCH] Migrate bluetooth device info dialog to wa (#29546) Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com> --- .../bluetooth/dialog-bluetooth-device-info.ts | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/bluetooth/dialog-bluetooth-device-info.ts b/src/panels/config/integrations/integration-panels/bluetooth/dialog-bluetooth-device-info.ts index 91796067de..b686abd101 100644 --- a/src/panels/config/integrations/integration-panels/bluetooth/dialog-bluetooth-device-info.ts +++ b/src/panels/config/integrations/integration-panels/bluetooth/dialog-bluetooth-device-info.ts @@ -4,28 +4,34 @@ import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { copyToClipboard } from "../../../../../common/util/copy-clipboard"; import "../../../../../components/ha-button"; -import { createCloseHeading } from "../../../../../components/ha-dialog"; -import type { HassDialog } from "../../../../../dialogs/make-dialog-manager"; +import "../../../../../components/ha-dialog-footer"; +import "../../../../../components/ha-wa-dialog"; import type { HomeAssistant } from "../../../../../types"; import { showToast } from "../../../../../util/toast"; import type { BluetoothDeviceInfoDialogParams } from "./show-dialog-bluetooth-device-info"; @customElement("dialog-bluetooth-device-info") -class DialogBluetoothDeviceInfo extends LitElement implements HassDialog { +class DialogBluetoothDeviceInfo extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @state() private _params?: BluetoothDeviceInfoDialogParams; + @state() private _open = false; + public async showDialog( params: BluetoothDeviceInfoDialogParams ): Promise { this._params = params; + this._open = true; } - public closeDialog(): boolean { + public closeDialog(): void { + this._open = false; + } + + private _dialogClosed(): void { this._params = undefined; fireEvent(this, "dialog-closed", { dialog: this.localName }); - return true; } public showDataAsHex(bytestring: string): string { @@ -50,13 +56,13 @@ class DialogBluetoothDeviceInfo extends LitElement implements HassDialog { } return html` -

${this.hass.localize("ui.panel.config.bluetooth.address")}: @@ -116,16 +122,16 @@ class DialogBluetoothDeviceInfo extends LitElement implements HassDialog { )} - - ${this.hass.localize( - "ui.panel.config.bluetooth.copy_to_clipboard" - )} - + + + ${this.hass.localize("ui.panel.config.bluetooth.copy_to_clipboard")} + + + `; } }