diff --git a/src/peoplecounter.py b/src/peoplecounter.py index e3dc7e3..009eed1 100644 --- a/src/peoplecounter.py +++ b/src/peoplecounter.py @@ -1,5 +1,6 @@ from sensor.tofsensor import ToFSensor, Directions from datetime import datetime +import logging COUNTING_CB = "counting" @@ -35,9 +36,7 @@ class PeopleCounter (): while self.keepRunning: # Switch to other direction direction: Directions = Directions.other(direction) - print("-" * 20) - print("Direction:",direction) - print("At time",datetime.now()) + logging.debug(f'Direction [{direction}] at {datetime.now()}') self.sensor.setDirection(direction) @@ -48,7 +47,7 @@ class PeopleCounter (): if changed: countChange: int = self.getCountChange(self.directionState) self.handleCallbacks(countChange) - + self.sensor.close() def getCountChange(self, directionState) -> int: