Skip to content
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: 3 additions & 3 deletions dbus-serialbattery/bms/jkbms_pb.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_settings(self):
# Set the current limits, populate cell count, etc
# Return True if success, False for failure
status_data = self.read_serial_data_jkbms_pb(self.command_settings, 300)
if status_data is False:
if not status_data:
return False

VolSmartSleep = unpack_from("<i", status_data, 6)[0] / 1000
Expand Down Expand Up @@ -175,7 +175,7 @@ def refresh_data(self):
def read_status_data(self):
status_data = self.read_serial_data_jkbms_pb(self.command_status, 299)
# check if connection success
if status_data is False:
if not status_data:
return False

# logger.error("sucess we have data")
Expand Down Expand Up @@ -356,7 +356,7 @@ def read_serial_data_jkbms_pb(self, command: str, length: int) -> bool:
self.LENGTH_SIZE, # ignored
battery_online=self.online,
)
if data is False:
if not data:
return False

# be = ''.join(format(x, ' 02X') for x in data)
Expand Down