add TRANSFER_DONE event callback to relist files on SD card after upload, #2
This commit is contained in:
		@@ -5,13 +5,15 @@ import threading
 | 
				
			|||||||
import time
 | 
					import time
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import octoprint.plugin
 | 
					import octoprint.plugin
 | 
				
			||||||
 | 
					from octoprint.events import Events
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .ftpsclient import IoTFTPSClient
 | 
					from .ftpsclient import IoTFTPSClient
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BambuPrintPlugin(
 | 
					class BambuPrintPlugin(octoprint.plugin.SettingsPlugin,
 | 
				
			||||||
    octoprint.plugin.SettingsPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.AssetPlugin
 | 
					                       octoprint.plugin.TemplatePlugin,
 | 
				
			||||||
):
 | 
					                       octoprint.plugin.AssetPlugin,
 | 
				
			||||||
 | 
					                       octoprint.plugin.EventHandlerPlugin):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_assets(self):
 | 
					    def get_assets(self):
 | 
				
			||||||
@@ -38,6 +40,9 @@ class BambuPrintPlugin(
 | 
				
			|||||||
                "always_use_default_options": False
 | 
					                "always_use_default_options": False
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def on_event(self, event, payload):
 | 
				
			||||||
 | 
					        if event == Events.TRANSFER_DONE:
 | 
				
			||||||
 | 
					            self._printer.commands("M20 L T", force=True)
 | 
				
			||||||
    def support_3mf_files(self):
 | 
					    def support_3mf_files(self):
 | 
				
			||||||
        return {'machinecode': {'3mf': ["3mf"]}}
 | 
					        return {'machinecode': {'3mf': ["3mf"]}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user