pytec: narrow down exception catching range
This commit is contained in:
parent
bfcb91d2c0
commit
9e215830aa
|
@ -246,18 +246,19 @@ def main():
|
||||||
try:
|
try:
|
||||||
ch = data[channel]
|
ch = data[channel]
|
||||||
|
|
||||||
temperature = ch['temperature']
|
# Sometimes report_mode may yeild empty object
|
||||||
|
|
||||||
if (tuner.run(temperature, ch['time'])):
|
|
||||||
break
|
|
||||||
|
|
||||||
tuner_out = tuner.output()
|
|
||||||
|
|
||||||
tec.set_param("pwm", channel, "i_set", tuner_out)
|
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
temperature = ch['temperature']
|
||||||
|
|
||||||
|
if (tuner.run(temperature, ch['time'])):
|
||||||
|
break
|
||||||
|
|
||||||
|
tuner_out = tuner.output()
|
||||||
|
|
||||||
|
tec.set_param("pwm", channel, "i_set", tuner_out)
|
||||||
|
|
||||||
tec.set_param("pwm", channel, "i_set", 0)
|
tec.set_param("pwm", channel, "i_set", 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue