Exemplo n.º 1
0
    def __init__(self, host, port, cooler_count):
        ModbusClient.__init__(self, host=host, port=port, auto_open=True)
        Thread.__init__(self)

        self._host = host
        self._port = port
        self.coolers = [Cooler(c) for c in range(1, cooler_count+1)]
        # Modbus
        self.timeout(5)
        self.running = False
Exemplo n.º 2
0
 def __init__(self, p="localhost"):
     logger = logging.getLogger(MAIN + ".InverterSETCP.__init__")
     logger.setLevel(logging.DEBUG)
     Inverter.__init__(self)
     OEM_SE.__init__(self)
     self.PlimFun = None
     try:
         ModbusClient.__init__(self, p, port=SERVER_PORT)
         self.IP = p
         self.cerror = 0
     except ValueError:
         logger.error("Init inverter non riuscito p=" + p)
         self.IP = ""
         self.cerror = 1
 def __init__(self, host=SERVER_HOST, port=SERVER_PORT, *args, **kwargs):
     ModbusClient.__init__(self, host, port, *args, **kwargs)