mirror of
https://github.com/zyphlar/doorlock.git
synced 2024-04-03 21:36:03 +00:00
Add door opening code
This commit is contained in:
+14
-1
@@ -1,6 +1,19 @@
|
||||
const { Board } = require('easy-usb-relay')
|
||||
|
||||
const DELAY = 6000
|
||||
|
||||
module.exports = class Door {
|
||||
static open() {
|
||||
console.log('OPEN DOOR!!!!!!!!!!!!!!')
|
||||
return new Promise(success => {
|
||||
console.log('OPEN DOOR!')
|
||||
const board = new Board(2)
|
||||
board.allOn()
|
||||
setTimeout(() => {
|
||||
console.log('CLOSING DOOR!')
|
||||
board.allOff()
|
||||
success()
|
||||
}, DELAY)
|
||||
})
|
||||
}
|
||||
|
||||
// static close() {
|
||||
|
||||
Reference in New Issue
Block a user