led: Support setting display_template parameters via SET_LED_TEMPLATE

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2022-03-25 11:46:45 -04:00
parent 1ab3ac39e4
commit e6bfc4c9aa
3 changed files with 35 additions and 16 deletions

View File

@@ -39,6 +39,8 @@ class DisplayTemplate:
option, config.get_name()))
gcode_macro = self.printer.load_object(config, 'gcode_macro')
self.template = gcode_macro.load_template(config, 'text')
def get_params(self):
return self.params
def render(self, context, **kwargs):
params = dict(self.params)
params.update(**kwargs)