From 60736081f7e84da03ce8d91a8541008180110413 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Fri, 18 Jul 2025 14:01:37 +0200 Subject: [PATCH 1/2] improve sdm smarhome logging --- packages/smarthome/smartmeas.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/smarthome/smartmeas.py b/packages/smarthome/smartmeas.py index 167c275a79..6dcb88692c 100644 --- a/packages/smarthome/smartmeas.py +++ b/packages/smarthome/smartmeas.py @@ -517,10 +517,10 @@ def sepwattread(self) -> Tuple[int, int]: _, newwatt = sdm630.get_power() self.newwatt = int(newwatt) self.newwattk = int(sdm630.get_imported()) - except Exception as e1: - log.warning("Leistungsmessung %s %d %s Fehlermeldung: %s " - % ('Sdm630 ', self.device_nummer, - str(self._device_measureip), str(e1))) + except Exception: + log.exception("Leistungsmessung %s %d %s Fehlermeldung: %s " + % ('Sdm630 ', self.device_nummer, + str(self._device_measureip))) return self.newwatt, self.newwattk @@ -537,8 +537,8 @@ def sepwattread(self) -> Tuple[int, int]: _, newwatt = sdm120.get_power() self.newwatt = int(newwatt) self.newwattk = int(sdm120.get_imported()) - except Exception as e1: - log.warning("Leistungsmessung %s %d %s Fehlermeldung: %s " - % ('Sdm120 ', self.device_nummer, - str(self._device_measureip), str(e1))) + except Exception: + log.exception("Leistungsmessung %s %d %s Fehlermeldung: %s " + % ('Sdm120 ', self.device_nummer, + str(self._device_measureip))) return self.newwatt, self.newwattk From 986702cb219899245490bab24b6c6fa4b3a58f87 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Fri, 18 Jul 2025 14:07:23 +0200 Subject: [PATCH 2/2] fix --- packages/smarthome/smartmeas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/smarthome/smartmeas.py b/packages/smarthome/smartmeas.py index 6dcb88692c..2d0e49839c 100644 --- a/packages/smarthome/smartmeas.py +++ b/packages/smarthome/smartmeas.py @@ -518,7 +518,7 @@ def sepwattread(self) -> Tuple[int, int]: self.newwatt = int(newwatt) self.newwattk = int(sdm630.get_imported()) except Exception: - log.exception("Leistungsmessung %s %d %s Fehlermeldung: %s " + log.exception("Leistungsmessung %s %d %s " % ('Sdm630 ', self.device_nummer, str(self._device_measureip))) return self.newwatt, self.newwattk @@ -538,7 +538,7 @@ def sepwattread(self) -> Tuple[int, int]: self.newwatt = int(newwatt) self.newwattk = int(sdm120.get_imported()) except Exception: - log.exception("Leistungsmessung %s %d %s Fehlermeldung: %s " + log.exception("Leistungsmessung %s %d %s " % ('Sdm120 ', self.device_nummer, str(self._device_measureip))) return self.newwatt, self.newwattk