diff --git a/sql_app/main.py b/sql_app/main.py index 1bf1b70..9c66e44 100644 --- a/sql_app/main.py +++ b/sql_app/main.py @@ -382,11 +382,12 @@ def polling_method_for_iot_entity(request: schemas.IotDoorPollingRequest, open_command=device.open_request, acces_list_counter=device.acces_list_counter, time_seconds=device.time_seconds, - force_close=device.force_close) + force_close=device.force_close, + state=device.state) # Reset open_request to False crud.clear_open_door_request(db, device.id) crud.clear_close_door_request(db, device.id) - crud.set_door_state(db, device, device.state) + crud.set_door_state(db, device, bool(request.state)) return response diff --git a/sql_app/schemas.py b/sql_app/schemas.py index 5f8b038..f9d8686 100644 --- a/sql_app/schemas.py +++ b/sql_app/schemas.py @@ -104,6 +104,7 @@ class IotDoorPollingResponse(BaseModel): acces_list_counter : int time_seconds : int force_close: bool + state: bool class IotMonitorRoomInfo(BaseModel): humidity : int