Skip to content

Commit

Permalink
Additional Debugging Added
Browse files Browse the repository at this point in the history
  • Loading branch information
flip555 committed Feb 27, 2024
1 parent b5da6a3 commit b83b254
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/bms_connector/modules/bms/seplos/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ async def send_serial_commands(commands, port, baudrate=19200, timeout=2):

with serial.Serial(port, baudrate=baudrate, timeout=timeout) as ser:
for command in commands:
_LOGGER.debug(command)
_LOGGER.debug("Sending Modbus Command: %s", command)
ser.write(command.encode())
await asyncio.sleep(0.5)
responses.append(ser.read(ser.in_waiting).decode().replace('\r', '').replace('\n', ''))
_LOGGER.debug(responses)

_LOGGER.debug("Modbus Responses Received: %s", responses)

_LOGGER.debug("Final Modbus Responses Received: %s", responses)
return responses


Expand Down

0 comments on commit b83b254

Please sign in to comment.