pytec: narrow down exception catching range

pull/41/head
topquark12 2021-01-06 10:25:44 +08:00
parent bfcb91d2c0
commit 9e215830aa
1 changed files with 10 additions and 9 deletions

View File

@ -246,6 +246,10 @@ def main():
try:
ch = data[channel]
# Sometimes report_mode may yeild empty object
except KeyError:
pass
temperature = ch['temperature']
if (tuner.run(temperature, ch['time'])):
@ -255,9 +259,6 @@ def main():
tec.set_param("pwm", channel, "i_set", tuner_out)
except KeyError:
pass
tec.set_param("pwm", channel, "i_set", 0)