From 9a510e9e28e8173c8780a9602d1324c68164a0ca Mon Sep 17 00:00:00 2001 From: "mike.toggweiler" Date: Fri, 22 Nov 2024 16:55:15 +0100 Subject: [PATCH] added domain prefix to entities --- custom_components/askoheat/config_flow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/askoheat/config_flow.py b/custom_components/askoheat/config_flow.py index 756367e..33f558b 100644 --- a/custom_components/askoheat/config_flow.py +++ b/custom_components/askoheat/config_flow.py @@ -79,7 +79,10 @@ async def async_step_user( f"sensor.{SensorAttrKey.PAR_ARTICLE_NUMBER}" ] serial_number = parameters[f"sensor.{SensorAttrKey.PAR_ID}"] - unique_id = serial_number.lower().replace("-", "_").replace(".", "_") + cleaned_serial_number = ( + serial_number.lower().replace("-", "_").replace(".", "_") + ) + unique_id = f"{DOMAIN}_{cleaned_serial_number}" await self.async_set_unique_id(unique_id) self._abort_if_unique_id_configured()