cameroncros / OctoPrint-DiscordRemote

Discord plugin for OctoPrint
MIT License
66 stars 34 forks source link

Notify when specifc gcodes are sent to the printer (e.g. M600) #249

Closed hcooper closed 1 year ago

hcooper commented 1 year ago

This PR adds the ability to be notified when specific gcodes are sent to the printer.

A common use case for this is detecting when the M600 (filament change) gcode is sent. It's common for the printers to not clearly identify to octoprint they're waiting for human input (i.e. they don't report as being "paused").

This change supporst any arbitrary gcode detection, not just M600.

This feature (or support for M600 generally) been requested in the past, e.g. https://github.com/cameroncros/OctoPrint-DiscordRemote/issues/165 & https://github.com/cameroncros/OctoPrint-DiscordRemote/issues/65

Setting page:

image

Example discord message:

image

cameroncros commented 1 year ago

This looks awesome, and I am happy to merge it, but I am doing a smallish re-write atm, so ideally I would like to merge it afterwards? If I dont complete this rewrite I will merge it asap.

hcooper commented 1 year ago

That's fine with me, no rush!

hcooper commented 8 months ago

Hi @cameroncros

It seems the changes to octoprint_discordremote/templates/discordremote_settings.jinja2 were picked up in v4.6.0 but have since been missing in all later version. I can't quite figure out why.

image

This means you can't configure which gcodes you want to be notified about in the settings UI.

cameroncros commented 8 months ago

Yeah, thats bizarre. I will investigate

hcooper commented 8 months ago

Thanks @cameroncros - it looks fixed in v5.10.0 :-)