From 0bc685a8e32aa55aecb6b787a98375315cb1c96b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 24 Jan 2023 17:19:56 +0100 Subject: [PATCH] Sanatize `manufacturerName`. https://github.com/home-assistant/core/issues/85691 --- lib/controller.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/controller.ts b/lib/controller.ts index 9099c2a1c..9dd4c4641 100644 --- a/lib/controller.ts +++ b/lib/controller.ts @@ -243,11 +243,14 @@ export class Controller { message.device = { friendlyName: entity.name, model: entity.definition ? entity.definition.model : 'unknown', ieeeAddr: entity.ieeeAddr, networkAddress: entity.zh.networkAddress, type: entity.zh.type, - manufacturerID: entity.zh.manufacturerID, manufacturerName: entity.zh.manufacturerName, + manufacturerID: entity.zh.manufacturerID, powerSource: entity.zh.powerSource, applicationVersion: entity.zh.applicationVersion, stackVersion: entity.zh.stackVersion, zclVersion: entity.zh.zclVersion, hardwareVersion: entity.zh.hardwareVersion, dateCode: entity.zh.dateCode, softwareBuildID: entity.zh.softwareBuildID, + // Manufacturer name can contain \u0000, remove this. + // https://github.com/home-assistant/core/issues/85691 + manufacturerName: entity.zh.manufacturerName?.split('\u0000')[0], }; }