From 5e532026180f22f3b9cfab4e36de8d775865fc9a Mon Sep 17 00:00:00 2001 From: Yanik Ruchat Date: Fri, 7 Mar 2025 17:30:56 +0100 Subject: [PATCH 1/2] Removing via_device and cns in MQTT Discovery --- TheengsGateway/discovery.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/TheengsGateway/discovery.py b/TheengsGateway/discovery.py index 69ca8c4a..7cd37bdf 100644 --- a/TheengsGateway/discovery.py +++ b/TheengsGateway/discovery.py @@ -214,14 +214,9 @@ def prepare_hadevice(self, uuid: str, device: dict) -> dict: """Prepare Home Assistant device configuration.""" return { "ids": [uuid], - "cns": [["mac", uuid]], "mf": device["brand"], "mdl": device["model_id"], - "name": device["model"] + "-" + uuid[6:], - "via_device": self.configuration.get( - "discovery_device_name", - "Unknown", - ), + "name": device["model"] + "-" + uuid[6:] } def build_state_topic(self, device: dict) -> str: From 2a98f50169606a300497e610f37ffa8fde218d05 Mon Sep 17 00:00:00 2001 From: kickouille <53976543+kickouille@users.noreply.github.com> Date: Mon, 10 Mar 2025 13:24:51 +0100 Subject: [PATCH 2/2] Revert back --- TheengsGateway/discovery.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TheengsGateway/discovery.py b/TheengsGateway/discovery.py index ef9144db..cc045f58 100644 --- a/TheengsGateway/discovery.py +++ b/TheengsGateway/discovery.py @@ -213,9 +213,14 @@ def prepare_hadevice(self, uuid: str, device: dict) -> dict: """Prepare Home Assistant device configuration.""" return { "ids": [uuid], + "cns": [["mac", uuid]], "mf": device["brand"], "mdl": device["model_id"], - "name": device["model"] + "-" + uuid[6:] + "name": device["model"] + "-" + uuid[6:], + "via_device": self.configuration.get( + "discovery_device_name", + "Unknown", + ), } def build_state_topic(self, device: dict) -> str: