mirror of
https://github.com/zyphlar/doorlock.git
synced 2024-04-03 21:36:03 +00:00
23 lines
448 B
JavaScript
23 lines
448 B
JavaScript
const { Board } = require('easy-usb-relay')
|
|
|
|
const DELAY = 6000
|
|
|
|
module.exports = class Door {
|
|
static open() {
|
|
return new Promise(success => {
|
|
console.log('OPEN DOOR!')
|
|
const board = new Board(2)
|
|
setTimeout(() => {
|
|
console.log('CLOSING DOOR!')
|
|
board.allOff()
|
|
success()
|
|
}, DELAY)
|
|
return board.allOn()
|
|
})
|
|
}
|
|
|
|
// static close() {
|
|
// console.log('CLOSE DOOR!!!!!!!!!!!!')
|
|
// }
|
|
}
|