heaters: Make heater.py an "extras" module
The heater logic is an independent module that does not need to be treated as part of the "core" klipper code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -19,12 +19,12 @@ class HomingHeaters:
|
||||
self.disable_heaters = []
|
||||
self.steppers_needing_quiet = config.get("steppers", "")
|
||||
self.flaky_steppers = []
|
||||
self.pheater = self.printer.lookup_object('heater')
|
||||
self.pheaters = self.printer.try_load_module(config, 'heaters')
|
||||
self.target_save = {}
|
||||
|
||||
def handle_connect(self):
|
||||
# heaters to disable
|
||||
all_heaters = self.pheater.get_all_heaters()
|
||||
all_heaters = self.pheaters.get_all_heaters()
|
||||
self.disable_heaters = [n.strip()
|
||||
for n in self.heaters_to_disable.split(',')]
|
||||
if self.disable_heaters == [""]:
|
||||
@@ -56,14 +56,14 @@ class HomingHeaters:
|
||||
if not self.check_eligible(endstops):
|
||||
return
|
||||
for heater_name in self.disable_heaters:
|
||||
heater = self.pheater.lookup_heater(heater_name)
|
||||
heater = self.pheaters.lookup_heater(heater_name)
|
||||
self.target_save[heater_name] = heater.get_temp(0)[1]
|
||||
heater.set_temp(0.)
|
||||
def handle_homing_move_end(self, endstops):
|
||||
if not self.check_eligible(endstops):
|
||||
return
|
||||
for heater_name in self.disable_heaters:
|
||||
heater = self.pheater.lookup_heater(heater_name)
|
||||
heater = self.pheaters.lookup_heater(heater_name)
|
||||
heater.set_temp(self.target_save[heater_name])
|
||||
|
||||
def load_config(config):
|
||||
|
||||
Reference in New Issue
Block a user