From 532168e1eb6290593ece92421e34f5dfbe6ca8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Sat, 14 May 2022 19:51:47 +0200 Subject: [PATCH] Allow disable mqtt --- tools/rpi/hoymiles/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rpi/hoymiles/__main__.py b/tools/rpi/hoymiles/__main__.py index 6e46a3a9..0a8c435e 100644 --- a/tools/rpi/hoymiles/__main__.py +++ b/tools/rpi/hoymiles/__main__.py @@ -236,7 +236,7 @@ if __name__ == '__main__': # # Enables and subscribe inverter to mqtt /command-Topic # - if inverter.get('mqtt', {}).get('send_raw_enabled', False): + if mqtt_client and inverter.get('mqtt', {}).get('send_raw_enabled', False): topic_item = ( str(inverter_ser), inverter.get('mqtt', {}).get('topic', f'hoymiles/{inverter_ser}') + '/command'