From a65c3794d1249e344cb850c627a4ee0816e67030 Mon Sep 17 00:00:00 2001 From: "Bacher, Dominik" Date: Thu, 13 Jul 2023 19:22:37 +0200 Subject: [PATCH] remove ref_id from group_address --- test/resources/stubs/testprojekt-ets6-functions.json | 2 -- xknxproject/loader/project_loader.py | 5 +---- xknxproject/models/models.py | 1 - xknxproject/xml/parser.py | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/test/resources/stubs/testprojekt-ets6-functions.json b/test/resources/stubs/testprojekt-ets6-functions.json index 078db47..2dc87f6 100644 --- a/test/resources/stubs/testprojekt-ets6-functions.json +++ b/test/resources/stubs/testprojekt-ets6-functions.json @@ -108,7 +108,6 @@ "identifier": "P-05C0-0_GF-1", "name": "", "role": "SwitchOnOff", - "ref_id": "P-05C0-0_GA-1", "address": "0/0/1", "project_uid": 15 }, @@ -116,7 +115,6 @@ "identifier": "P-05C0-0_GF-2", "name": "", "role": "InfoOnOff", - "ref_id": "P-05C0-0_GA-2", "address": "0/0/2", "project_uid": 17 } diff --git a/xknxproject/loader/project_loader.py b/xknxproject/loader/project_loader.py index 7fe3985..542f8c0 100644 --- a/xknxproject/loader/project_loader.py +++ b/xknxproject/loader/project_loader.py @@ -308,16 +308,13 @@ def parse_functions(self, node: ElementTree.Element) -> XMLFunction: for sub_node in node: if sub_node.tag.endswith("GroupAddressRef"): project_uid = sub_node.get("Puid") - ref_id=sub_node.get("RefId", "") - - id=ref_id.split('_')[1] + id=sub_node.get("RefId", "").split('_')[1] address=[g for g in self.group_address_list if g.identifier == id][0].address group_address_ref: XMLGroupAddressRef = XMLGroupAddressRef( identifier=sub_node.get("Id"), # type: ignore[arg-type] name=sub_node.get("Name"), # type: ignore[arg-type] role=sub_node.get("Role", ""), - ref_id=ref_id, address=address, project_uid=int(project_uid) if project_uid else None, ) diff --git a/xknxproject/models/models.py b/xknxproject/models/models.py index a95e906..6bb6f50 100644 --- a/xknxproject/models/models.py +++ b/xknxproject/models/models.py @@ -295,7 +295,6 @@ class XMLGroupAddressRef: identifier: str name: str role: str - ref_id: str address: str project_uid: int | None diff --git a/xknxproject/xml/parser.py b/xknxproject/xml/parser.py index 85dee91..8ad9b13 100644 --- a/xknxproject/xml/parser.py +++ b/xknxproject/xml/parser.py @@ -176,7 +176,6 @@ def convert_group_address_ref( identifier=g.identifier, name=g.name, role=g.role, - ref_id=g.ref_id, address=g.address, project_uid=g.project_uid, )