From 6849977980e9df3033fcc4f69b88c145902b2cdf Mon Sep 17 00:00:00 2001 From: joejose97 <45399349+joejose97@users.noreply.github.com> Date: Fri, 2 Jan 2026 14:49:29 +0530 Subject: [PATCH 1/2] add value property referred parts of code. This was removed in 598fe3744c95759e44fff061b7e8de1d5f7abbc2 --- berrybms/Register.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/berrybms/Register.py b/berrybms/Register.py index 5377814..0afe494 100644 --- a/berrybms/Register.py +++ b/berrybms/Register.py @@ -35,6 +35,14 @@ def __init__(self, self.length = length self.values[name] = None + @property + def value(self): + return self.values[self.name] + + @value.setter + def value(self, val): + self.values[self.name] = val + def getValue(self, c, reload=False): if reload == True: From dd8fc7d662109367d05ed3cb4ca93c85393d1081 Mon Sep 17 00:00:00 2001 From: joejose97 <45399349+joejose97@users.noreply.github.com> Date: Fri, 2 Jan 2026 14:50:11 +0530 Subject: [PATCH 2/2] Check if conext is present before running. --- berrybms/berrybms.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/berrybms/berrybms.py b/berrybms/berrybms.py index d342d1f..2b26dc7 100644 --- a/berrybms/berrybms.py +++ b/berrybms/berrybms.py @@ -137,26 +137,27 @@ def main(daemon): # We start our Xanbus sniffer thread after polling (if enabled) the # InsightHome as it'll update properly populated data structures from there - if config['conext'].get('xanbus_sniffer', None) != None: - if xanbus_sniffer == None: - xanbus_sniffer = XanbusSniffer(config, logger) - xanbus_sniffer_thread = threading.Thread(target=xanbus_sniffer.sniff, daemon=False) - xanbus_sniffer_thread.start() - print("Started Xanbus sniffer thread!") - - if config['conext']['insighthome'] != None: - conext = ConextInsightHome(config['conext']['insighthome']['host'], - config['conext']['insighthome']['port'], - config['conext']['insighthome'].get('ids', None), - config['conext'].get('serial_number_hack', None)) - all_modbus_devices.append(conext) - c = conext.connect() - devices = conext.allDevices() - for device in devices: - device.publish(all_devices) - #print("%s: %s\n" % (type(device).__name__, device)) - #device.dump() - print(device.formattedOutput(),'\n') + if config.get('conext') is not None: + if config['conext'].get('xanbus_sniffer', None) != None: + if xanbus_sniffer == None: + xanbus_sniffer = XanbusSniffer(config, logger) + xanbus_sniffer_thread = threading.Thread(target=xanbus_sniffer.sniff, daemon=False) + xanbus_sniffer_thread.start() + print("Started Xanbus sniffer thread!") + + if config['conext']['insighthome'] != None: + conext = ConextInsightHome(config['conext']['insighthome']['host'], + config['conext']['insighthome']['port'], + config['conext']['insighthome'].get('ids', None), + config['conext'].get('serial_number_hack', None)) + all_modbus_devices.append(conext) + c = conext.connect() + devices = conext.allDevices() + for device in devices: + device.publish(all_devices) + #print("%s: %s\n" % (type(device).__name__, device)) + #device.dump() + print(device.formattedOutput(),'\n') # Publish all values in MQTT if paho_client != None: