Added some extra counter settings to setup.py
This commit is contained in:
parent
16ebe4a670
commit
23d2add388
4 changed files with 12 additions and 9 deletions
|
@ -1,8 +1,7 @@
|
|||
from sensors.people_counter import PeopleCounter
|
||||
import logging
|
||||
from setup import sensor
|
||||
from setup import counter
|
||||
|
||||
counter = PeopleCounter(sensor)
|
||||
peopleCount = 0
|
||||
|
||||
|
||||
|
|
10
src/setup.py
10
src/setup.py
|
@ -1,10 +1,12 @@
|
|||
from sensors import VL53L1XSensor, VL53L3CXSensor
|
||||
from sensors import VL53L1XSensor, VL53L3CXSensor, PeopleCounter
|
||||
from datetime import time
|
||||
import logging
|
||||
|
||||
LOG_FILE_PATH = "log.txt" # Path for logs
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
sensor = VL53L3CXSensor()
|
||||
|
||||
# If the distance (in cm) is lower or equal to this value, the people counter will trigger
|
||||
MAX_TRIGGER_DISTANCE = 110
|
||||
|
||||
# Should lights already turn on where there is any kind of motion in the sensor
|
||||
ENABLE_MOTION_TRIGGERED_LIGHT = True
|
||||
|
@ -26,3 +28,7 @@ hue_conf = {
|
|||
# If file exists, application is considered 'registered' at the bridge
|
||||
"registered_file": "smart_light_registered.bridge",
|
||||
} # Custom configuration for philips hue
|
||||
|
||||
sensor = VL53L3CXSensor()
|
||||
|
||||
counter: PeopleCounter = PeopleCounter(sensor, MAX_TRIGGER_DISTANCE) # Sensor object
|
||||
|
|
|
@ -3,11 +3,10 @@ from services.philips_hue import PhilipsHue
|
|||
from sensors.people_counter import PeopleCounter
|
||||
import logging
|
||||
import json
|
||||
from setup import sensor, hue_conf, LOG_FILE_PATH
|
||||
from setup import hue_conf, LOG_FILE_PATH, counter
|
||||
|
||||
|
||||
hue: PhilipsHue = PhilipsHue(hue_conf) # Light interface
|
||||
counter: PeopleCounter = PeopleCounter(sensor) # Sensor object
|
||||
peopleCount: int = 0 # Global count of people on the inside
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
from datetime import datetime, time, timedelta
|
||||
from typing import Optional
|
||||
from services.philips_hue import PhilipsHue
|
||||
from sensors import PeopleCounter, Directions, VL53L1XSensor
|
||||
from sensors import Directions
|
||||
import logging
|
||||
import json
|
||||
from timeloop import Timeloop
|
||||
from setup import sensor, hue_conf, LOG_FILE_PATH, SCHEDULE, ENABLE_SCHEDULE_TRIGGERS
|
||||
from setup import hue_conf, LOG_FILE_PATH, SCHEDULE, ENABLE_SCHEDULE_TRIGGERS, counter
|
||||
|
||||
|
||||
hue: PhilipsHue = PhilipsHue(hue_conf) # Light interface
|
||||
counter: PeopleCounter = PeopleCounter(sensor) # Sensor object
|
||||
peopleCount: int = 0 # Global count of people on the inside
|
||||
motion_triggered_lights = False # Is light on because of any detected motion
|
||||
timeloop: Timeloop = Timeloop() # Used for time triggered schedule
|
||||
|
|
Loading…
Reference in a new issue