From 1d62b16db53c41cebd79accaee690875a5178947 Mon Sep 17 00:00:00 2001 From: Gerd Wachsmuth Date: Mon, 9 Oct 2023 23:08:04 +0200 Subject: [PATCH] Use round instead of int --- luxtronik/datatypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luxtronik/datatypes.py b/luxtronik/datatypes.py index 9d74576..7f1cdec 100755 --- a/luxtronik/datatypes.py +++ b/luxtronik/datatypes.py @@ -138,7 +138,7 @@ def from_heatpump(cls, value): @classmethod def to_heatpump(cls, value): - raw = int(float(value) / cls.scaling_factor) + raw = round(float(value) / cls.scaling_factor) return raw @@ -299,7 +299,7 @@ def from_heatpump(cls, value): @classmethod def to_heatpump(cls, value): - return int((value - 1) * 2) + return round((value - 1) * 2) class Minutes(Base):