From d75f383e5d8592606e5bbf63b4524def2064d79f Mon Sep 17 00:00:00 2001 From: bohdan-s Date: Wed, 5 Jan 2022 15:24:57 +1100 Subject: [PATCH] Add support for SG5K-D, SG8K-D; fix U32 values being read as U16, various bug fixes --- SunGather/exports/console.py | 2 +- SunGather/exports/mqtt.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SunGather/exports/console.py b/SunGather/exports/console.py index 741eaa5..c18f9d7 100644 --- a/SunGather/exports/console.py +++ b/SunGather/exports/console.py @@ -5,7 +5,7 @@ class export_console(object): return # Configure MQTT - def configure(self, config): + def configure(self, config, config_inverter): logging.info("Configured Console Logging") def publish(self, inverter): diff --git a/SunGather/exports/mqtt.py b/SunGather/exports/mqtt.py index d560288..00da598 100644 --- a/SunGather/exports/mqtt.py +++ b/SunGather/exports/mqtt.py @@ -11,7 +11,7 @@ class export_mqtt(object): self.update_model = True # Configure MQTT - def configure(self, config): + def configure(self, config, config_inverter): self.mqtt_client = mqtt.Client("pv_data") if config.get('username') and config.get('password'): @@ -35,7 +35,7 @@ class export_mqtt(object): global mqtt_client if (self.update_model): - self.sensor_topic = self.sensor_topic.replace('{model}', inverter.get('device_type_code', 'unknown').replace('.','')) + self.sensor_topic = self.sensor_topic.replace('{model}', inverter.get('device_type_code', 'unknown').replace('.','').replace('-','')) self.update_model = False if self.ha_discovery: