Skip to content

Commit

Permalink
fix: catch when serial header is on
Browse files Browse the repository at this point in the history
  • Loading branch information
GetPsyched committed Jan 17, 2024
1 parent 30d6cfe commit f70756a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charachorder/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def execute(self, *args: int | str) -> tuple[str, ...]:
self.connection.write(f"{command}\r\n".encode("utf-8"))
output = tuple(self.connection.readline().decode("utf-8").strip().split(" "))

# Drop serial header
if output[0] == "01":
output = output[1:]

if output[0] == "UKN":
raise UnknownCommand(command)

Expand Down

0 comments on commit f70756a

Please sign in to comment.