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!!!!!!!!!!!!')
  // }
}