Skip to content

Commit

Permalink
add support for M355 command to control chamber light, #67
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Jan 24, 2025
1 parent ca30e0f commit 8af0f9e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions octoprint_bambu_printer/printer/bambu_virtual_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,17 @@ def _pause_print(self):
self._current_state.pause_print()
return True

@gcode_executor.register("M355")
def _case_lights(self, data: str) -> bool:
if data == "M355 S1":
light_command = commands.CHAMBER_LIGHT_ON
elif data == "M355 S0":
light_command = commands.CHAMBER_LIGHT_OFF
else:
return False

return self.bambu_client.publish(light_command)

@gcode_executor.register("M524")
def _cancel_print(self):
self._current_state.cancel_print()
Expand Down
12 changes: 11 additions & 1 deletion octoprint_bambu_printer/static/js/bambu_printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ $(function () {
return output_list;
};

self.getAdditionalControls = function() {
var buttons = [
{ name: "Bambu", type: "section", layout: "horizontal", children: [
{type: "command", name: "Light On", enabled: "true", command: "M355 S1"},
{type: "command", name: "Light Off", enabled: "true", command: "M355 S0"}
]}
];
return buttons;
};

self.getAuthToken = function (data) {
self.settingsViewModel.settings.plugins.bambu_printer.auth_token("");
self.auth_type("");
Expand Down Expand Up @@ -133,7 +143,7 @@ $(function () {
};

self.onAfterBinding = function () {
console.log(self.ams_mapping_computed());
// console.log(self.ams_mapping_computed());
};

self.showTimelapseThumbnail = function(data) {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-BambuPrinter"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.1.8rc14"
plugin_version = "0.1.8rc15"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 8af0f9e

Please sign in to comment.