Fixed import error

This commit is contained in:
Maximilian Giller 2024-02-15 21:45:28 +01:00
parent aefa0fa683
commit e6c15732ce

View file

@ -1,23 +1,22 @@
from ..sensors.tof_sensor import Directions
from ..sensors.people_counter import PeopleCounter
from sensors import Directions, PeopleCounter
import logging
import json
def debug_log_change(countChange: int, directionState: dict) -> None:
def _debug_log_change(countChange: int, directionState: dict) -> None:
json_state = json.dumps(directionState)
logging.debug(f"CHANGE;Count Change;{str(countChange)};Direction State;{json_state};")
def debug_log_trigger(triggerState: dict) -> None:
def _debug_log_trigger(triggerState: dict) -> None:
logging.debug(f"TRIGGER;Inside Triggered;{str(triggerState[Directions.INSIDE])};Outside Triggered;{str(triggerState[Directions.OUTSIDE])};")
def debug_log_counting(countChange: int) -> None:
def _debug_log_counting(countChange: int) -> None:
logging.debug(f"COUNTING;Count Change;{str(countChange)};")
def debug_log_measurement(direction: Directions, distance: float) -> None:
def _debug_log_measurement(direction: Directions, distance: float) -> None:
logging.debug(f"MEASUREMENT;Direction;{str(direction)};Distance;{str(distance)};")
def register_debug_logger(counter: PeopleCounter) -> None:
counter.hookChange(debug_log_change)
counter.hookCounting(debug_log_counting)
counter.hookTrigger(debug_log_trigger)
counter.hookMeasurement(debug_log_measurement)
counter.hookChange(_debug_log_change)
counter.hookCounting(_debug_log_counting)
counter.hookTrigger(_debug_log_trigger)
counter.hookMeasurement(_debug_log_measurement)