From 67ba15c79cee9c4b0d2de753b8662ec8a5de41b9 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 23 Dec 2016 18:09:29 -0800 Subject: [PATCH] Add tvpower.js script --- dotfiles/lib/bin/tvpower.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 dotfiles/lib/bin/tvpower.js diff --git a/dotfiles/lib/bin/tvpower.js b/dotfiles/lib/bin/tvpower.js new file mode 100755 index 00000000..cf780ac5 --- /dev/null +++ b/dotfiles/lib/bin/tvpower.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +var lgtv = require("lgtv2")({ + url: 'ws://10.0.0.136:3000' +}); + +lgtv.on('connect', function () { + console.log('connected'); + lgtv.request('ssap://system/turnOff', function (err, res) { + lgtv.disconnect(); + }); +});