mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Fix bluetooth device info is encoding data twice (#25353)
Data is already encoded
This commit is contained in:
parent
1b501907f1
commit
6b568307a4
@ -29,9 +29,8 @@ class DialogBluetoothDeviceInfo extends LitElement implements HassDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public showDataAsHex(bytestring: string): string {
|
public showDataAsHex(bytestring: string): string {
|
||||||
return Array.from(new TextEncoder().encode(bytestring))
|
const bytes = bytestring.match(/.{2}/g) ?? [];
|
||||||
.map((byte) => byte.toString(16).toUpperCase().padStart(2, "0"))
|
return bytes.map((byte) => `0x${byte.toUpperCase()}`).join(" ");
|
||||||
.join(" ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _copyToClipboard(): Promise<void> {
|
private async _copyToClipboard(): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user