def __init__(self, **kwargs):
     self.modbus_port = self.phi_cfg.get('port')
     if not modbus.is_port(self.modbus_port):
         self.log_error('modbus port ID not specified or invalid')
         self.ready = False
         return
     try:
         self.unit_id = int(self.phi_cfg.get('unit'))
     except:
         self.log_error('modbus unit ID not specified or invalid')
         self.ready = False
         return
Exemple #2
0
 def __init__(self, **kwargs):
     self.port_max = 16
     self.modbus_port = self.phi_cfg.get('port')
     if not modbus.is_port(self.modbus_port):
         self.log_error('modbus port ID not specified or invalid')
         self.ready = False
         return
     try:
         self.addr = safe_int(self.phi_cfg.get('addr'))
     except:
         self.log_error('modbus addr not specified or invalid')
         self.ready = False
         return