From e332ccc22adcdd5e4541fb546ef6997544e87447 Mon Sep 17 00:00:00 2001 From: alfrix Date: Mon, 1 Aug 2022 21:27:19 -0300 Subject: [PATCH] pins: assign initial value if configured fix #689 --- ks_includes/printer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ks_includes/printer.py b/ks_includes/printer.py index 35de86f0..34be81f3 100644 --- a/ks_includes/printer.py +++ b/ks_includes/printer.py @@ -316,7 +316,11 @@ class Printer: return speed def get_pin_value(self, pin): - return self.data[pin]["value"] if pin in self.data else 0 + if pin in self.data: + return self.data[pin]["value"] + elif pin in self.config and 'value' in self.config[pin]: + return self.config[pin]["value"] + return 0 def get_extruder_count(self): return self.extrudercount