From aaff0813c1349aedb5616fc70d8d29533039cf54 Mon Sep 17 00:00:00 2001 From: imapping Date: Sun, 26 Feb 2023 09:24:28 +1300 Subject: [PATCH 1/2] Update __init__.py Adding reset of oldTrigger in read_sensor_multiple so it looks for ten consecutive values rather than waiting for ten of the original values. This was the cause of the log spamming. --- octoprint_filamentsensorsimplified/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/octoprint_filamentsensorsimplified/__init__.py b/octoprint_filamentsensorsimplified/__init__.py index 4668c4b..5af6908 100644 --- a/octoprint_filamentsensorsimplified/__init__.py +++ b/octoprint_filamentsensorsimplified/__init__.py @@ -385,6 +385,9 @@ def read_sensor_multiple(self, pin, power, trigger_mode): oldTrigger = newTrigger elif oldTrigger != newTrigger: x = 0 + # imapping: Adding reset of oldTrigger so it looks for ten consecutive values + # rather than waiting for ten of the original values. This was the cause of the log spamming. + oldTrigger = newTrigger # Commenting out this info log due to spamming the log file and filling up the memory quickly. # See https://github.com/LuckyX182/Filament_sensor_simplified/issues/64 #self._logger.info("Repeating sensor read due to false positives") From f162d80b1d74b32a785dc991aae27dda1d377e93 Mon Sep 17 00:00:00 2001 From: imapping Date: Wed, 1 Mar 2023 20:55:26 +1300 Subject: [PATCH 2/2] Fix indents --- octoprint_filamentsensorsimplified/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octoprint_filamentsensorsimplified/__init__.py b/octoprint_filamentsensorsimplified/__init__.py index 5af6908..c569d95 100644 --- a/octoprint_filamentsensorsimplified/__init__.py +++ b/octoprint_filamentsensorsimplified/__init__.py @@ -385,9 +385,9 @@ def read_sensor_multiple(self, pin, power, trigger_mode): oldTrigger = newTrigger elif oldTrigger != newTrigger: x = 0 - # imapping: Adding reset of oldTrigger so it looks for ten consecutive values - # rather than waiting for ten of the original values. This was the cause of the log spamming. - oldTrigger = newTrigger + # imapping: Adding reset of oldTrigger so it looks for ten consecutive values + # rather than waiting for ten of the original values. This was the cause of the log spamming. + oldTrigger = newTrigger # Commenting out this info log due to spamming the log file and filling up the memory quickly. # See https://github.com/LuckyX182/Filament_sensor_simplified/issues/64 #self._logger.info("Repeating sensor read due to false positives")