From: ebelcrom Date: Fri, 6 Mar 2020 19:34:23 +0000 (+0100) Subject: door opening locked X-Git-Tag: v1.0.0~1 X-Git-Url: http://binomiant.duckdns.org/9wAuyR5S/?a=commitdiff_plain;h=f375241ffaf3d2196b2e027dbd24e8ed1e50d3cf;p=garnod.git door opening locked --- diff --git a/routes/v1/control.js b/routes/v1/control.js index 8b5285d..5d2028a 100644 --- 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');