From c6b1c0e03d5c7bf8b70af65b3f617bcbdd00ff63 Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 23 Dec 2025 22:16:25 +0100 Subject: [PATCH 1/3] Add properties for accessing the data field definitions In version 0.3.14, the definitions could be accessed via parameters/calculations/visibilities. --- luxtronik/calculations.py | 4 ++++ luxtronik/parameters.py | 4 ++++ luxtronik/visibilities.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/luxtronik/calculations.py b/luxtronik/calculations.py index 2c7ca9cf..d7151ca0 100755 --- a/luxtronik/calculations.py +++ b/luxtronik/calculations.py @@ -320,3 +320,7 @@ def __init__(self): 267: Celsius(["Desired_Room_Temperature", "Unknown_Calculation_267"]), 268: Power(["AC_Power_Input", "Unknown_Calculation_268"]), } + + @property + def calculations(self): + return self._data diff --git a/luxtronik/parameters.py b/luxtronik/parameters.py index e97e9395..8e8cbbcc 100755 --- a/luxtronik/parameters.py +++ b/luxtronik/parameters.py @@ -1207,6 +1207,10 @@ def __init__(self, safe=True): 1159: Unknown(["POWER_LIMIT_VALUE", "Unknown_Parameter_1159"]), } + @property + def parameters(self): + return self._data + def set(self, target, value): """Set parameter to new value.""" index, parameter = self._lookup(target, with_index=True) diff --git a/luxtronik/visibilities.py b/luxtronik/visibilities.py index 5b338270..bbdac487 100755 --- a/luxtronik/visibilities.py +++ b/luxtronik/visibilities.py @@ -397,3 +397,7 @@ def __init__(self): 378: Unknown(["Unknown_Visibility_378", "Unknown_Parameter_378"]), 379: Unknown(["Unknown_Visibility_379", "Unknown_Parameter_379"]), } + + @property + def visibilities(self): + return self._data From a71a292f11fbe695e16172fdc0cd32f4cf77245e Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 23 Dec 2025 22:19:44 +0100 Subject: [PATCH 2/3] Emulate the ID_WEB_SoftStand field from version 0.3.14 --- luxtronik/__init__.py | 2 +- luxtronik/calculations.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/luxtronik/__init__.py b/luxtronik/__init__.py index 4cb9fb0e..a1fa7181 100755 --- a/luxtronik/__init__.py +++ b/luxtronik/__init__.py @@ -63,7 +63,7 @@ def __init__(self, parameters=None, calculations=None, visibilities=None, safe=T self.visibilities = Visibilities() if visibilities is None else visibilities def get_firmware_version(self): - return "".join([self.calculations.get(i).value for i in range(81, 91)]) + return self.calculations.get_firmware_version() class LuxtronikSocketInterface: diff --git a/luxtronik/calculations.py b/luxtronik/calculations.py index d7151ca0..4119f2c4 100755 --- a/luxtronik/calculations.py +++ b/luxtronik/calculations.py @@ -5,6 +5,7 @@ from luxtronik.data_vector import DataVector from luxtronik.datatypes import ( + Base, BivalenceLevel, Bool, Celsius, @@ -324,3 +325,21 @@ def __init__(self): @property def calculations(self): return self._data + + 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)]) + + def _get_firmware_version(self): + """Get the firmware version as string like in previous versions.""" + return self.get_firmware_version().strip("\x00") + + def get(self, target): + """Treats certain names specially. For all others, the function of the base class is called.""" + if target == "ID_WEB_SoftStand": + self.logger.debug("The name 'ID_WEB_SoftStand' is obsolete! Use 'get_firmware_version()' instead.") + entry = Base("ID_WEB_SoftStand") + entry.raw = self._get_firmware_version() + return entry + else: + return super().get(target) From 46b743e268d7a96d9549789cb01783d79810e8b5 Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Tue, 23 Dec 2025 22:21:17 +0100 Subject: [PATCH 3/3] Ensure that only integer values are written to the parameter queue. --- luxtronik/parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luxtronik/parameters.py b/luxtronik/parameters.py index 8e8cbbcc..77b57ef2 100755 --- a/luxtronik/parameters.py +++ b/luxtronik/parameters.py @@ -1216,7 +1216,7 @@ def set(self, target, value): index, parameter = self._lookup(target, with_index=True) if index is not None: if parameter.writeable or not self.safe: - self.queue[index] = parameter.to_heatpump(value) + self.queue[index] = int(parameter.to_heatpump(value)) else: self.logger.warning("Parameter '%s' not safe for writing!", parameter.name) else: