forked from CreatBot/CreatBotKlipperScreen
gcode_macros: add a panel for gcode macros
This commit is contained in:
@@ -85,6 +85,12 @@ name: Temperature
|
||||
icon: heat-up
|
||||
panel: temperature
|
||||
|
||||
[menu __main actions macros]
|
||||
name: Macros
|
||||
icon: custom-script
|
||||
panel: gcode_macros
|
||||
enable: {{ printer.gcode_macros.count > 0 }}
|
||||
|
||||
[menu __main actions power]
|
||||
name: Power
|
||||
icon: shutdown
|
||||
|
@@ -116,9 +116,15 @@ class Printer:
|
||||
def get_data(self):
|
||||
return self.data
|
||||
|
||||
def get_gcode_macros(self):
|
||||
return self.get_config_section_list("gcode_macro ")
|
||||
|
||||
def get_printer_status_data(self):
|
||||
data = {
|
||||
"printer": {
|
||||
"gcode_macros": {
|
||||
"count": len(self.get_gcode_macros())
|
||||
},
|
||||
"idle_timeout": self.get_stat("idle_timeout").copy(),
|
||||
"pause_resume": self.get_stat("pause_resume").copy(),
|
||||
"power_devices": {
|
||||
@@ -131,7 +137,7 @@ class Printer:
|
||||
for section in sections:
|
||||
if self.config_section_exists(section):
|
||||
data["printer"][section] = self.get_config_section(section).copy()
|
||||
|
||||
|
||||
return data
|
||||
|
||||
def get_klipper_version(self):
|
||||
|
Reference in New Issue
Block a user