Skip to content

Commit

Permalink
add TRANSFER_DONE event callback to relist files on SD card after upl…
Browse files Browse the repository at this point in the history
…oad, #2
  • Loading branch information
jneilliii committed Feb 24, 2024
1 parent c110fa1 commit 616fdf7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions octoprint_bambu_printer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import time

import octoprint.plugin
from octoprint.events import Events

from .ftpsclient import IoTFTPSClient


class BambuPrintPlugin(
octoprint.plugin.SettingsPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.AssetPlugin
):
class BambuPrintPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.EventHandlerPlugin):


def get_assets(self):
Expand All @@ -38,6 +40,9 @@ def get_settings_defaults(self):
"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):
return {'machinecode': {'3mf': ["3mf"]}}

Expand Down

0 comments on commit 616fdf7

Please sign in to comment.