projects
/
garnod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
370a7d8
)
door opening locked
author
ebelcrom
<ebelcrom@gmail.com>
Fri, 6 Mar 2020 19:34:23 +0000
(20:34 +0100)
committer
ebelcrom
<ebelcrom@gmail.com>
Fri, 6 Mar 2020 19:34:23 +0000
(20:34 +0100)
routes/v1/control.js
patch
|
blob
|
blame
|
history
diff --git
a/routes/v1/control.js
b/routes/v1/control.js
index 8b5285db9b6cfda686b1b26461c83c214165603e..5d2028a44983a3691fc2d36b6b092c09faf52533 100644
(file)
--- a/
routes/v1/control.js
+++ b/
routes/v1/control.js
@@
-33,6
+33,11
@@
router.post('/', nocache, function(req, res, next) {
if (typeof req.query.command == 'string') {
switch (req.query.command) {
case 'move':
+ if (gpio.read() == 'closed') {
+ log.warn('Open the door isn\'t allowed');
+ res.status(400).send();
+ return;
+ }
break;
default:
log.info('Value of command query parameter unknown');