From 1e38903dcfe5147e9763eab3ade51a7f5148cedb Mon Sep 17 00:00:00 2001 From: Patrick762 Date: Mon, 31 Jul 2023 16:51:23 +0200 Subject: [PATCH] fix name for some devices --- custom_components/bluetti_bt/config_flow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/bluetti_bt/config_flow.py b/custom_components/bluetti_bt/config_flow.py index 65dabc0..9823ec5 100644 --- a/custom_components/bluetti_bt/config_flow.py +++ b/custom_components/bluetti_bt/config_flow.py @@ -2,6 +2,7 @@ from __future__ import annotations +import re import logging import voluptuous as vol @@ -54,7 +55,7 @@ class BluettiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): data={ CONF_ADDRESS: discovery_info.address, CONF_TYPE: dev_type, - CONF_NAME: discovery_info.name, + CONF_NAME: re.sub("[^A-Z0-9]+", "", discovery_info.name), }, )