diff --git a/extron.py b/extron.py index d929167..c0a8830 100644 --- a/extron.py +++ b/extron.py @@ -41,7 +41,7 @@ class ExtronSerial(SerialDevice): def send_command(self, command: str) -> str: response = super().send_command(command) - if response[0] == "E": + if response and response[0] == "E": print(response, self.ERRORS.get(response, "Unknown")) return response diff --git a/serialdevice.py b/serialdevice.py index da0c207..f7cd215 100644 --- a/serialdevice.py +++ b/serialdevice.py @@ -1,4 +1,4 @@ -from doctest import REPORT_CDIFF +import sys from serial import Serial @@ -27,7 +27,7 @@ class SerialDevice: response = "" if not response: - print(self.prefix, "No response") + print(self.prefix, "No response:", command, file=sys.stderr) elif self.verbose: print(self.prefix, "resp:", response)