Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
f37eadf3ea | |||
48027f6008 | |||
616fdf7a82 | |||
c110fa140a |
14
README.md
14
README.md
@ -1,17 +1,11 @@
|
|||||||
# OctoPrint-BambuPrinter
|
# OctoPrint-BambuPrinter
|
||||||
|
|
||||||
**TODO:** Describe what your plugin does.
|
## System Requirements
|
||||||
|
|
||||||
|
* Python 3.9 or higher (OctoPi 1.0.0)
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
Install via the bundled [Plugin Manager](https://docs.octoprint.org/en/master/bundledplugins/pluginmanager.html)
|
Install manually using this URL:
|
||||||
or manually using this URL:
|
|
||||||
|
|
||||||
https://github.com/jneilliii/OctoPrint-BambuPrinter/archive/master.zip
|
https://github.com/jneilliii/OctoPrint-BambuPrinter/archive/master.zip
|
||||||
|
|
||||||
**TODO:** Describe how to install your plugin, if more needs to be done than just installing it via pip or through
|
|
||||||
the plugin manager.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
**TODO:** Describe your plugin's configuration options (if any).
|
|
||||||
|
@ -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"]}}
|
||||||
|
|
||||||
|
@ -160,6 +160,8 @@ class BambuPrinter:
|
|||||||
fans = device_data.fans.__dict__
|
fans = device_data.fans.__dict__
|
||||||
speed = device_data.speed.__dict__
|
speed = device_data.speed.__dict__
|
||||||
|
|
||||||
|
# self._logger.debug(device_data)
|
||||||
|
|
||||||
self.temp[0] = temperatures.get("nozzle_temp", 0.0)
|
self.temp[0] = temperatures.get("nozzle_temp", 0.0)
|
||||||
self.targetTemp[0] = temperatures.get("target_nozzle_temp", 0.0)
|
self.targetTemp[0] = temperatures.get("target_nozzle_temp", 0.0)
|
||||||
self.bedTemp = temperatures.get("bed_temp", 0.0)
|
self.bedTemp = temperatures.get("bed_temp", 0.0)
|
||||||
@ -679,8 +681,8 @@ class BambuPrinter:
|
|||||||
filename = entry[1:].replace("cache/", "")
|
filename = entry[1:].replace("cache/", "")
|
||||||
else:
|
else:
|
||||||
filename = entry.replace("cache/", "")
|
filename = entry.replace("cache/", "")
|
||||||
filesize = ftp.ftps_session.size(entry)
|
filesize = ftp.ftps_session.size(f"cache/{filename}")
|
||||||
date_str = ftp.ftps_session.sendcmd(f"MDTM {entry}").replace("213 ", "")
|
date_str = ftp.ftps_session.sendcmd(f"MDTM cache/{filename}").replace("213 ", "")
|
||||||
filedate = datetime.datetime.strptime(date_str, "%Y%m%d%H%M%S").replace(tzinfo=datetime.timezone.utc).timestamp()
|
filedate = datetime.datetime.strptime(date_str, "%Y%m%d%H%M%S").replace(tzinfo=datetime.timezone.utc).timestamp()
|
||||||
dosname = get_dos_filename(filename, existing_filenames=list(result.keys())).lower()
|
dosname = get_dos_filename(filename, existing_filenames=list(result.keys())).lower()
|
||||||
data = {
|
data = {
|
||||||
@ -711,8 +713,12 @@ class BambuPrinter:
|
|||||||
|
|
||||||
file = self._getSdFileData(filename)
|
file = self._getSdFileData(filename)
|
||||||
if file is None:
|
if file is None:
|
||||||
self._send(f"{filename} open failed")
|
self._listSd(incl_long=True, incl_timestamp=True)
|
||||||
return
|
self._sendOk()
|
||||||
|
file = self._getSdFileData(filename)
|
||||||
|
if file is None:
|
||||||
|
self._send(f"{filename} open failed")
|
||||||
|
return
|
||||||
|
|
||||||
if self._selectedSdFile == file["path"] and check_already_open:
|
if self._selectedSdFile == file["path"] and check_already_open:
|
||||||
return
|
return
|
||||||
|
2
setup.py
2
setup.py
@ -14,7 +14,7 @@ plugin_package = "octoprint_bambu_printer"
|
|||||||
plugin_name = "OctoPrint-BambuPrinter"
|
plugin_name = "OctoPrint-BambuPrinter"
|
||||||
|
|
||||||
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
||||||
plugin_version = "0.0.14"
|
plugin_version = "0.0.16"
|
||||||
|
|
||||||
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
||||||
# module
|
# module
|
||||||
|
Reference in New Issue
Block a user