klippy: No need to pass printer reference to add_printer_objects()

The config reference already stores a reference to the printer object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-07-12 22:26:32 -04:00
parent 5cdba1fda8
commit 7d897d84d7
6 changed files with 20 additions and 18 deletions

View file

@ -216,8 +216,8 @@ class ControlPID:
######################################################################
class PrinterHeaters:
def __init__(self, printer, config):
self.printer = printer
def __init__(self, config):
self.printer = config.get_printer()
self.sensors = {}
self.heaters = {}
def add_sensor(self, sensor_type, sensor_factory):
@ -249,5 +249,5 @@ class PrinterHeaters:
sensor_type,))
return self.sensors[sensor_type](config)
def add_printer_objects(printer, config):
printer.add_object('heater', PrinterHeaters(printer, config))
def add_printer_objects(config):
config.get_printer().add_object('heater', PrinterHeaters(config))