Skip to content

Commit b4c3598

Browse files
authored
fix condition pin is defined
added double quotes around the number, otherwise the condition is always true and it throws an exception on the octopi logs
1 parent 0a4f017 commit b4c3598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

octoprint_filamentreload/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def on_after_startup(self):
2424
self.bounce = int(self._settings.get(["bounce"]))
2525
self.switch = int(self._settings.get(["switch"]))
2626

27-
if self._settings.get(["pin"]) != -1: # If a pin is defined
27+
if self._settings.get(["pin"]) != "-1": # If a pin is defined
2828
self._logger.info("Filament Sensor active on GPIO Pin [%s]"%self.pin)
2929
GPIO.setup(self.pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Initialize GPIO as INPUT
3030

0 commit comments

Comments
 (0)