[FR & PR idea] add host shutdown and reboot

I would like to initiate a host os shutdown and reboot on my displays.

As far as I can understand the code

configures the "Restart" menu.

So I have changed them to:

[menu __main __setup __restart]
type: list
name: Restart

[menu __main __setup __restart __host_restart]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Restart host
gcode: RESTART

[menu __main __setup __restart __firmware_restart]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Restart FW
gcode: FIRMWARE_RESTART

[menu __main __setup __restart __host_reboot]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Host reboot
gcode:
    {action_call_remote_method("reboot_machine")}

[menu __main __setup __restart __host_shutdown]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Host shutdown
gcode:
    {action_call_remote_method("shutdown_machine")}

Source: GitHub - docgalaxyblock/klipper at display-menu

And the result looks like this on a Voron_Hardware/V0-Display:


What are you Opinions on this submenu entries?
And would this code be PR ready?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.