From 704c15d67c5d5eb484c5ddb42089c4d621b02193 Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 3 Mar 2026 22:13:06 +0100 Subject: [PATCH 1/4] Reorder the imports in shi/interface.py --- luxtronik/shi/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luxtronik/shi/interface.py b/luxtronik/shi/interface.py index 689bd312..202d6461 100644 --- a/luxtronik/shi/interface.py +++ b/luxtronik/shi/interface.py @@ -2,8 +2,8 @@ import logging -from luxtronik.collections import get_data_arr from luxtronik.common import classproperty, version_in_range +from luxtronik.collections import get_data_arr from luxtronik.datatypes import Base from luxtronik.definitions import ( LuxtronikDefinition, From 1f68ed19824f3673cbec024d9fe1ccc0cf310698 Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 3 Mar 2026 22:15:04 +0100 Subject: [PATCH 2/4] Compare the byte values instead the user values within the Base datatype --- luxtronik/datatypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luxtronik/datatypes.py b/luxtronik/datatypes.py index 16c06bc4..f88c331e 100755 --- a/luxtronik/datatypes.py +++ b/luxtronik/datatypes.py @@ -93,7 +93,7 @@ def __repr__(self): f"name: {self.name}, " f"writeable: {self.writeable}, " f"value: {self.value}, " - f"raw: {self._raw}, " + f"raw: {self.raw}, " f"write_pending: {self.write_pending}, " f"class: {self.datatype_class}, " f"unit: {self.datatype_unit}" @@ -115,7 +115,7 @@ def __eq__(self, other): return False return ( - self.value == other.value + self._raw == other._raw and self.datatype_class == other.datatype_class and self.datatype_unit == other.datatype_unit ) @@ -124,7 +124,7 @@ def __lt__(self, other): """Compares two datatype objects and returns which one contains the lower value""" return ( - self.value < other.value + self._raw < other._raw and self.datatype_class == other.datatype_class and self.datatype_unit == other.datatype_unit ) From a20e271e24363217239e465bd4c78e2669f6533e Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 3 Mar 2026 22:15:52 +0100 Subject: [PATCH 3/4] Check that only parameters are written within the config-interface --- luxtronik/cfi/interface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/luxtronik/cfi/interface.py b/luxtronik/cfi/interface.py index 01007831..233d7f34 100644 --- a/luxtronik/cfi/interface.py +++ b/luxtronik/cfi/interface.py @@ -162,6 +162,9 @@ def _write_and_read(self, parameters, data): return self._read(data) def _write(self, parameters): + if not isinstance(parameters, Parameters): + LOGGER.error("Only parameters are writable!") + return for definition, field in parameters.items(): if field.write_pending: field.write_pending = False From df3edb4977d896f3333b1a49183e9a880af8575f Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 3 Mar 2026 22:17:10 +0100 Subject: [PATCH 4/4] Convert the firmware characters to a string before using join join([None]) results in an exception --- luxtronik/cfi/calculations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luxtronik/cfi/calculations.py b/luxtronik/cfi/calculations.py index 752fa29c..8412b9d9 100644 --- a/luxtronik/cfi/calculations.py +++ b/luxtronik/cfi/calculations.py @@ -33,7 +33,7 @@ class Calculations(DataVectorConfig): def get_firmware_version(self): """Get the firmware version as string.""" - return "".join([super(Calculations, self).get(i).value for i in range(81, 91)]) + return "".join([str(super(Calculations, self).get(i).value) for i in range(81, 91)]) def _get_firmware_version(self): """Get the firmware version as string like in previous versions."""