add support for M355 command to control chamber light, #67
This commit is contained in:
		@@ -596,6 +596,17 @@ class BambuVirtualPrinter:
 | 
			
		||||
        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()
 | 
			
		||||
 
 | 
			
		||||
@@ -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("");
 | 
			
		||||
@@ -133,7 +143,7 @@ $(function () {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        self.onAfterBinding = function () {
 | 
			
		||||
            console.log(self.ams_mapping_computed());
 | 
			
		||||
            // console.log(self.ams_mapping_computed());
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        self.showTimelapseThumbnail = function(data) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
									
									
									
									
								
							@@ -14,7 +14,7 @@ plugin_package = "octoprint_bambu_printer"
 | 
			
		||||
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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user