From 9da564c4b8906270b3bb21df892c0f566f098246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20M=C3=B6ller?= Date: Fri, 7 Apr 2023 19:05:04 +0200 Subject: [PATCH] model.base: make `String` the default `value_format` of `DataSpecificationIEC61360` --- basyx/aas/model/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index 20e8b8330..53b15a671 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -2152,7 +2152,7 @@ def __init__(self, unit_id: Optional[Reference] = None, source_of_definition: Optional[str] = None, symbol: Optional[str] = None, - value_format: Optional[DataTypeDefXsd] = None, + value_format: DataTypeDefXsd = datatypes.String, value_list: Optional[ValueList] = None, value: Optional[ValueDataType] = None, level_types: Iterable[IEC61360LevelType] = ()): @@ -2168,9 +2168,9 @@ def __init__(self, self._symbol: Optional[str] = symbol self.value_list: Optional[ValueList] = value_list self.level_types: Set[IEC61360LevelType] = set(level_types) - self.value_format: Optional[DataTypeDefXsd] = value_format - self._value: Optional[ValueDataType] = (datatypes.trivial_cast(value, self.value_format) - if (value is not None and self.value_format is not None) else None) + self.value_format: DataTypeDefXsd = value_format + self._value: Optional[ValueDataType] = datatypes.trivial_cast(value, self.value_format) if value is not None \ + else None @property def value(self):