sql_app: emergency open time
For some reason, having 3600 set as the time for door to stay open in a case of fire does not open the door at all. Prob a limtiation in door implementation Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
2c3206fc06
commit
7f90e104d3
@ -6,7 +6,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from . import crud, models, schemas, auth_helper, init_db
|
||||
from .database import SessionLocal, engine
|
||||
from .utils import get_db, EMERG_SMOKE, EMERG_TEMP, T_HOUR_SEC
|
||||
from .utils import get_db, EMERG_SMOKE, EMERG_TEMP, EMERG_OPEN_TIME_SEC
|
||||
|
||||
from typing import List
|
||||
from datetime import timedelta, datetime
|
||||
@ -404,7 +404,7 @@ def polling_method_for_room_monitor(request: schemas.MonitorUpdateReadings,
|
||||
print("********EMERGENCY AT %s********" % device.description)
|
||||
door : models.IotEntity = device.door
|
||||
print("********OPENING DOOR %s ID:%d********" % (door.description, door.id))
|
||||
crud.set_open_door_request(db, door.id, T_HOUR_SEC)
|
||||
crud.set_open_door_request(db, door.id, EMERG_OPEN_TIME_SEC)
|
||||
crud.record_emergancy_entry(db, request, device.id)
|
||||
# Call into a hook to notify with room and people
|
||||
|
||||
|
@ -10,4 +10,4 @@ def get_db():
|
||||
|
||||
EMERG_TEMP = 50
|
||||
EMERG_SMOKE = 1000
|
||||
T_HOUR_SEC = 3600
|
||||
EMERG_OPEN_TIME_SEC = 500
|
||||
|
Loading…
Reference in New Issue
Block a user