mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 14:08:29 -04:00
@@ -210,6 +210,10 @@ Singleton {
|
|||||||
updated[nodeName] = trimmedAlias;
|
updated[nodeName] = trimmedAlias;
|
||||||
deviceAliases = updated;
|
deviceAliases = updated;
|
||||||
|
|
||||||
|
const btDevice = BluetoothService.deviceForNodeName(nodeName);
|
||||||
|
if (btDevice)
|
||||||
|
btDevice.name = trimmedAlias;
|
||||||
|
|
||||||
writeWireplumberConfig();
|
writeWireplumberConfig();
|
||||||
deviceAliasChanged(nodeName, trimmedAlias);
|
deviceAliasChanged(nodeName, trimmedAlias);
|
||||||
return true;
|
return true;
|
||||||
@@ -226,6 +230,11 @@ Singleton {
|
|||||||
delete updated[nodeName];
|
delete updated[nodeName];
|
||||||
deviceAliases = updated;
|
deviceAliases = updated;
|
||||||
|
|
||||||
|
// Empty BlueZ alias write resets to the device's real name.
|
||||||
|
const btDevice = BluetoothService.deviceForNodeName(nodeName);
|
||||||
|
if (btDevice)
|
||||||
|
btDevice.name = "";
|
||||||
|
|
||||||
writeWireplumberConfig();
|
writeWireplumberConfig();
|
||||||
deviceAliasChanged(nodeName, "");
|
deviceAliasChanged(nodeName, "");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -245,6 +245,14 @@ Singleton {
|
|||||||
return `bluez_card.${device.address.replace(/:/g, "_")}`;
|
return `bluez_card.${device.address.replace(/:/g, "_")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deviceForNodeName(nodeName) {
|
||||||
|
const match = (nodeName || "").match(/^bluez_(?:output|input|card)\.([0-9A-Fa-f_]+)/);
|
||||||
|
if (!match)
|
||||||
|
return null;
|
||||||
|
const address = match[1].replace(/_/g, ":").toUpperCase();
|
||||||
|
return Bluetooth.devices?.values?.find(d => (d.address || "").toUpperCase() === address) ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
function getDevicePath(device) {
|
function getDevicePath(device) {
|
||||||
if (!device || !device.address) {
|
if (!device || !device.address) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
Reference in New Issue
Block a user