2022-09-14 00:15:37 +02:00
|
|
|
from sensors.people_counter import PeopleCounter
|
2021-10-07 12:33:20 +02:00
|
|
|
import logging
|
2023-11-24 18:27:05 +01:00
|
|
|
from setup import sensor
|
2021-10-07 12:33:20 +02:00
|
|
|
|
2023-11-24 18:27:05 +01:00
|
|
|
counter = PeopleCounter(sensor)
|
2021-10-07 12:33:20 +02:00
|
|
|
peopleCount = 0
|
|
|
|
|
|
|
|
|
|
|
|
def countChange(change: int) -> None:
|
|
|
|
global peopleCount
|
|
|
|
peopleCount += change
|
2022-09-14 00:15:37 +02:00
|
|
|
logging.info(f"People count change to: {peopleCount}")
|
2021-10-07 12:33:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
counter.hookCounting(countChange)
|
|
|
|
counter.run()
|