Skip to content

Commit

Permalink
print out response in test_modbus.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MadOne committed Jan 21, 2025
1 parent 9ef99a8 commit 0687b85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/weishaupt_modbus/test_modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async def main(): # noqa: D103
rr = await client.read_coils(register, 1, slave=1)
if len(rr.registers) > 0:
val = rr.registers[0]
print(rr)
except ModbusException as exc:
val = exc
print(val)
Expand All @@ -48,8 +49,10 @@ async def main(): # noqa: D103
writeit = False
try:
rr = await client.read_coils(register, 1, slave=1)
print(rr)
except ModbusException as exc:
val = exc
print(val)
if rr.isError() or isinstance(rr, ExceptionResponse):
val = rr
writeit = False
Expand All @@ -66,8 +69,10 @@ async def main(): # noqa: D103
writeit = False
try:
rr = await client.read_input_registers(register, slave=1)
print(rr)
except ModbusException as exc:
val = exc
print(val)
if rr.isError() or isinstance(rr, ExceptionResponse):
val = rr
writeit = False
Expand All @@ -84,8 +89,10 @@ async def main(): # noqa: D103
writeit = False
try:
rr = await client.read_holding_registers(register, slave=1)
print(rr)
except ModbusException as exc:
val = exc
print(val)
if rr.isError() or isinstance(rr, ExceptionResponse):
val = rr
writeit = False
Expand Down

0 comments on commit 0687b85

Please sign in to comment.