Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hlpdatabms4s.py #715

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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