CodingTheUnknown / OctoPrint-Tplinkautoshutdown

A plugin designed to be used within OctoPrint and OctoPi to control TP-Link kasa devices.
https://github.com/CodingTheUnknown/OctoPrint-Tplinkautoshutdown.git
9 stars 7 forks source link

Auto shutdown delay? #73

Open enz1ey opened 2 years ago

enz1ey commented 2 years ago

Just wanted to make a suggestion, I think adding a customizable/optional delay for auto shutdown would be useful. I have some cooling fans connected to my printer's PSU with a relay so they are triggered when a print completes and run for ten minutes to cool the bed down quicker. Obviously, when my TPLink plug is turned off upon print completion, the fan shuts off as well.

leftyfb commented 2 years ago

No, really. This needs to be a thing. My Prusa definitely does not like being aggressively shut down immediately when the tray is trying to set itself and fans aren't even spun down yet.

For now, I edit /home/pi/oprint/lib/python3.7/site-packages/octoprint_TpLinkAutoShutdown/init.py

added "import time" at the top

Add the following sleep statement:

            if event == "PrintDone":
                    time.sleep(10)
                    self.plugHandler()

SO much better experience!