From 072809aadf4dfc0ab5a45b7382a2a899d15c96c8 Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Mon, 27 Jan 2020 13:21:37 +0100 Subject: [PATCH] fix(bluetooth-classic): trim the name output The hcitool command has a new line at the end of the output, which we don't want in the entity. --- src/integrations/bluetooth-classic/bluetooth-classic.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/bluetooth-classic/bluetooth-classic.service.ts b/src/integrations/bluetooth-classic/bluetooth-classic.service.ts index 77f43e2..78d4ef2 100644 --- a/src/integrations/bluetooth-classic/bluetooth-classic.service.ts +++ b/src/integrations/bluetooth-classic/bluetooth-classic.service.ts @@ -191,7 +191,7 @@ export class BluetoothClassicService extends KalmanFilterable(Object, 1.4, 0.8) try { const output = await execPromise(`hcitool name "${address}"`); - return output.stdout ? output.stdout : undefined; + return output.stdout ? output.stdout.trim() : undefined; } catch (e) { this.logger.error(e.message); return undefined;