From e3024a3655e3a6d15ec46bc6004686709a204b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Carl=C3=A9n?= Date: Wed, 13 Aug 2025 21:41:11 +0200 Subject: [PATCH] Do not return RpiSerial for old RPI1Bs etc. - I had an old CW installation where a RPI1B was used. But we are only interested in CM10 meters. So, when returning the serial, make sure it's a CM. --- pycheckwatt/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pycheckwatt/__init__.py b/pycheckwatt/__init__.py index 69dea5f..2934e6c 100644 --- a/pycheckwatt/__init__.py +++ b/pycheckwatt/__init__.py @@ -1184,8 +1184,9 @@ def rpi_serial(self): if self.customer_details is not None: meters = self.customer_details.get("Meter", []) for meter in meters: - if "RpiSerial" in meter: - return meter["RpiSerial"].upper() + if "RpiSerial" in meter and "RpiModel" in meter: + if meter["RpiModel"].find('CM') == 0: + return meter["RpiSerial"].upper() _LOGGER.warning("Unable to find RPi Serial") return None