Generic Heater Support

Adds the ability to register a custom/generic heater through a new extra called heater_generic.
This takes a gcode_id that is reported by M105. Adds a new command to set the temperature for any heater using the syntax:
SET_HEATER_TEMPERATURE HEATER=<heater_name> TARGET=<target_temp>

Signed-off-by: John Jardine <john@gprime.net>
This commit is contained in:
John Jardine 2019-02-14 01:15:11 +00:00
parent 805e56008f
commit 6316b2c1b6
4 changed files with 62 additions and 7 deletions

View file

@ -0,0 +1,16 @@
# Support for a generic heater
#
# Copyright (C) 2019 John Jardine <john@gprime.net>
#
# 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)