|
@@ -131,11 +131,19 @@ class Sink:
|
131
|
131
|
|
132
|
132
|
def set_v(self, mv):
|
133
|
133
|
"""Sets the voltage of the configuration buffer, in millivolts"""
|
134
|
|
- self.send_command("set_v {}".format(mv))
|
|
134
|
+ out = self.send_command("set_v {}".format(mv))
|
|
135
|
+ # If that command gave any output, that indicates an error. Raise an
|
|
136
|
+ # exception to make that clear.
|
|
137
|
+ if len(out):
|
|
138
|
+ raise ValueError(out[0])
|
135
|
139
|
|
136
|
140
|
def set_i(self, ma):
|
137
|
141
|
"""Sets the current of the configuration buffer, in milliamperes"""
|
138
|
|
- self.send_command("set_i {}".format(ma))
|
|
142
|
+ out = self.send_command("set_i {}".format(ma))
|
|
143
|
+ # If that command gave any output, that indicates an error. Raise an
|
|
144
|
+ # exception to make that clear.
|
|
145
|
+ if len(out):
|
|
146
|
+ raise ValueError(out[0])
|
139
|
147
|
|
140
|
148
|
def identify(self):
|
141
|
149
|
"""Blinks the LED quickly"""
|