Skip to content

Commit

Permalink
Clarify lack of coverage for reader _cmd method
Browse files Browse the repository at this point in the history
  • Loading branch information
benthorner authored and avaldebe committed Nov 8, 2022
1 parent cdea18e commit 9466171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pms/core/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ def __init__(
f"from {port} every {interval if interval else '?'} secs"
)

def _cmd(self, command: str) -> bytes: # pragma: no cover
def _cmd(self, command: str) -> bytes:
"""Write command to sensor and return answer"""

# send command
cmd = self.sensor.command(command)
if cmd.command:
self.serial.write(cmd.command)
self.serial.flush()
elif command.endswith("read"):
elif command.endswith("read"): # pragma: no cover
self.serial.reset_input_buffer()

# return full buffer
Expand Down

0 comments on commit 9466171

Please sign in to comment.