Test modbus_tcp (#179)

* add more unit tests
This commit is contained in:
Stefan Allius
2024-08-30 20:40:53 +02:00
committed by GitHub
parent 1bb08fb211
commit 627ca97360
2 changed files with 179 additions and 13 deletions

View File

@@ -38,7 +38,9 @@ class ModbusConn():
class ModbusTcp():
def __init__(self, loop) -> None:
def __init__(self, loop, tim_restart=10) -> None:
self.tim_restart = tim_restart
inverters = Config.get('inverters')
# logging.info(f'Inverters: {inverters}')
@@ -79,4 +81,4 @@ class ModbusTcp():
f"ModbusTcpCreate: Exception for {(host, port)}:\n"
f"{traceback.format_exc()}")
await asyncio.sleep(10)
await asyncio.sleep(self.tim_restart)