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:
HeshamTB 2022-06-12 21:53:37 +03:00
parent 2c3206fc06
commit 7f90e104d3
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ from sqlalchemy.orm import Session
from . import crud, models, schemas, auth_helper, init_db from . import crud, models, schemas, auth_helper, init_db
from .database import SessionLocal, engine 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 typing import List
from datetime import timedelta, datetime from datetime import timedelta, datetime
@ -404,7 +404,7 @@ def polling_method_for_room_monitor(request: schemas.MonitorUpdateReadings,
print("********EMERGENCY AT %s********" % device.description) print("********EMERGENCY AT %s********" % device.description)
door : models.IotEntity = device.door door : models.IotEntity = device.door
print("********OPENING DOOR %s ID:%d********" % (door.description, door.id)) 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) crud.record_emergancy_entry(db, request, device.id)
# Call into a hook to notify with room and people # Call into a hook to notify with room and people

View File

@ -10,4 +10,4 @@ def get_db():
EMERG_TEMP = 50 EMERG_TEMP = 50
EMERG_SMOKE = 1000 EMERG_SMOKE = 1000
T_HOUR_SEC = 3600 EMERG_OPEN_TIME_SEC = 500