This commit is contained in:
Vitor de Miranda Henrique
2017-03-03 00:37:45 -06:00
parent b5bff5f90b
commit ecdffcd589
2 changed files with 5 additions and 2 deletions

View File

@@ -165,7 +165,10 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin,
def handleFilamentDetection(self,channel):
if self._printer.is_printing():
if ~(self._settings.get(["filamentSensorActiveLow"]) ^ (not GPIO.input(self.filamentSensor.pinNumber))):
if self._settings.get(["filamentSensorActiveLow"]) and (not GPIO.input(self.filamentSensor.pinNumber)):
self._logger.info("Detected end of filament.")
self._printer.toggle_pause_print()
elif (not self._settings.get(["filamentSensorActiveLow"])) and GPIO.input(self.filamentSensor.pinNumber):
self._logger.info("Detected end of filament.")
self._printer.toggle_pause_print()

View File

@@ -14,7 +14,7 @@ plugin_package = "octoprint_enclosure"
plugin_name = "OctoPrint-Enclosure"
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.9"
plugin_version = "2.0"
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module