vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
397 stars 202 forks source link

Output Feature: Shutdown on Serial Connection Error or Disconnect #439

Closed Dak0r closed 2 years ago

Dak0r commented 2 years ago

I added a toggle that allows to automatically turn off an output, when there was an error detected over the serial connection or a disconnect happened. The detection is based on the ERROR, DISCONNECTED and PRINTER_STATE_CHANGED Events from the EventPlugin. Error and disconnected always triggers the automatic turn off, PRINTER_STATE_CHANGED triggers it if the new state contains 'error'.

In the past my printer randomly disconnected during a print, which stopped all movement, but the heating elements were still running. So I use this feature to cut the power to my printer, if it for some reason disconnects during a print, as an additional security measure.

vitormhenrique commented 2 years ago

Thanks for the PR!