diff --git a/panels/input_shaper.py b/panels/input_shaper.py index de7a3612..d74f35ba 100644 --- a/panels/input_shaper.py +++ b/panels/input_shaper.py @@ -166,7 +166,9 @@ class Panel(ScreenPanel): # Recommended shaper_type_y = ei, shaper_freq_y = 48.4 Hz if 'recommended shaper_type_' in data: results = re.search(r'shaper_type_(?P[xy])\s*=\s*(?P.*?), shaper_freq_.\s*=\s*(' - r'?P[0-9.]+)', data).groupdict() + r'?P[0-9.]+)', data) + if results: + results.groupdict() self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq'])) self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type'])) if self.calibrating_axis == results['axis'] or (self.calibrating_axis == "both" and results['axis'] == 'y'): @@ -176,6 +178,8 @@ class Panel(ScreenPanel): # shaper_type_y:ei shaper_freq_y:48.400 damping_ratio_y:0.100000 if 'shaper_type_' in data: results = re.search(r'shaper_type_(?P[xy]):(?P.*?) shaper_freq_.:(' - r'?P[0-9.]+)', data).groupdict() + r'?P[0-9.]+)', data) + if results: + results.groupdict() self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq'])) self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type']))