Skip to content

Commit

Permalink
remove ref_id from group_address
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacher, Dominik committed Jul 13, 2023
1 parent 4b679d9 commit a65c379
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions test/resources/stubs/testprojekt-ets6-functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,13 @@
"identifier": "P-05C0-0_GF-1",
"name": "",
"role": "SwitchOnOff",
"ref_id": "P-05C0-0_GA-1",
"address": "0/0/1",
"project_uid": 15
},
{
"identifier": "P-05C0-0_GF-2",
"name": "",
"role": "InfoOnOff",
"ref_id": "P-05C0-0_GA-2",
"address": "0/0/2",
"project_uid": 17
}
Expand Down
5 changes: 1 addition & 4 deletions xknxproject/loader/project_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
1 change: 0 additions & 1 deletion xknxproject/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ class XMLGroupAddressRef:
identifier: str
name: str
role: str
ref_id: str
address: str
project_uid: int | None

Expand Down
1 change: 0 additions & 1 deletion xknxproject/xml/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit a65c379

Please sign in to comment.