Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, portname, slaveaddress):
minimalmodbus.Instrument.__init__(self, portname, slaveaddress)
self.setpoint_max = SETPOINT_MAX
self.time_max = TIME_MAX
def __init__(self, portname, slaveaddress):
minimalmodbus.Instrument.__init__(self, portname, slaveaddress)
def __init__(self, serial_device, slave_address, debug=False, cache=True, retries=3):
"""Initialize the driver
Args:
serial_device (str): The serial device to use
slave_address (int): The address of the slave device
debug (bool): Whether debugging output from minimal modbus should be enabled
cache (bool): Whether system configuration values (which are expected not to
change within the runtime of the program) should be cached
"""
LOGGER.info('__init__ called, serial device: %s, slave address: %s',
serial_device, slave_address)
Instrument.__init__(self, serial_device, slave_address)
self.serial.baudrate = 9600
self.serial.stopbits = 2
self.serial.timeout = 2.0
self.retries = retries
# Variables
self.debug = debug
self.cache = cache
# Cache
self.system_conf = {}
self.channel_conf = {}
LOGGER.info('__init__ complete')