Skip to content

Commit

Permalink
False positives fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyx182 committed Oct 19, 2020
1 parent 8aba047 commit e288025
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions octoprint_filamentsensorsimplified/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,16 @@ def on_event(self, event, payload):
self.printing = False

def sensor_callback(self, _):
sleep(1)
self._logger.info("Sensor was triggered")
if not self.changing_filament_initiated:
self.send_out_of_filament()
trigger = True
for x in range(0, 5):
sleep(0.05)
if not self.no_filament():
trigger = False

if trigger:
self._logger.info("Sensor was triggered")
if not self.changing_filament_initiated:
self.send_out_of_filament()

def send_out_of_filament(self):
self.show_printer_runout_popup()
Expand Down

0 comments on commit e288025

Please sign in to comment.