Skip to content

Commit

Permalink
Merge pull request #715 from peterohman/patch-2
Browse files Browse the repository at this point in the history
Update hlpdatabms4s.py
  • Loading branch information
mr-manuel committed Jun 16, 2023
2 parents 84491bb + bffffdb commit d1c1ddd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions etc/dbus-serialbattery/bms/hlpdatabms4s.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,14 @@ def manage_charge_current(self):

def read_serial_data_HLPdataBMS4S(self, command, time, min_len):
data = read_serial_data(command, self.port, self.baud_rate, time, min_len)
if data is False:
return False
return data


def read_serial_data(command, port, baud, time, min_len):
try:
with serial.Serial(port, baudrate=baud, timeout=0.5) as ser:
ret = read_serialport_data(ser, command, time, min_len)
if ret is True:
return ret
return False
return ret

except serial.SerialException as e:
logger.error(e)
Expand Down

0 comments on commit d1c1ddd

Please sign in to comment.