mirror of https://github.com/Desuuuu/klipper.git
endstop_phase: Use config.getintlist() for trigger_phase config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
58dedb6b16
commit
7f82dcb442
|
@ -67,11 +67,7 @@ class EndstopPhase:
|
||||||
self.endstop_phase = None
|
self.endstop_phase = None
|
||||||
trigger_phase = config.get('trigger_phase', None)
|
trigger_phase = config.get('trigger_phase', None)
|
||||||
if trigger_phase is not None:
|
if trigger_phase is not None:
|
||||||
try:
|
p, ps = config.getintlist('trigger_phase', sep='/', count=2)
|
||||||
p, ps = [int(v.strip()) for v in trigger_phase.split('/')]
|
|
||||||
except:
|
|
||||||
raise config.error("Unable to parse trigger_phase '%s'"
|
|
||||||
% (trigger_phase,))
|
|
||||||
if p >= ps:
|
if p >= ps:
|
||||||
raise config.error("Invalid trigger_phase '%s'"
|
raise config.error("Invalid trigger_phase '%s'"
|
||||||
% (trigger_phase,))
|
% (trigger_phase,))
|
||||||
|
|
Loading…
Reference in New Issue