Skip to content

Commit 89cdf30

Browse files
committed
Export FixtureIDs only if not none
1 parent 0380c78 commit 89cdf30

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

pymvr/__init__.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ def __init__(
418418
gdtf_mode: Optional[str] = None,
419419
matrix: Optional[Matrix] = None,
420420
classing: Optional[str] = None,
421-
fixture_id: Optional[str] = "",
422-
fixture_id_numeric: int = 0,
423-
unit_number: int = 0,
424-
custom_id: int = 0,
425-
custom_id_type: int = 0,
421+
fixture_id: Optional[str] = None,
422+
fixture_id_numeric: Optional[int] = None,
423+
unit_number: Optional[int] = None,
424+
custom_id: Optional[int] = None,
425+
custom_id_type: Optional[int] = None,
426426
cast_shadow: bool = False,
427427
addresses: Optional["Addresses"] = None,
428428
alignments: Optional["Alignments"] = None,
@@ -572,12 +572,14 @@ def populate_xml(self, element: Element):
572572
if self.connections:
573573
self.connections.to_xml(element)
574574

575-
ElementTree.SubElement(element, "FixtureID").text = (
576-
str(self.fixture_id or "") or ""
577-
)
578-
ElementTree.SubElement(element, "FixtureIDNumeric").text = str(
579-
self.fixture_id_numeric
580-
)
575+
if self.fixture_id is not None:
576+
ElementTree.SubElement(element, "FixtureID").text = str(self.fixture_id)
577+
578+
if self.fixture_id_numeric is not None:
579+
ElementTree.SubElement(element, "FixtureIDNumeric").text = str(
580+
self.fixture_id_numeric
581+
)
582+
581583
if self.unit_number is not None:
582584
ElementTree.SubElement(element, "UnitNumber").text = str(self.unit_number)
583585
if self.custom_id_type is not None:

0 commit comments

Comments
 (0)