Toggle navigation
Toggle navigation
This project
Loading...
Sign in
cse437_e
/
smartdoorlock-backend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김유현
2020-11-27 05:27:25 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2d533e89f3306fcadfac6b9a36272ff9c0328422
2d533e89
1 parent
e0987395
Modify doorlock process
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
api/views.py
doorlock.py
api/views.py
View file @
2d533e8
...
...
@@ -90,7 +90,7 @@ class Devices(APIView) :
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
# 기기 추가 요청
def
put
(
self
,
request
,
format
=
None
)
:
def
put
(
self
,
request
,
device_id
,
format
=
None
)
:
try
:
if
request
.
auth
==
None
:
raise
PermissionDenied
...
...
doorlock.py
View file @
2d533e8
...
...
@@ -47,9 +47,9 @@ class Motor:
def
rotate
(
self
,
command
):
if
command
==
"open"
:
self
.
p
.
ChangeDutyCycle
(
12
.5
)
self
.
p
.
ChangeDutyCycle
(
7
.5
)
else
:
self
.
p
.
ChangeDutyCycle
(
2.5
)
self
.
p
.
ChangeDutyCycle
(
1
2.5
)
def
stop
(
self
):
self
.
p
.
ChangeDutyCycle
(
0
)
...
...
@@ -110,6 +110,7 @@ def RFIDProcess(signalQueue):
print
(
"1-2 Open Door"
)
try
:
if
not
findDevice
:
# if not devices.find(deviceId)
sound
.
print_wrong_sound
()
print
(
"등록되지 않은 RFID 장치"
)
# raise
pass
else
:
...
...
Please
register
or
login
to post a comment