klippy: Rename try_load_module() to load_object()
Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -17,7 +17,7 @@ class TemperatureFan:
|
||||
self.fan = fan.PrinterFan(config, default_shutdown_speed=1.)
|
||||
self.min_temp = config.getfloat('min_temp', minval=KELVIN_TO_CELSIUS)
|
||||
self.max_temp = config.getfloat('max_temp', above=self.min_temp)
|
||||
pheaters = self.printer.try_load_module(config, 'heaters')
|
||||
pheaters = self.printer.load_object(config, 'heaters')
|
||||
self.sensor = pheaters.setup_sensor(config)
|
||||
self.sensor.setup_minmax(self.min_temp, self.max_temp)
|
||||
self.sensor.setup_callback(self.temperature_callback)
|
||||
|
||||
Reference in New Issue
Block a user