From 3acf9fc9681ed56caac12c6ba914c0173fe5d400 Mon Sep 17 00:00:00 2001 From: bohdan-s Date: Tue, 25 Jan 2022 20:44:34 +1100 Subject: [PATCH] fix type --- SunGather/sungather.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SunGather/sungather.py b/SunGather/sungather.py index 39ddfe9..5eec2fa 100644 --- a/SunGather/sungather.py +++ b/SunGather/sungather.py @@ -52,22 +52,22 @@ class SungrowInverter(): else: self.disconnect() - if self.config_inverter['connection'] == "http": + if self.inverter_config['connection'] == "http": self.client_config['port'] = '8082' self.client = SungrowModbusWebClient.SungrowModbusWebClient(**self.client_config) - elif self.config_inverter['connection'] == "sungrow": + elif self.config_inverter_configinverter['connection'] == "sungrow": self.client = SungrowModbusTcpClient.SungrowModbusTcpClient(**self.client_config) - elif self.config_inverter['connection'] == "modbus": + elif self.inverter_config['connection'] == "modbus": self.client = ModbusTcpClient(**self.client_config) else: - logging.warning(f"Inverter: Unknown connection type {self.config_inverter['connection']}, Valid options are http, sungrow or modbus") + logging.warning(f"Inverter: Unknown connection type {self.inverter_config['connection']}, Valid options are http, sungrow or modbus") return False logging.info("Connection: " + str(self.client)) retval = self.client.connect() # Wait 3 seconds, fixes timing issues time.sleep(3) - if not self.config_inverter['connection'] == "http": + if not self.inverter_config['connection'] == "http": self.client.close() return retval