|
@@ -67,6 +67,11 @@ class Sink:
|
67
|
67
|
|
68
|
68
|
# Remove the echoed command and prompt
|
69
|
69
|
answer = answer[1:-1]
|
|
70
|
+
|
|
71
|
+ # Raise an exception if the command wasn't recognized
|
|
72
|
+ if len(answer) and answer[0] == cmd.strip().split()[0] + b" ?":
|
|
73
|
+ raise KeyError("command not found")
|
|
74
|
+
|
70
|
75
|
return answer
|
71
|
76
|
|
72
|
77
|
def close(self):
|
|
@@ -167,9 +172,6 @@ class Sink:
|
167
|
172
|
elif value[0] == b"disabled":
|
168
|
173
|
return False
|
169
|
174
|
else:
|
170
|
|
- # If the command is unknown to the Sink, raise a KeyError
|
171
|
|
- if value[0] == b"output ?":
|
172
|
|
- raise KeyError("command not found")
|
173
|
175
|
# If unexpected text is returned, raise an exception indicating a
|
174
|
176
|
# firmware error
|
175
|
177
|
raise ValueError("unknown output state")
|