heater: Support generic gcode_id registration for sensors

Support reading a "gcode_id" parameter from heater/sensor config
sections.

Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Douglas Hammond
2019-02-25 22:30:13 -05:00
committed by Kevin O'Connor
parent 34209e6189
commit 3887ad4fce
4 changed files with 17 additions and 11 deletions

View File

@@ -4,13 +4,5 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging
class PrinterHeaterGeneric:
def __init__(self, config):
self.printer = config.get_printer()
gcode_id = config.get("gcode_id")
self.heater = self.printer.lookup_object('heater').setup_heater(config, gcode_id)
def load_config_prefix(config):
return PrinterHeaterGeneric(config)
return config.get_printer().lookup_object('heater').setup_heater(config)