기존 JS 파일 이용 음성 제어

  • Google Assistant 이용하여 명렁어를 실행 할 수 있습니다.

  • 기본 예제는 재 실행, 종료 입니다.

sudo nano MagicMirror/modules/MMM-GoogleAssistant/recipes/Reboot-Restart-Shutdown.js

하기와 같이 수정 후 저장합니다.

/**   Reboot, Restart, Shutdown, Screen  **/
/**   Vocal commands script              **/
/**   set partern in your language       **/
/**   @bugsounet                         **/

var recipe = {
  transcriptionHooks: {
    "재 실행": {
      pattern: "재 실행",
      command: "GA_REBOOT"
    },
    "GA_RESTART": {
      pattern: "restart please",
      command: "GA_RESTART"
    },
    "종료": {
      pattern: "종료",
      command: "GA_SHUTDOWN"
    }
  },
  
  commands: {
    "GA_REBOOT": {
      soundExec: {
        chime: "close",
      },
      shellExec: {
        exec: "sudo reboot"
      }
    },
    "GA_RESTART": {
      soundExec: {
        chime: "close",
      },
      shellExec: {
        exec: "pm2 restart 0"
      }
    },
    "GA_SHUTDOWN": {
      soundExec: {
        chime: "close",
      },
      shellExec: {
        exec: "sudo shutdown now"
      }
    }
  }
}

Last updated