From ecdffcd589d487bb1671a2f799ed372f5d4f4ec8 Mon Sep 17 00:00:00 2001 From: Vitor de Miranda Henrique Date: Fri, 3 Mar 2017 00:37:45 -0600 Subject: [PATCH] Bug Fix --- octoprint_enclosure/__init__.py | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index 0387eaf..2eabb76 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -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() diff --git a/setup.py b/setup.py index 658778e..ed4d3ad 100644 --- a/setup.py +++ b/setup.py @@ -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