|
@@ -152,8 +152,8 @@ class Sink:
|
152
|
152
|
def output(self, state=None):
|
153
|
153
|
"""Gets or sets the state of a Sink's output
|
154
|
154
|
|
155
|
|
- If an invalid output is read, raises ValueError. This may indicate
|
156
|
|
- that the firmware does not support the ``output`` command.
|
|
155
|
+ Raises KeyError if the ``output`` command is not available on the Sink.
|
|
156
|
+ Raises ValueError if an invalid output is read.
|
157
|
157
|
|
158
|
158
|
:param state: optional value of the output to set
|
159
|
159
|
|
|
@@ -167,6 +167,9 @@ class Sink:
|
167
|
167
|
elif value[0] == b"disabled":
|
168
|
168
|
return False
|
169
|
169
|
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")
|
170
|
173
|
# If unexpected text is returned, raise an exception indicating a
|
171
|
174
|
# firmware error
|
172
|
175
|
raise ValueError("unknown output state")
|