{"_id":"@seydx/bravia","_rev":"39-7bf5590225b74af98f3225c1c0fbc74b","name":"@seydx/bravia","dist-tags":{"latest":"1.1.0-beta.8","beta":"2.0.0-beta.21"},"versions":{"1.0.0":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.0","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","xml2js":"^0.4.23"},"gitHead":"dc9678ac402bb25176376800538314c55993f5be","_id":"@seydx/bravia@1.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zNkI2ZQVTvwFyYV0ed+AAzMEAx1nTLPCBKAUhKlEkQGWwaXSs2c8Y0kIE4x5yoE2tvhLdFVXlQZUKjEMYuz4jg==","shasum":"2d76f6889385c4fe6599fe4b07575ff158d9a719","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.0.tgz","fileCount":11,"unpackedSize":18749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn0FgCRA9TVsSAnZWagAA220P/Ah/Rn0MZk8XS6V+9VL/\nb4fa3wbU0EnP7aa07eFODbJshRvjw5AydZI/2d+Cw8gha7CM3Edz6rn4t5Ql\n+H8EEQLII0cYSBMAYDF7FKFyKVAfZNMdE/rbbnITBpnQOpCPAy3Ig2fc1l5D\n+KX9JCNAwNDOtaMy9RVniVnU1MWDKnhu2WLFomA7YAnPKHABaBdwYCt2htWP\njImLxbMBMv1M1rdm0uFfrUAAgXZLCsVlVjUfG4rRsDtYqIMBxad2Agr8nBgO\n34b+OXUhXqa5C2SFdfdhbKVa0Xds1HGFt0ddWM8ci/9WUutRLC0m9anGUn6Z\nomSpZAhWg4LMN8TRM8rnzLRqWKUKVdllck5QIaQ6YKZ8EkdCfr5ySzQ1r0lP\nk0fPqFloJd9cgn4Ppi2zvROBuyAT9AokrPV4fqyNuz00DLSmfJHxNuFXDfGn\nU1BuoQy7Ei+lnWIoYbT7BOkCgPwRrRYORn9uYK/K3WnfOIUZqqyeSZwXvNpe\nilkL/EcBjct2ynsD2hRk+J/B5PmLXbnI8YRmhz5HdRvV4dqLcUXZqZWNZ5iN\nWCf7TaFjahoFblb7obzjFElT1UdR3K8HxfFMVgNiXI0JWM9LcVUbYx90UOaG\nSm3DSLXI6xw1zcAUUpS63Iy8UYjm50eGN73PnhEZpHbh529eh8RPEbvWapPN\nxnfK\r\n=D2f+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuED81WEC1ix7L1vDQnJlLKDB/leFfnCd79AeCeldtGgIhAJw6dIIktyudy8t0x9aDCKikWDpK6wNG1k6BFEs/zwdy"}]},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.0_1604272480048_0.21086050506644916"},"_hasShrinkwrap":false},"1.0.1":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.1","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"3d840ceee1a9fba8eaa829b649b380c4f1731697","_id":"@seydx/bravia@1.0.1","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/U7M8Rg9a21tPC69CT/gb7USE7x3RTpxKUu+wGgUgAysE9mR9xy219X+6VHwxDm+gj4oR6kK3+wFqOHQEXTCFw==","shasum":"9f94ef4fa8e9aa8cd9e73929d204710009130c26","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.1.tgz","fileCount":11,"unpackedSize":20030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn0Y3CRA9TVsSAnZWagAAtgcP/3LZcTgreBIbmOBIchbZ\nVi1gS2cQNl8ePAHCnYTtXN5baBI+DBDAzJxBGszBVi6vP1vZNnMIH2aSEepz\nmAeufmsIPqMhTAjDC8HLSdJ/234WWJTOx/MbaFSnsHXJPehtN/f2V0Wb44t9\neZn1z3ysQVgnt05SNotpQUw1CImU0op9LRFotcxHCtBlV88VodhEpgFocRQV\n4k3tYRZSNXPf7ogVgbjO2dGw+LGY1lNy5Rw7mQflJ1gnfy5wlTPQnAcQx1BL\n6eLPkhpe22BfWvE9raz/5W1MRtm1A5n79q9cMrRkQ/8Vudn8/6qlUpHnYfsz\nL0j/9ZAYUNTpbYUfZLXLJmkgzd+zDxHvyQBzkbg2nqkWXAlYi1LdY/F9iCXD\nywuQPKO9lWVajuVyu71aFjEDEUzEVvLueYsK32NTPZts0M6iEEHosfrLiZIV\nT+KAud1aLtwjQhHVlkQXRr02Md+vUhrCFZATRHAxiExhDVy+ni1EBRRbjbPC\n9FXOTPGRkHv0xcAY503Tag+mIRMxugJlwzhZROpwsJFgre8wZj03PYEFZkA0\n1sIXsYHYxrOaB2XxfYS+dNQJSR7gg8kYk9NcOgRoZTvov6NDMc/emeutprcf\njOA6Cap+0Dgal8WHN+zst6ZxkswLzDJdU3pD441aWqRu379b1PLGnEewiomw\nEMJU\r\n=lMeh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEAaZ3J8sRF1Ch2eYGEqJCjQ0jDeqQA1U4NOlZn8SUSAiEAnrTVieLkqNBIrG/IC+GKBbW45cl0TQdsUjTu1vtLq0g="}]},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.1_1604273719362_0.47292325170823646"},"_hasShrinkwrap":false},"1.0.2":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.2","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"7cd16942f6622995e2a665a7db8b6aea285f30b6","_id":"@seydx/bravia@1.0.2","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wehu57fhKCOsTJYLftJGl2c/+pxpVRUNvGTqMPF0YM5z4AS6whlfYtuOUsOsAXo2N/94tnGm4vNjaCcyZvKHdA==","shasum":"c12f85af019c3be3b2d0082862cfb1da337354fd","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.2.tgz","fileCount":6,"unpackedSize":20737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn9nYCRA9TVsSAnZWagAASfkP/1H40C0gHQx7Ug/ivWbY\n7Zu2iMSrZpvI4gH0s0epA3UEX/fP7Jx9143C082u3JfXaMASC3LsAQx+HHcM\n7PMVs5i7Ihq+KM1yTmbqgfpd4TZkoV/Qt6iiVbzLXx+NQQQj7rj1MhUDlZ9k\n5Zj7ATo6TMBQCP4Of28IqCqS1C/+pEPzvXL27EhwB1I8FGBcn0rinCqnQUqr\nmw6ER04wrLlSK12g+gjYMEM7B/J6PA/gUWwey9tuRjA7k+J+Ktfni2OyF38v\nCsNK79sPzLoLhm5rVhBpkbQJ18sx2HpWO+8ie+0EZYAWZFMgPeAkfLYs/7Kd\ngnrTIx6kuNbfO44p1MrCGFv96TCja5e/CE2mhWuD3vvQI4WBGm3/yB1LlXMQ\nlBK5jindf0YTKoD9de92K00RQVjJRV5QqN++pImg0bktHhXOUiMnE1/WjIys\n7P0cdfvYxN2e09xXWL8XtBlfykhNATl7OLpDNQFLduiv1+M5Ok8+NBDOiS+4\nonyqKiyhgSmFhFfKxvn4M6E2vVyB7FYiwB1o09t21En81F/rCNHzScac+vGW\nPR8fnMaOex4m4zXBOxpxp66PPTrebqLjTQmJEYytcK4zNZMnXxhxgPOF2GP8\nkilNaUJCOpNFGSWYBMqG5C7617rwxitZ7NEeGpUbIRfnKIaOgGoGzXj80pL1\nu455\r\n=ue/C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAg8ZXNiOCVkqG5nrnHK73BkuEBd2k1zdp5wyGH3bMKAAiByh/tFroo4ldO17tuWX5bmpDBpA68lG3rQ5HG+uX5/aw=="}]},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.2_1604311511679_0.19456760271968832"},"_hasShrinkwrap":false},"1.0.3":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.3","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"db2be5d2183eee848c391a248145350e0ce34d58","_id":"@seydx/bravia@1.0.3","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FvdHre9o5vODwadBOG5mz/2hDMT8psGmjyUHLevF/BUpdemQ17LWa0N7UEbMr1o4cllanSlPRSNNv1r/cznO3A==","shasum":"db5609f0f1d7d250bb7077e556a26806ed1127a9","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.3.tgz","fileCount":6,"unpackedSize":21108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoZo+CRA9TVsSAnZWagAA8R4P/jEM6hz4bTg+lJPwhTGz\nPLf5nAXJ+zdloX85Jz7sZuldZ1v4CHPgce0ny8YxGytZVGF6Z472vqs9QqFA\nXQP1cqFSZkEAK0/9Z/xBdDOXtmznaIi5e+PSSDRDk6veA6Jl3AWsJ+spIzDZ\nij6wXSOgg6glMQCJbborJIWhI8WP7jTfSB527oK8cIjratLrSGN+0jgV6xSc\nrBjwG6+11d6v5d/Dc9HwikQ5M8AMNB2tgst3JcxKcdwAcMz2X3ZjjPcJlvzo\nQ123ilQO82adUpLIs/v3vmAUvFHSxsm5K3LUEzRnYIicOsBJp1uo+jCYMZQn\nbvPACHRpA+9xKsqfhcq0hhjm4RZHXt00qX1AcNUgs70Q68zKxMSu7Ez7GoDP\nxJQZKMyO5BvHlhXsorN2Fm17ZBAw1N2HEN9kUvo5IWc8JdtFZkr/D7cW9JU+\ncwzEUmJlmHUFYIyf34WndK8gW5qTlhbAD8gio5oJfTgc7cyRDnJUAiVRrlP4\nEtU0nMtyTkIb3HOvWltR7XiXiESiJgsTJ/0DPYunS5EySWKiubD8B930DZko\nYLxG/jAgiPGruUDJ27cDPBfh6AThvTnB+93eMYtr9SEfAk5F0wi04i9xpWOT\nLMgCyUpLUYsRaROhF7zPdeEmPKEJRAszVL06NgH5Tb3UzIZS+XYgKfx+fzxk\nWjuf\r\n=Mly3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1+YvKpiyGikzEiI96E8Hgfaz0QXnVRh+mZB4i8gO7hwIgaebgHMPh+/eqpF2Dn+bgU1ppWzPL9h311nkdRbHneA4="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.3_1604426302027_0.08043091017228421"},"_hasShrinkwrap":false},"1.0.4":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.4","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"73e0c502d2676c335fb0bb6abb95115cc5a569dd","_id":"@seydx/bravia@1.0.4","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-CgBSAYWwgX0Hyf16oUZXaiZ+zvSuo+qNK2/XCvS1+y+FJrLyDyD6H4y7paiKu/Smt0jXg4PjGWYdw78KtFM1PA==","shasum":"b44437d78732087447edcba9f24621f0eff72223","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.4.tgz","fileCount":6,"unpackedSize":21002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfob/WCRA9TVsSAnZWagAAl9YP/i10oX2Ws8k65g3XTNaS\nVPFPO0HusbHyRqTXon0xoThRG/2PotxtU71EYrALFeDEUas+QGGWjf+zKZFW\nZhS+nNI92iCFQkeIwPQVZ7mE+3OisXwOOXSvoSD7tMfv/7i1Y5VTMQL0MCaT\nA100yBbfxFVb5U3g6dLM2RYuFBhcIA5BZ9rAEGrMCyE0bpSl3VG7Ebm08CaC\njySz8al7ROC9uOyxxvyxufRUVN4yZBAIByo1ondS6ExcdvWtBtx0WcxmuJb7\nTdSiYN4qSn9e9PJdR60VCt6fagh/sc3rBfayu/xhg6YvJkeCF9j//bWbER6I\nlDLUcFDlZXPY9+62wi2U5mAzcB/UZTDqfEjKXUP6GQg4Inh6irUPqxuYz+fQ\n5gRPaH4T+Uyd6ej8UjAfwYQ59Rc7USYt59wVxdsRTaBcxE53QvQGQIeT3GAv\n9XmiI129+DQ03czECb88Qzpp2zM0a7fAc9P1VYNS9fItRo5eML09neQx5BZh\nFtSiyxs21OMSidPrvo+KCxmBAUWuAQI9p/rgl1tD4fg/dLU7yT6IhRWvPdLx\n5eXY25RTePz7ENY9NVw5O7CoKtHa4zn9caG/8g4RV0KSSSqzxPFnxQGl2tcQ\n/xIqFFGSCtZDPUcwuIsTSv0fL+zvvqaCciLf5fevMmnhsUE3pcOYBEnbqoZp\nFEgc\r\n=FvyC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZ3bl8E8p7sIqk9wP6rwBxfNU2NGVXLi7bawfCmNRtQAiEAx/sSoOVn8DZ+1DxTeiispD5oh08IMcQqMyhDrOs0tnA="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.4_1604435925746_0.6989377160954637"},"_hasShrinkwrap":false},"1.0.5":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.5","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"1deceb9b5ed757b4ef41a4a8bb2e9cfb5315d611","_id":"@seydx/bravia@1.0.5","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Pw4b9FFmUQtMc2NMVwlUVcOBnGARBKB/XFDZEvI40PV762n/DpJAYhWnLNxzYutZn35Cz7Uge/H8E5vcqH4RdQ==","shasum":"42786965c280696476279cbdc9997ef9a592f933","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.5.tgz","fileCount":6,"unpackedSize":20995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfomg2CRA9TVsSAnZWagAA4A0P/AqkrKgruPcn6YlL3HlK\nDmth1elayxx1pGB/vtxnZwv205jh3BRHqR428UxwWpJsvujFMgHJ2bZgFzNV\n4e2QUXf+tiO6WxL4kI8ULtOLpH+ftvstWzJqiWVcJX+k7l7s1wmvwSxX5aHW\nTq/lERAt8asyvC0REyTJsA6MTTfqzR9qhrdmB69mM6/w3myt43oTVnUs+afy\nNLMNnbpzmtVlVHalY0Q06V/+fOz8lgKRVHFf8Hh/h3LObW+U9141VdNYSNZl\n5fZ4Mip1nXWo9wRo2i+6KAh+qsA06ZYpvx0wRnaZ9MGSecbI8EHwdUtilAfT\nJIHVzTg3NtAnwJWVQv/Oshxlgbe3cka2Tmnfc5JJ8WN2x1FaaxjMwiqAXHKP\nLEYjfihNx97maZIuaDH7qJ+PvJWaUBY8BuihvSUlLm7zBzVTismOvQe47nMG\n4MHDdLhm9wxXks+d4cEL6B8YJlUtF8iKEO6y5b2hzaUVIURmKb8Jc982Kkhe\nWnRkV/OHuNuiWtxqsXeJBpd5w/ffFMsY2u4uzv1nF0orsQt+EDJWifoe7iqG\nlzazbjqxvaqCPeSGLFhhBj19JqfJsq2cIRAbp00rttIN8k+VTpqz9IIPjbZV\nuWO2/w3V7zjz6I9BQ4ENt7w3blY96iPfjmjbK8G+LUfp4Kh1IYcHjMhowYcS\nbjCc\r\n=RESF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBj9ljV4gtZaZJXkCi7IWaLwyracElX6gmJ3nwZ7pOfqAiEArnrBy7lekg6y1fjtWYiuWP4iMz7NQggeMAM6A1t9mE0="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.5_1604479029428_0.8845347617445156"},"_hasShrinkwrap":false},"1.0.6":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.6","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"9a3ceb442923d44bb67d2258fe71c55be590739d","_id":"@seydx/bravia@1.0.6","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-DxGguH5JUqMVW9j7yfJCh32M40srJKrOjN2L281mfOoNf8eJOdocGZgkU2wVixn5Sx2C6GKv8sXRU5e7ht+luQ==","shasum":"fd99af08be856902140a2171d041a627a8b81d6a","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.6.tgz","fileCount":6,"unpackedSize":20883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqWwlCRA9TVsSAnZWagAA0mEQAInCfghYBShleuU7apw7\ncqHrUt9pAYDv7PYKOfgoW1uS9nPdq6JyLKWwMfA/B7YsEAVSNfNyR/PPxvRt\nZRe13vL2Ihoz1ERmvU5pk2hOJ4kMvNv68izjZ2EdcSZqvpHz9xD5qxZkrnl1\nmPXl6CUv2ky8cm4eBE165lYnRmEXdgVa0oo/6RobBDqIDUdA6JqzeHNtq0B/\nvAeG28M2JCPCALE1vh3tvuFGt9EQwm1MIGUaGadqGDFIm0lA+15NjsOC9AMM\n09L8GfKWwAJ6rsig85XH2DfHD5wfTJNnzuROtp7hcWkAwNheaL3M+0Dv/qTZ\nOzlUWhcUuwQea5nKpuGWnAJEbd4zgddgymQyAfIo+S+ZSOQhVTkpf4UJ7QUS\nwWjOScOMIyzidxsOM9Qa9mphv1TDpwUp2/ZUbGtzwo5DGldniWcoZ0v6vXZn\nJc2PjEqUk1DINiGAPqwOePFnBfuEfkjM7jwsNVeWnx9KtmKxWjSQwov35za2\nYp+3rnB0Ro+QDnaocJXkwDiCpYdH/13iDDntQuai1wn4pqCWVTwTjfuXcKJC\nANz2vngePqE+jOAVSZfaxnb3i2k0Uafhsdhmt9kzgokVGEQpGCmKQGeFjvt0\nFkdnb81RHNh88pTrBLfI2VIWRS+ICqTepOC9zV/0FqJJSohedShRG2YF1GTj\nzJar\r\n=fF0G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWEgZbu5eicL0GdFDPciPtfw2zNFSMKVpaLFbnPBNk+gIhAKRB52OP6ARTXEHy6WKJiySBzshi+zb5FaPrTz7I7MRx"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.6_1604938788865_0.7450010209714089"},"_hasShrinkwrap":false},"1.0.7":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.7","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"d906b7dc699c3546a2b38f3c8e17e9ed0dacd79d","_id":"@seydx/bravia@1.0.7","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cApkU5WQGWnRFGjLmrKruhDAqbIItFQUx6qP8N2TC1c11tim48/8dGpgNu+t/EQdBkgGnnUb8aHLJQZ1AUrVUQ==","shasum":"6da4f10705ee9559d7f2d925b5fa51197cb45e7e","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.7.tgz","fileCount":6,"unpackedSize":23093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqnfyCRA9TVsSAnZWagAAX3wQAILVt4sV6lepRUR+2Kvu\noaP2xxrlNnaPz0ezkz+5/DHu0DRftqDZ4G7i/ECa163Nw05VJkbd6BaI1S+T\nNuejn25dU101eWxeptTUQfNHoSqnWVfSuRgpm2PdJHhYQFd0tBTKt+yLDFmZ\nbvCUSpV2u5I1Btv1peWd+vf7x7ykEkpKsBq9AQcB9QvB0L/rXeR5aLdEsFz6\nCmazd7/M7C0WP7QvDa6GdY6UnRMocIGdJHG/kCxWxaiQHM5S+CuogNmKtwUG\njOWsnd6GzKhLJ2k++rZdju/X6lbE+fv68VCnCPVG+aoDpjRShpFRZs187Xtq\nClc6F3il84by/K4SEP8nmUuQncPxDatvi0zrqoz8+Iv2cmSh+95pIHHLk038\nlfZDY85Y6Vk9DFNA25o1GylS5jpYSG8478c6zEqJVEmt1CeUcagwOuPX5LuA\nSV89ByEwOZP8/Z1MapoNZCB1rW3JI11AHJcbHk4QIGjE+28xT5nXFjazxzl8\nRBz05YjLQ0WAciPOAgTwjW/3WJ/f6Q0lM2WPNTai/mFepoQx8XrAeATS5qh6\nJ5fYop9ertFm6SoKcjY2HswmJyXpAUXTZ0qsHk51ujzFhmYivyOHYb74zf1W\nwn7Cf1fR+rQEHhn9AXflhJ39/AnYJ+gt0OfK/Y/XCFoKaKYNoHTyScsnCOfg\nP3Yx\r\n=C+em\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAOjRKjJ/3NPdSK15SXA1KzLy1ng7oL/uTJ5Hdo51PgAIgVIdXv1Dr4wV/GrxasYx7nx+E0DcO8HOb85ZiAzltgWo="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.7_1605007346018_0.6245902188354593"},"_hasShrinkwrap":false},"1.0.8":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.8","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"701630ae4fd3dbffdef5c1554b477ca8a8521163","_id":"@seydx/bravia@1.0.8","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4NURzNGoGwyHlb5KB2HsYD+8OThXuZVSANOz6wT//COd+6o0sGXV6jyUMjEubD00YIwwCGsdJ+h/3a2jc6fO8A==","shasum":"91e8f27a9cd0d73e972b1e76ff6387d405d9761f","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.8.tgz","fileCount":6,"unpackedSize":24523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfspHGCRA9TVsSAnZWagAAVv8QAIkqoDM6GU1KoZyafYDe\nhagbVtzZAd36vDtMdpl7kuGreBhszIk+AcwQ5gAth1VbXJ0W2bfXrmg2Hoea\nOQLXBQR0ZpS+zMzYvGJn//QbVRD7cZZG2BrabUejjSwa2P84EkV8Twb8rZ53\n3TlnLMEXJ0OjbgMPL8yt2oD5RQ1g4EV4WrXS/DIOUt7kWLSoCuP2klZM1JEt\nKVJh5iiJC0kMIjmomldOWTcLukb+hrnKaCB/pnpHcZt8mu+ImtxV6MV6xYVI\n6i6eJs8a50Mn8pPzDZ+qx20BxuOS9IgBcx7rQvqkr8qUhU+nSBTqzND2kuml\nSsddT3RQAqGDuqXDxq8ltortYiVM+Qmd3MkmFUJtFFpYyx2hQIYSzO3OVeSj\nApjM7s9idCn0eh82cVNbw7B9lKmAJlg3h/fFqM/el3OtNkf9RIL99TNIlFB2\nR0e/Jfv9LAggwvgT9h2H/NNVShWVWXRggJcAs95Vz3x1pnvwJ66256OUaZpN\nf4j3a0zaEtxvXsEe+InRDezDr3S8I4o9Qlsrtp32m0SwxBdllrzJKCNOPtg+\n3uy/xC3HTMjgYTlT1oaSgZPPgKdQ7ZizL8C2IeW8ZnFVblw5mXedqpPPwSBG\ncJcrmCMuvx3yX4GjZTQ9kP31cmcsvnbBUYLcLS47bwP5Kbo8THJ8S2ucSgXZ\n+Ogb\r\n=BG7D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2oi5O0hxINyHzKBx1HRz9ArL6uu+DzL14Be06kpQMyAIgHHdYsmY++e276a/DjvSbp7aYk24uLwrRrNwbMsEwxT8="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.8_1605538246472_0.8134008081729511"},"_hasShrinkwrap":false},"1.0.9":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.0.9","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"009f65ad2cc3d7bd47acbf25d6c419376e826dd5","_id":"@seydx/bravia@1.0.9","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-gVLTjg/HV2GnjvN9wsoDP8aYd8ZWQRW15xblZBgxEVlvlZVyYQR7X7I9x8bJ+Ws7Je7D5Y4wr53cP+I4b6N0fg==","shasum":"adf6c644951e0a6fee7ff86bf516ebe788f2539d","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.0.9.tgz","fileCount":6,"unpackedSize":24744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuESACRA9TVsSAnZWagAAtIgP/0hu2lsDrxFOwxMMycEO\nr7q4HzMCTFfKBYqImre/55kSYrr02WmQuPjR5aeu8Po1MNFeF0nmH1HiTIlp\n6VpX98+f+FXPoj4n43ucBhvjgeiBLG3eKDxJ3eRkUPyUFFlbjiCblbY5SBiE\nSDeIi4zDOVSqhKnBhI0PNhcUkofiYJI0RS16Y1wvlOJWE4H6P53PfIGHBTuS\nmdJGMj75O1VbFeI3qfmaRdGJfxjJYkP6tEUULdLxrb3xYaK3uyMlBEge8cga\nyl9Zdd19RyvIQrTMmx2CdCPWO9hXDed5UAhcLwuXwO2wojuSUKp0EqTmbE1L\nuM7nK258dxl9R1mkD4fADVFzBoEI9YcpbuTr+HwSy9qXdYoJ/kURDlbTc9t0\niqZVkljSZEZNd+oB0LOHM6XI35UlVDBGAQpyQrhXnH6mtfNwjJXjmetUQ2Js\nRiocBEhyTHB/+Bn6x5hY7CvhJgCsWF1YE7ihXuhlfItiDKfbf4TbJkgIhFpK\npHJYes6BgrnroIs6gquluA17oNrjoubXAChiUUDYruQzy7M5ZZgaOfqdgt+i\nOvs5dh5oMTaE60RqL9W7OCrxUPn5qZHlzYRt2/wx+NV3aQI8rQ2rPtJYWUwn\nrJXTpOZsNAY96KEd7Cwc516LpngZHAuOXUa8z/OuNQIw+eOJKhwZmppapQuX\nYfg7\r\n=/9A7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxRhUL+eBEvhzLZ/e+n9gWjndYPhcRZTMKK1pY/ZLvVwIhANMg9TVuDtnqSKU9q6MmUeX9C1JrIW1NM0qlPWelrpnl"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.0.9_1605911677956_0.32044628656864593"},"_hasShrinkwrap":false},"1.1.0-beta.1":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.1","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\n\n// The time in seconds for the bravia discovery to scan for.\nlet timeout = 5;\n\nasync function example () {\n\n  try {\n  \n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await Bravia.discover(timeout);\n    \n    for (let device in devices) {\n      console.log(devices[device]);\n    }\n    \n  } catch (error) {\n  \n    console.error(error);\n    \n  }\n  \n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n\n  try {\n  \n    // Generate credentials\n    const credentials = await bravia.pair({name: 'MyTV'});\n    \n    console.log(credentials)\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, name: 'MyTV', uuid: 'e9812807-d394-407c-b657-c89a98804e65'});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See below.\n\n\n### Command line tool\n\nAlternatively you can create the credentials via the built-in CLI.\n\nThe bravia cli support following command:\n- **pair**: Pair with an Bravia TV\n\nThe bravia cli support following arguments:\n- **\\<host\\>**: The address of your Bravia TV\n\nThe bravia cli support following options:\n- **-n, --name**: Name for the app (Default Bravia)\n- **-p, --port**: The port of your Bravia TV (Default: 80)\n- **-t, --timeout**: The amount of time (in seconds) to wait for the response (Default 5s)\n\n**Example usage:**\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv -t 5\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n```\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the system method type versions.\n    const versions = await bravia.system.getVersions();\n    \n    // Retrieves all the system method types and versions.\n    const methods = await bravia.system.getMethodTypes();\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.system.invoke('getRemoteControllerInfo');\n    \n    // Queries the volume info.\n    const volume = await bravia.audio.invoke('getVolumeInformation');\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\nIf you want to execute a command and make sure that the TV is on so that the command to be executed can work, you can use:\n\n\n```javascript\n\nasync function example(){\n\n  try {\n    \n    let turnOn = true;\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' }, turnOn);\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n### Send IRCC Code\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.send('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.send('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    \n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.send(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Optional (Default values)\n    const options = {\n      address: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options, true)\n    \n    // Turn on TV through API\n    await bravia.wake()\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n","readmeFilename":"README.md","gitHead":"694ca83942339e197a210149f74c2edf42636168","_id":"@seydx/bravia@1.1.0-beta.1","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-KPnZNHaMn1P1SSmTBALGZffm2cag1ty9V+YVXs6XM942k2W/e8mavHOgDEpCEZ4z1CPsnpmfhrFJQew0D4Bz6g==","shasum":"422279b6726c5529db2dcc0dc4fb8957a6a5a5db","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.1.tgz","fileCount":6,"unpackedSize":31472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuyJ2CRA9TVsSAnZWagAA3cUP/jMO5QBRbe9woho9Ym+D\ncoWIHa2tNM4Feb4B38vbOs6H0JDYp22dwz9dHfoVR+fMNROJpXDNN3b68UDR\n3i6yMcKpR7/yEZQ6MAQoMFp1PSVVK2RkBccllgpYqLo7DToMqob5z1TXMhGS\nOdGT6EMIMwkRvPDeXEWksUxZ+Bl4RYMsw4B2kMeX4rMq2rr7Jf+bOIPN7pfv\nIaKd3Bsja1+DlWcpr7cD3O4aLk2+BlL07moxqjSZeRjdhFmPsPKI2ebdjfOA\n3U+hE7nivYeFRq9k5Lmf94hya15wWApqLZrag0fuqqPiSuBjGJuVBMEI1X/x\n+ALp3A4bYfvwXEl6dkcVd7IKv8dGKHG4U/qCauLhCCj03mJhmiYx2lP9BopP\nmcM+zBJVtZWhPlxIEiYnDm1DuKTC7ePR+4Cb/kVdkzXuXvmxsZh50bBSJM0E\nP18ZD+qf0S+u281IAoqgIJlhD6O6ltxMJGCRpje+U+WlEco6Y1+hJEjZq7X5\nqsKEVWNh2V+IFO7U2A6Mjas16wSSgB5x4D8JvTymh/VX+A9IZzjvnRlduFHI\nA1CWE8Zi58wNg4dByKUqGmANh7BomlCa4ZgQka5qONJqhKe1A52XWzIZxgmC\nlFHjV8wV3nbZi2JPycBysiIWJgmOv0b3iPu1WCSRmFQ8b7Dau4H8d/aGxWSb\nbWLr\r\n=Ry7K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIClzxqj7PusTZ1rto7KdHowlSauCtjq4wJhbTaKa0n5xAiAxv+wkDOF4snzGcExSHD6nd8W3iAOezGvd8yaD16lO+w=="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.1_1606099574106_0.04557561961043466"},"_hasShrinkwrap":false},"1.1.0-beta.2":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.2","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\n\n// The time in seconds for the bravia discovery to scan for.\nlet timeout = 5;\n\nasync function example () {\n\n  try {\n  \n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await Bravia.discover(timeout);\n    \n    for (let device in devices) {\n      console.log(devices[device]);\n    }\n    \n  } catch (error) {\n  \n    console.error(error);\n    \n  }\n  \n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n\n  try {\n  \n    // Generate credentials\n    const credentials = await bravia.pair({name: 'MyTV'});\n    \n    console.log(credentials)\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, name: 'MyTV', uuid: 'e9812807-d394-407c-b657-c89a98804e65'});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See below.\n\n\n### Command line tool\n\nAlternatively you can create the credentials via the built-in CLI.\n\nThe bravia cli support following command:\n- **pair**: Pair with an Bravia TV\n\nThe bravia cli support following arguments:\n- **\\<host\\>**: The address of your Bravia TV\n\nThe bravia cli support following options:\n- **-n, --name**: Name for the app (Default Bravia)\n- **-p, --port**: The port of your Bravia TV (Default: 80)\n- **-t, --timeout**: The amount of time (in seconds) to wait for the response (Default 5s)\n\n**Example usage:**\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv -t 5\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n```\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the system method type versions.\n    const versions = await bravia.system.getVersions();\n    \n    // Retrieves all the system method types and versions.\n    const methods = await bravia.system.getMethodTypes();\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.system.invoke('getRemoteControllerInfo');\n    \n    // Queries the volume info.\n    const volume = await bravia.audio.invoke('getVolumeInformation');\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\nIf you want to execute a command and make sure that the TV is on so that the command to be executed can work, you can use:\n\n\n```javascript\n\nasync function example(){\n\n  try {\n    \n    let turnOn = true;\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' }, turnOn);\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n### Send IRCC Code\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.send('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.send('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    \n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.send(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Optional (Default values)\n    const options = {\n      address: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options, true)\n    \n    // Turn on TV through API\n    await bravia.wake()\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n","readmeFilename":"README.md","gitHead":"a9e630e499c8e1241a60c2d470c6293285eb05dc","_id":"@seydx/bravia@1.1.0-beta.2","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-l45w3PGSCCygHnZcNq5T8iHSmDHTNrQcOD5uW1v+Z2Cwl1SDUGPpE6dPduxODTyxU48qtrFUKwqZVD1dSYGR9A==","shasum":"5c02e217e61ab91b7f3359ecb0057dd34d99c331","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.2.tgz","fileCount":6,"unpackedSize":31478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu174CRA9TVsSAnZWagAAe2sP/1zFJAN6+fkQBGeG5xbG\niMVXX3SzCJXbZFhURPyDZWTKa1ZugSfK/cp6IoGbLSq4MP/vPfMKos7s3zQh\nbgb/F5XTFBlThjCsFAYeE1pqChQW0KZgG1sxA4AmJyoW6QmYBlLitG6M5hBs\ngYPUcrp4F7rj/FAEUWR1v0nmD0tjjVjSk2Q+rG2hD/1Y3yvrHiZd4O1OdlS2\nC4+V9Tb8jlk49e3XGzXaPOVR6CMCTKUcnRZwa8jMUE3IAHsI0zeVQQaLrh/G\nwk/pdOlvqjM9UiEw4E/znthu9Bj9F30vvDRFM2qc3P/JXL6sdx72zZ5RExnL\nhQBasqwe8kUbMyhHHRL+PbqMLQlZNORFltQihvazi5TUzaTMR6mKCIANGEXq\naTk2nVkF7x49Qeb4rbcLcsI5wFIXQYp/G/XyPDwwu8V4qT6Uc6PoHygwb+6J\nhTZ6Dtc9yF/1EVFTGUKvI80rArqsWsv385m88miVOgFIVjxYc3lBL3A2JSZk\nHJkmUM6YQOjob4U+VTsJSbYfhBEZlCN9XUmvpwkT+m7EymzWLgASnYypfnN5\nQkb2L5WYsChX2480BanVP6zrndJ/fCDXlepfeklYIDgjQDaEOiEZtN/VWSRe\nk9od548uxTT6oxvatQa5DGMeggDVWEPm1l5z6ChmM/49Zb9+2OXj50v0Uxrq\nAlrE\r\n=jpLf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBHd4ofsY/nEL923NTM6xXFpvXy1M6jInSecRvIcG7RgIhAKqpDFJm2LWullLLaRKUX2cGawpkUCtaBS8ifXv4SC97"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.2_1606115064511_0.16016495774001527"},"_hasShrinkwrap":false},"1.1.0-beta.3":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.3","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\n\n// The time in seconds for the bravia discovery to scan for.\nlet timeout = 5;\n\nasync function example () {\n\n  try {\n  \n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await Bravia.discover(timeout);\n    \n    for (let device in devices) {\n      console.log(devices[device]);\n    }\n    \n  } catch (error) {\n  \n    console.error(error);\n    \n  }\n  \n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n\n  try {\n  \n    // Generate credentials\n    const credentials = await bravia.pair({name: 'MyTV'});\n    \n    console.log(credentials)\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, name: 'MyTV', uuid: 'e9812807-d394-407c-b657-c89a98804e65'});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See below.\n\n\n### Command line tool\n\nAlternatively you can create the credentials via the built-in CLI.\n\nThe bravia cli support following command:\n- **pair**: Pair with an Bravia TV\n\nThe bravia cli support following arguments:\n- **\\<host\\>**: The address of your Bravia TV\n\nThe bravia cli support following options:\n- **-n, --name**: Name for the app (Default Bravia)\n- **-p, --port**: The port of your Bravia TV (Default: 80)\n- **-t, --timeout**: The amount of time (in seconds) to wait for the response (Default 5s)\n\n**Example usage:**\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv -t 5\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n```\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the system method type versions.\n    const versions = await bravia.system.getVersions();\n    \n    // Retrieves all the system method types and versions.\n    const methods = await bravia.system.getMethodTypes();\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.system.invoke('getRemoteControllerInfo');\n    \n    // Queries the volume info.\n    const volume = await bravia.audio.invoke('getVolumeInformation');\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\nIf you want to execute a command and make sure that the TV is on so that the command to be executed can work, you can use:\n\n\n```javascript\n\nasync function example(){\n\n  try {\n    \n    let turnOn = true;\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' }, turnOn);\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n### Send IRCC Code\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.send('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.send('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    \n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.send(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Optional (Default values)\n    const options = {\n      address: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options, true)\n    \n    // Turn on TV through API\n    await bravia.wake()\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n","readmeFilename":"README.md","gitHead":"0e14d7cc60fc19dd612b8da468db3de2226cf350","_id":"@seydx/bravia@1.1.0-beta.3","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-iNq0arH6poI1IAMJ6gNFqRdvv+jREa04UrgspmJx8Cp8u05ARP1+eKFSgGbJFyBJJoWGjoixsRFDnzvcWu1yxA==","shasum":"0cd48c426c3442ddb235b547514612ff8347014d","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.3.tgz","fileCount":6,"unpackedSize":31557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu2N0CRA9TVsSAnZWagAAXVMP/A+1wQGUxj5c7MSYEHmr\nJQ0vh1N5xKE1E3rlZIVHeHsMRGuDUCs5Ah5RuW9/y6K9m5BbQNtE9Bb+6fRS\nHXgYXSVEUWQ9Y7J6PQ29EChjEZKJYjEcEfXD5uKw88UbhNYbkiOzihsZLtI+\nP7+pYvFFl1AULgM1I0lgkSHBDY+j+U1qy+Teb3wBcBSkxbSN7r79y5VLJeIr\nEcn6VE46AukCFWQz78le3uAeHqKWhT8J9l4c5FZKmsLKstInkH2UrGTSgnCR\nxgb6QWgsGw3vS1FG/uLll+y7SMBEY5IlQyqQtVs4y8IME5ZcStNasOBqSLTA\n95uIag3lRKyB/amO65D0/GtUvbbIbiYo+nR391MVKrRCQAIpkUOC3mn0bU7x\n0zcHgLzZgTBTn2D1ZIxXC4D0cjDh/TO9YBDaGpRyiGYsj8vOFoLzFdTwp428\n28iPxbm6jEUh+QFoJmaj6UpnjtaJvWGkt8SfVZSJok9UCokeRGxH1AnWq3E4\nJ9XEOF0OJkxqt6vwxqo6U1q6Y5GvwJ34oREXU53ojsr4A3FUEEQD8beMZ2Jl\nmWSFsX9j5gBDaRUR+HAJrOxKBe8idNSTUc7C0osN6oMQHjtfyyRGaUjMZtdS\neOvpUjidYwLHSmuIqivG1LcN7u85A0Cvwv+jOu4QXU1YjD+5hEhgALP+mQc/\nUEcV\r\n=lQgf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVJa6RgJIuhloyaxqfyjyBSv5JcmcMNaE+nIexP4yApwIgbTepA5dCffoSd1XuF+tu4+Fu8vCpKjIFx1AVUXWSImY="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.3_1606116212171_0.04986444610009011"},"_hasShrinkwrap":false},"1.1.0-beta.4":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.4","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\n\n// The time in seconds for the bravia discovery to scan for.\nlet timeout = 5;\n\nasync function example () {\n\n  try {\n  \n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await Bravia.discover(timeout);\n    \n    for (let device in devices) {\n      console.log(devices[device]);\n    }\n    \n  } catch (error) {\n  \n    console.error(error);\n    \n  }\n  \n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n\n  try {\n  \n    // Generate credentials\n    const credentials = await bravia.pair({name: 'MyTV'});\n    \n    console.log(credentials)\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, name: 'MyTV', uuid: 'e9812807-d394-407c-b657-c89a98804e65'});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See below.\n\n\n### Command line tool\n\nAlternatively you can create the credentials via the built-in CLI.\n\nThe bravia cli support following command:\n- **pair**: Pair with an Bravia TV\n\nThe bravia cli support following arguments:\n- **\\<host\\>**: The address of your Bravia TV\n\nThe bravia cli support following options:\n- **-n, --name**: Name for the app (Default Bravia)\n- **-p, --port**: The port of your Bravia TV (Default: 80)\n- **-t, --timeout**: The amount of time (in seconds) to wait for the response (Default 5s)\n\n**Example usage:**\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv -t 5\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n```\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the system method type versions.\n    const versions = await bravia.system.getVersions();\n    \n    // Retrieves all the system method types and versions.\n    const methods = await bravia.system.getMethodTypes();\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.system.invoke('getRemoteControllerInfo');\n    \n    // Queries the volume info.\n    const volume = await bravia.audio.invoke('getVolumeInformation');\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\nIf you want to execute a command and make sure that the TV is on so that the command to be executed can work, you can use:\n\n\n```javascript\n\nasync function example(){\n\n  try {\n    \n    let turnOn = true;\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' }, turnOn);\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n### Send IRCC Code\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.send('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.send('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    \n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.send(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Optional (Default values)\n    const options = {\n      address: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options, true)\n    \n    // Turn on TV through API\n    await bravia.wake()\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n","readmeFilename":"README.md","gitHead":"2badc9f3ea343d7e2c166b24b313488877273953","_id":"@seydx/bravia@1.1.0-beta.4","_nodeVersion":"14.15.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-LMAZ1/Cnt+aso5PyNql4+7CK/xTESTd0lUMQa9TTTumraeJzdlVpMn1Berm6OdnaUtyunjTeGpgmswHb+cb8bA==","shasum":"8e2d094083c1c33e57bffc574ff35b7772bfee56","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.4.tgz","fileCount":6,"unpackedSize":31561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxi+4CRA9TVsSAnZWagAArqoP/1LJ/C+/1sn5pUcQE8z+\nYlvgjv/nwtXghz5gJ94cr627AZF78gh763E+Y4+Ba+fZIP4LzTp2Bo0Hwjlv\nUJZNMDSKyc1Rc4YQ87EpNe4JZyGGwy1S5LOV1PjRCMZMUNOoe084+XoqSFTl\nooyVH1yTuUc/yF1CtcPoBH1hcXVepkNR1oErIAhN2eSC4XPYnopPowJCq1hG\nkTnKV0npKSVvXGglsrax7kFc00Ot09HuVWPfPxEs87wXpsYBS10KqTFRV3bu\ni+ZGxyh+0PzAndS3FI49WFLF607sbZzzZwDSCJIctX4MV4KqeQIo9fr9cpUo\ngMcgf+gZpaV0StqN8owsVEExNy5hdQNIAvJHWyqrhaXoHOYiFGa2mi10rbPd\nq0/bBDa1Af4ZSNt281j6GPUPsC/uhTD0MdDU5Mw4UH0VRrc2y/KnxCnB1q2r\nsDeWwrO1NG+az15MTfshdVJ+/NK401tnZ1sryTg2h8bLWurLhfEbdg82RVK9\nLYxvSdUmKo2OuGYWzGG/ryGSENEKNXNrt6mNUe9UBLnVLzvAO4fvAQgnF5H2\nv0pT4iMFDEil8MBH1eVkZ7tdqMLOqVg0ZxW6HqGeBKlm6uZ70tnOu9X6KWHZ\nvbjT440Wchq8VYHGdAV7+lzo45OLayySnewzEdvjK+WFlbTJFCpbftd/ZO0U\nqy7Z\r\n=X3yE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSBwtzpq70Hl229gTNz4M8ASwnDdGQvTYCpoz44T/51AiEA0z0RqZEaN0OCYoviT9kPvnwDyb6xlDlWKRDPRsUF+HM="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.4_1606823864250_0.6342130950699765"},"_hasShrinkwrap":false},"1.1.0-beta.5":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.5","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"a50182449b79f4aadff6d0da19290c1ca1096e33","_id":"@seydx/bravia@1.1.0-beta.5","_nodeVersion":"14.15.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-pbA2d0PqyS+bIloACUHoQOm7/QWDzKp7mSAHS2YEyWf4ecVWkIbUs5etaf+B/0fJEkGGntFgnQli0tboWUYVaA==","shasum":"54a78681a3165100cbed2c2136fcffba7d393db9","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.5.tgz","fileCount":6,"unpackedSize":29941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyzRYCRA9TVsSAnZWagAAZLIP/jtdhc6Kihf8JmmIFwDu\nJ4aIy6GWjAMZQrr6TOSCJjZZ6i8GIkyQmcqCfxeXW7/afKsx20/Z4R8chZxc\nuMBCiB8s5XyqVAVfPjd+IXxz8P1ys3BLVO0yK1DzTea94iG2q2+q/K3ZZ5/f\nOZPSgyXbXRAUOOpywAvVHvT6iNJ6+lPgs+/2B+AGCmCp7UaTC7sF2nRGE84Y\nNwpmWHVoKwrzJb7jXMi7VXeeaFb5c3MTiWXK3Ifl3lQyDN8TTqSjd8lQiwZa\n9K9KmcpbI6yrvqLMf0RRsHutiuXxwS5yqcAf+ECnD2FYqJZQqkZNaLEdZnrf\niNIuSafeZLlDiMbbOI/Ng4LVYsbQolOrCecxg6VNvCMpBhiXU2CAHAdRXT8l\nWHsKglZroiZ6/SFek5s7+kFs4FGmYQUs6fYSw3utD0ew8Mlb2VQ0KRxJ1xfE\n4gYzUGLKuvrjyB3j8WSe+gYmgZYsKak3j6+RKPTAEdEsGeE2T343hwKdP3q6\nhCkpK2dPISO5cFwTaDp4cbKvMbTi5YARyHOGOZxetAvCmf7KQNQUBz1bMksu\ns5qzpI0uXVV5JpYhLyzQLzQigau1vpFe/DxpUpGxIyKBSCnLn44HwcMJgqVN\nlLwV3EPzl3IeJ9gQ+5WV3baPrR0/bRiTFyoMOwriNapcdAR5lVns8wGD5bFf\nc09g\r\n=M0nM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkd9GzBqTQ1NJq8WyhspzaQGLHMIRC9EKPtOAlPzUhkAiEAwB0DCiGqX+Lr/Ox0rjVycgy5msmAx2jbD9AtV67q+X0="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.5_1607152727977_0.4685966614884278"},"_hasShrinkwrap":false},"1.1.0-beta.6":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.6","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"54cb1f23ebc6e3b396695595243e2dbd71680cf9","_id":"@seydx/bravia@1.1.0-beta.6","_nodeVersion":"14.16.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-kOR8lx3MGyUL++T/hiPuWSvGgLLK8snX+6Ls7UveWOqoACH1Gjb3c631EW8RhR8J3JDG6xMpAwvuu77PML2sDA==","shasum":"2811d97b010ec73a55427b6d635877a04b076964","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.6.tgz","fileCount":6,"unpackedSize":30000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTW1OCRA9TVsSAnZWagAAEHUP/1iSpyK5UEY5gKd67kmd\nGPi7VZyBPb4+RSwmZBJm1vX7z9Wsg8/uVG3DlmOyjI9zFkQfUSY442H28tbY\nAF7LsDAiDQx50E0USmXRv79TZ/227mqYceMLF3f2C/MtcfYHepuOT1V9BT0+\nPuT3GLy8/SpB55wbaK+V6WU/h/jGqtd8Ys81YBrl1KHXEuHnpKouPRSGtyZR\nT5/h/zZkOlC0rk8KAyPNuwWCkpmFlNEE73BZn9JHtjMzmTR90e3ubwqF6Aqa\n73Z0nN5d1bXtfUHcRmUxZXONRPrs99h7ynpfVEhwu5cdrS9V5p3skeiTUEIu\nS7TxxRTEVpL+TdwnCa+Qbp3De6cR4uEJ9UwhbjYgYf6wUQJULB/yzhFmkrJD\nVhuPTbxMpxl5F9Vgok0poq8IozhfZomQaCR9/VhgUAq4nrBvQvt/Mt8IBoiY\nkjx9mqVI23+1rHv2KbETb4MRTnCfqTJIBjHIcJc/vwkB86tpHTJkut0c0jHG\nLzSn1ZitBnDCtTmrgsUJ7mas0XQ3JnwpT24yXwn4omUc3ngA2h8noGdP7rzn\nIAhuNjt14NV8sQ69pgzgaYhprE1Fh4YAtb6mh5rX7/J8JbLSyufyNShysb4/\n2fL4+gqkxyxcOOgAWt14o1FMUlHyX/FKYput8QB4NJkdw/5kdUeN/LDMqGku\nOmRu\r\n=G4PE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+nTKHTjB2l3Ib4uZwWAUHUM3yfpKuyxZOkVAj3tFlUwIhAOJDHSGStGIKQ+AJKqVdXg6H4YrlAhOSx/NI8r4Isnah"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.6_1615686989774_0.4128290455305803"},"_hasShrinkwrap":false},"1.1.0-beta.7":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.7","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.0","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.0","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"0d41f3515e391506d9a3821d1802109b74f487b7","_id":"@seydx/bravia@1.1.0-beta.7","_nodeVersion":"14.16.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-XpcH4Am58YHPTpYlO1ooDqbwyGmw8D5+wY3nEBHeBq7qYLFPxKnyW/+4orxS8i61XEGbfnsP+YcxiBwDnbRlAQ==","shasum":"ce4522cf986736653d94413b8a4c53f5432a0ca1","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.7.tgz","fileCount":6,"unpackedSize":30002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTXKcCRA9TVsSAnZWagAAbc8QAI/sR2CoY6wu2JjmIB7b\nnBmaqrB0U8oa2qpVjkgQbXCSciMC+C6sHAxhm0tY+POGA3ozf6qdlCV4o3To\nHsnht1OamCRtaru2IDVQM2KUWv2kPaLTV2TliJbrIEG0XT1wAzLcpsXTKKkK\n3KFVihekRTHTLksNgGczCIKLdzndP50467n3RRJVxjfjG37U8NhEhNTxgBJJ\neaV+/b5j2b+KLwzYCuJHPv0q0MFghIXMYDEvXRnUrEooi3opqAcHm/E8MmhV\no6WIGJrEc5u7rdUCjh1vqNOHmzId4C6TPF3jttJW0LBJyHcqQ1NH0rcp/7a3\n3eb9FiljFSbGbuYDzCokJPTULLlc9kDoSNm8McpDWW8dpVzVdO2vWmBqP8Ju\ny+WgM+jAByPBSacC6SFhxIwzG28Wk6GV7K0NIjb6a71hCStmKjO/i4qALD57\n+dj5ZApUN+t1P9FPshNJTBaUGqsxbHHwY7RNnWZdlHGX4LMec+FGuXijCQej\nCrg7BiMgHfCppFbJaYsG2Ck0OOMIB4PaRCbzY9Hx2WTA+zIZEgpBqXwBpO0c\n8xgVa9MPkJu6Fc+FxBWg1xmxXHBDHCR8HWFNWAMTImJB0KtKVetnNWIkFU9m\nNfM8coUgFD43GnOELhLVsKyY4cScm75u3beXCsq3doCXDCfcmf4146qYuILz\nZ5uv\r\n=6ttl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzcVpF+s/4y0fon3H/aABA8svkwBzsHV193soP6Ca5+AIhAK/CH4vouobI4CjXp1Fuoz70QyDh8N0nPhvPciWI2wSk"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.7_1615688347992_0.2209249849418955"},"_hasShrinkwrap":false},"1.1.0-beta.8":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.8","keywords":["sony","bravia","tv","iot","android","androidtv"],"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.1","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"gitHead":"cf5e2137d77d54a309ced21058766679d362b4e2","_id":"@seydx/bravia@1.1.0-beta.8","_nodeVersion":"14.16.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-OiXaN7HJat4dcq+vxipxfcIcbflLmgjVP8FyYQUoR2LXQUBlmpaiq5h6NGI1pgTo/zF/ZK8/ZHKf0ATdmDza+g==","shasum":"842ca926d86fcc8c16386741c1e30fcf35b4db54","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.8.tgz","fileCount":6,"unpackedSize":30003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2aZJCRA9TVsSAnZWagAAUoYP/2QkRZ23va1UUekfnJ+6\nMVBCpKuaNlA7UXZC/gSBJeu8W/plhiq8miJq5S0yFqE7SOIWGUPPL8Pvhohp\n/4CxrCmk0zaK7N5heJoHLEyqjJItKLFUcOIsYOP+nRDOK6KZ+yrAXx8QgyJg\ndC41uZYH89QJLAxCEfbm+oERVgw9rNB6Ibx8v3zCaK80k4o6W8a2ZxBvJF4u\nGFsU/YuaYL/nv7ZRiodQgHHeYQWzZNeeZIFPjAM7YzVJnylLt2o1UuHbATRR\nDT0eQIFzRdJeCK5ipYxmPp1opQrYXTgfyC4muAQBi88l3MAPePIslmBJrwiL\npdtAyD6xJ+Q56YzH9bPzt1WTIL7t3riW0AUem7j1bs5jUd76UITGUkehpmug\nNKAuOcWTI3krU/EisCB0ZY3P+4nLpZN7OI5uxwcPJsua6HpIorm8ZLp4Vm1q\nM2bQEbtNiFIsl5T8oGcIfahaUJlRN1+q+wD8pOx7ys9cWZR4k1aY6330bHME\nWeboTCkFSrwHcMcdFQTSuI+XgVhOa3/Th4cpPx+aK1WE+DKRYJRt4rDUCMiy\nev6MFrvbonqPQGglKfRsrfTuVcQCQH3ZFAtxqFiXamUam0fPehQsXNrxFOst\nRbKqnwBq+ggZ4c9XgbVxgW9mbyq20ZltuxJVfobcuA6sWpHTBm9Whjikqu51\n7pRN\r\n=+qwJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESiD4AjCsxyKIIw7ApR8+8BP4zhjuYYLEW9QrkyqmbAAiB/A54AhImcFPLNp6+YJJqB8wexm8yprnUIzpfp781yLQ=="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.8_1615688802388_0.2709159290344967"},"_hasShrinkwrap":false},"1.1.0-beta.9":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"1.1.0-beta.9","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=5.0.0"},"dependencies":{"axios":"^0.21.1","base-64":"^1.0.0","caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.3","@babel/eslint-parser":"7.14.3","@babel/eslint-plugin":"7.13.16","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.2","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.0"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\n\n// The time in seconds for the bravia discovery to scan for.\nlet timeout = 5;\n\nasync function example () {\n\n  try {\n  \n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await Bravia.discover(timeout);\n    \n    for (let device in devices) {\n      console.log(devices[device]);\n    }\n    \n  } catch (error) {\n  \n    console.error(error);\n    \n  }\n  \n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n\n  try {\n  \n    // Generate credentials\n    const credentials = await bravia.pair({name: 'MyTV'});\n    \n    console.log(credentials)\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nlet bravia = new Bravia({host: '192.168.1.2', port: 80, name: 'MyTV', uuid: 'e9812807-d394-407c-b657-c89a98804e65'});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See below.\n\n\n### Command line tool\n\nAlternatively you can create the credentials via the built-in CLI.\n\nThe bravia cli support following command:\n- **pair**: Pair with an Bravia TV\n\nThe bravia cli support following arguments:\n- **\\<host\\>**: The address of your Bravia TV\n\nThe bravia cli support following options:\n- **-n, --name**: Name for the app (Default Bravia)\n- **-p, --port**: The port of your Bravia TV (Default: 80)\n- **-t, --timeout**: The amount of time (in seconds) to wait for the response (Default 5s)\n\n**Example usage:**\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv -t 5\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n```\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the system method type versions.\n    const versions = await bravia.system.getVersions();\n    \n    // Retrieves all the system method types and versions.\n    const methods = await bravia.system.getMethodTypes();\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.system.invoke('getRemoteControllerInfo');\n    \n    // Queries the volume info.\n    const volume = await bravia.audio.invoke('getVolumeInformation');\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\nIf you want to execute a command and make sure that the TV is on so that the command to be executed can work, you can use:\n\n\n```javascript\n\nasync function example(){\n\n  try {\n    \n    let turnOn = true;\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: '50' }, turnOn);\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n### Send IRCC Code\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.send('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.send('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    \n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.send(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\n```javascript\nasync function example(){\n\n  try {\n  \n    // Optional (Default values)\n    const options = {\n      address: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options, true)\n    \n    // Turn on TV through API\n    await bravia.wake()\n    \n  } catch(error) {\n  \n    console.log(error);\n  \n  }\n\n}\n```\n","readmeFilename":"README.md","gitHead":"cf5e2137d77d54a309ced21058766679d362b4e2","_id":"@seydx/bravia@1.1.0-beta.9","_nodeVersion":"14.16.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-kE/Z/VkbAHXxpZGoFsS+eSUSJt/PNdhl90sKe1axHLpYOvZhoPXPvoq26YBBA++nRx63118d/3gJ1G9pQpQ71g==","shasum":"484e557f70fab1c064b29be2e5a98a1fafc431dc","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-1.1.0-beta.9.tgz","fileCount":8,"unpackedSize":30422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpfjnCRA9TVsSAnZWagAAWrAQAInWv93biibLIhWfvBdv\nO5hY7OK8gyqYcEYu/alQoqK+QUV5oLuVfMgntPr5nnQ65cU1mHbl2xDeUdn1\nnAXqa+6xrsbU9ykHcoEZcpwRqZDrR7/6lXPiDK5HtkOlOp3tWHgJNPAsFX8d\na3cE4eMLIguP4SwpkbpeMX3XltFalxm0oahA6Y1+nDXa7JcXyVYfM84FW7fW\n3Sr+wbnJqLW8c+ygPMPtptjxErCdF3FW/YJPYyn5Cv/GFfCEmdOcpgOCXiJB\nxGEFVtM3q4u+hZb/c3Sgl+lJ8Vv0fr6+zH4Fepc4X/NLZZ1MtypHhAqmwPkG\nWeo8ok1IzyviHTUG217BmwO+ut+TaRzjSz9ATJQibQlrzdXtrPADC22i19zf\nYSiPv8F/pUwpAfgIQfexs2MIAcxHHwPj9DEDuGmjF9xLvMKDrnL0AqpEZfKM\nrG4J2zCmX6+HlRDcDXybQUdUu9RF2LvTrndWjI7uqhIjrW7Ot3WacsmwSW5Q\nAkGiOoi/RigTZVFFY0Q7JT3i3tmroHkhoK6L8tVH/ZHrl85+AioKc7y75VI5\nCXkZtIlNxS0bDz4GKzK6jHJjC7ig8B97oZ44LDPo1cS3C78CJPeWMj5NGZng\nhgoWiZjW/3oP1luLSJc/9BuMwmJbVhS05yziJ8EGsp3QHzgrHN0iA0MglR72\nTB7o\r\n=2S5a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqElZdVyur58mWIA88aZ+x1leXqlmmv5NfvmBKjVGHawIhAIe90S2N3/P+R/Cd2nQnKnD4BPmJLPqmucl+XR6xWa+R"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_1.1.0-beta.9_1621489895498_0.7601975614886585"},"_hasShrinkwrap":false},"2.0.0-beta.3":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.3","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"src/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"2f11ef06a440d865a75b8b50a914daccb16e5025","_id":"@seydx/bravia@2.0.0-beta.3","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-OEchrUZOrWOdTp3xe8dcObsdFYsYirIOKagVIys9H+xkU5lkxeieyUMH+dGhkUJCsf3M564wiYalG6v6cPVsNQ==","shasum":"a0e8e8061c893079aa9d1d910a0a85670894635a","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.3.tgz","fileCount":10,"unpackedSize":29522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2lQuCRA9TVsSAnZWagAAySEQAI9PbZ0T97+QPW/3XedI\ng3VSsYiv2ccMB2NOhmdJTKuz0wMT6LrsfBuzj0OsMtjx5147cK6Y9u++fxX/\n6dPVriOOHhKe5RY3az9wTeGBtNyTmE/O0vSPHUUfZT61n1FYhp5kpLxrzcsx\nuUiGQ5b/XfhhV48blzNH2QaLUD+fWOY0dfqPZjUXAavjX8xvTRkcLgLBlIMn\nbk2RNBjY/jjxCedryugWFtfhs+adH/i2edra512bT/ZPofGl1xfKRfzmy6BK\nSWK9xylcCxXt8elT4fZtA4HAWGrgXo1ZGjALwq+wYCSB7OOJJ15nzAj0DH/+\nfHNb1Qvd+9ALlPJ1Izgn+zQvGl8k83jZXK7ZvVGSYvMqIpzKNVCv8hm5z6M1\nBXv4I0tx2e8Txc9auDOiiw5CwbaSfwmV5SAJz6ft0KNppM/Kq/22SNeLqQ2M\nqqS0T+wLEuF613Y/4ToJv56vWAOc+4OS2m1rOW5aiFORxpWT2rpijEXl5ler\nIFbDxaZO9l6DBDv5SeQAuXzfVaXjsZCVqt3wkWNaMPantd+RpKNUUy7FkfKf\n+8/mEV+/sE3dguWi+haPw6vhuiiDTtSsow3xS2Kq/3Jp9ROigTJ2eqPbFztV\n0FpX+9ym8Ou4ax6vHft/OVIgBihEMfjjlAZ4F8wFFqbhpr/UXAMVNg4zMXDS\nrt5P\r\n=GJop\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkyyHr5g9FVcuLMk5vR0+z6bl8gaUQno0o6cIJLiApigIgQHYotPsTPrfdei2g+US03v+vnS/BlYU0h2X1Hp09oPY="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.3_1624921133896_0.3152239032300963"},"_hasShrinkwrap":false},"2.0.0-beta.4":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.4","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"7e08050f75ce7c0a812ef1f06c432a2e9237f027","_id":"@seydx/bravia@2.0.0-beta.4","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-1Ufg3OynBK78pA1ohrBF3ku1kYM1gZ8ukRVWGHEusTQsl+XS2DAZueMmoyJbtjnYDbuJjemruoPeKeouqP7DNQ==","shasum":"1df02bb2e6b6258dc804ecd0fff0f183c5268521","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.4.tgz","fileCount":10,"unpackedSize":29854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2xPsCRA9TVsSAnZWagAAOZQP/AzB/jS07vo7k5Ddl9Ix\n9vE8swS9eeuBhbG8hhdNMZhaiNDh5OOSGJHuNgjGVYwUoi+EEEdtR0TQSjX+\nGpBal9mjXAs9O7+JSrlL3y8D62SM7H6GEv5mH3caNfyYph6jddpj9s+Ju9rX\n9GVG2mB+OoIiqgUoyMBwVucdHdn11Y+N6TpNPYJrSY+N+4vizcXLji2+ufwa\nzIAWvTKyJrYFdf+wkEDFoqOYUwwUesdB9/OvEZ/sB0Y24CkSKswI7RqBDWHq\niScHBeYdQZJLNuwHFfcuymGEL1C7EEkMZPY02SDz1rSB459rew/O8q2spuAH\n5Qo6mxEEegMrZ8vfA4W8bMBwQCvgzUJTtJ14ncLyVydsq+Uo0SFXey5L2KQA\nKAFcUmZYIODqCWKG1QaErxGAnY3lFiALHCu7l4QUBxKstAFWW0KQpRG6FiSL\nX6z+8X6zT+o7+OS16WRbwFOtqzMB8mISYvaGKqZQ5+TVOzm4TLNODJPPDiH/\n0UcVaozXOHxCgP2ev3uOoOLVRQgxoOOP5J8kSWI7m1SGaE/Rn2MPNvFdG542\nKKxbiNupxGA06j/uz6arWOKogG06f+3e595q3zCN4pOWmMVyvAoQj8Uq6epw\nAxS7SYLb89c/HnAfDh5LZjPd3kD02yiiPb1RL0qNIQJHAhVl33/ssNjLU1Sl\nh5V6\r\n=A/iO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZ4tvwIbzfyqJLq+pWKaH2PqFb3uGjV6zohrh7FYYKpAiEAghgqaEQ8ZxxooZgijttYZceJqxaMvnfJnkyLWdMh/aY="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.4_1624970219892_0.2390899704056506"},"_hasShrinkwrap":false},"2.0.0-beta.5":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.5","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"a53cc54342e900593415d3196fb91a70cfc7cb9d","_id":"@seydx/bravia@2.0.0-beta.5","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-I+qviL4YVeCDga+EVgw2NeGc0hmOQO7htUXTCumm5MsZuUYV4Gjl4cO8w9qZnQcfu6VvJlBWQwegvznhmExzqw==","shasum":"9e78235cd0594fbb90fc31b907a4b2f12a849f48","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.5.tgz","fileCount":10,"unpackedSize":29970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2xagCRA9TVsSAnZWagAA7+IP/3Izry6yiRU7hiC+uxQS\nUfdez/5yqKRV5VHq+cw7/7VbZCwrjOVMPHVwfmtDTto/23qtbTOFON37OxyB\n5SnM7ewDLoldPIP1ZwzD4+5NSiTqIfNmbaT7DNC5WDkWk1hACYoBpfNx4I2k\nhuRp3yzeYS1A8hz4273E5SYASksv5StTADxV3r5Ast7IdqXY59rxsiIHuOkl\nOuNhL4Ir3wWmAiNbCE/nva8SK6Ftp3WvvIw+yTYqlrvRkFQR3m4rKjPvlf7Z\nU2wZqzyPIH6naEoOWxUsCBoZoPegVr6yVb54F/kb0kEqVaRboh1ujJuBzD4Q\n0VphFjeursLhOGAZtlQzRsj1Bis4N8rML3H8o03MOD0u6Y6jq233yZN8qZ+s\n+P1cqUX9NcXXSJ5RledAli8nfDUsUTQW6FQZVRHVmgCusaJRc2eEYlrFvrBc\nI9Hw4O9UG/SzK9nO7zxz3S8b2fa0BG+1ks2FpQrSaG0eRdvjiDCwQq8SYhI7\nsgTAeSo02sbZerfMdB+GH2C5xAS1krpN1I/6lPYGbycCaNi+JMjz9wfnehGj\nyY55t1LRQ29+RSRDNEmAwAYcjqKIuEB0zB+iV6m23+0lgRT0eem+D8f+sWYn\nPy+ExaDDL+I6GFUXLYzFx6uKEYn0JG/9TwgvaUdqZdrC0YsujpvJ8MXHH4mN\n5MW9\r\n=jX40\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQetCEyP6KPgRRnfh4WzJOeiatI+cZKslc1uMW6wYoaAIhAJvPX8iQs5FUUZulpjval2/FkRQJMLY3YGKLEBEc75Go"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.5_1624970911764_0.2942518901980413"},"_hasShrinkwrap":false},"2.0.0-beta.6":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.6","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"a53cc54342e900593415d3196fb91a70cfc7cb9d","_id":"@seydx/bravia@2.0.0-beta.6","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-V7Kea2VL5qMMFQP7OtxeUM3yMTdQ7q+ni+srt0Gdp5QDVtRgcQYYWNm868ekYAj4L7uISGwsYTPYAbaG2A+1UA==","shasum":"e6da7fc7ad64bd653fccbacd897112c340ad770f","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.6.tgz","fileCount":10,"unpackedSize":30117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2xhDCRA9TVsSAnZWagAAsugP/3zt/dVjLV7Py/ErBvNm\niQV75Mbd9QEqo1+V6jxUo6mnDYVxXSK6wuTDD/iJOUOcRmctSxYFwfqE/QHH\n0MHhuYSFAdk4Eseiq/77HuGf3zNxIJPh4k+eB0/xj4K/8i8sIMTzwYD+Hgx8\nVhzochWLHj143m1+lS5tniTqT/veSTEa3XJpGZPz3GVnrwgY/nTzOClKSRu6\nHbJNLEw5Ruj5t1XX5brKKkyvK4lo4pMMjD0Ay7yKEATPBAtPbac0av+T1121\noH+dD/ypzY7kUd4F4aXBi7DlFAfsxRStctiF5fJg/WEd+MZoI3lYOS7cr5hB\nup8lAIux0/FAtTg2FOrjcDFT5s4KRWL8T4NuLHNPKr98XjsTe0vK3TSNbE86\nCtTsxLQCkVET3GqTQLxqDqV373NwKDdWEvuesNW51HO3qAgaNkfOwomwmV5N\nrwHLbEabLiCN/Lt3us4YQ4tQQ8GGIBSB8l9Q8eSVByzGd2wmJwnoYbPzOAA6\nQcXuLxuEXCk/jVVcOTKzIeAPNnY8AI/PpsUvukmmU0R+2IpS/FWlBr+AGr5A\nIJdcXhsy+NrTR36qu3c3xul/J1G9RhuygCXqlx1Bg7bXaoumOd+UJh7rkFBI\n+7yGnOeHZEg5OZ69/Mfvv0AGOFg868oYju3Y6R02WF2ANBE5suHMjdgXw/nY\nsNS6\r\n=aXRS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxZjH4xlmmHsDCozlOk/mBgr4BPKLKO6uvtcrQjmTBowIhAPUOALAT8ozoZurBMECAeBdY2T4BmWSXQaOUWqQaA6Qy"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.6_1624971330880_0.19352661463397847"},"_hasShrinkwrap":false},"2.0.0-beta.7":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.7","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"8e0c84b952a3ea207767b2ef36a3802707fa0345","_id":"@seydx/bravia@2.0.0-beta.7","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-w+EpY7/IyqCcH8S/3hdMGraOoE9OkvxdR4nIOMh9hP6UKyt9tP3VETyow/ddsG03+CM4uSW9u70/5RByREf0mA==","shasum":"2a15f537f464634a29fcb1475c37d51681abf2a4","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.7.tgz","fileCount":10,"unpackedSize":30214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2xmECRA9TVsSAnZWagAA954P/38glEsBHeGnKvY8r6OX\nCOLhGNDoCRCEvYG7bRLm1K0aoEtSV9JRBXCEUUfLntQPbsACX3OBNPuxu0zP\n8TfhUQnEZNOh/MLKFqO86tzTWNshJdEjxBzapgmT6RMhjyVZV5Nkqr+vfzhh\nJDJv/NjRzo0WZ4VjG6zLTKyBVZulNrEyGQuFTLZWuz50+uuuPRPY8inyDB7p\n3D+QrHHk7OD6CI1m1mbXBGDqk1iegJt/yUeFr7/bC3Qf69HXZWnAoaA/GS4N\nF3HgkU6CdHRpIHqF/FUSXcQ18E4k5Bh6WpHMp4pAk5g30Y15AZtyPs2ydzlc\nXV/WQnchhYaTwXoZNC3q/kAvQRDbbTmIBevopadZeZ2kRfz47p0wq565ed+Y\nDfZ6uiHIVJQlJ1Z2qdnVDwV4ZWjcpbV6WRURuXVBJzkDRaKI6NoE6jBBI3sE\nqAWvVIlzgyOHbII0eq8TtThHCFhFFt/HZIcVUSH4b2zasrQA3AH/NaFt1b1m\nuf3hjVGh61MSXMm/OAbMdcQ0QvnQYRiR23rkOK+rpye4Lxds/LQcQImdOYv4\n8AiGK3p8av8QWOwq5eEla988Z83hZ126vwWuFGkkXoMvaX5b4l7qOEmoN/H7\ndK0m7Z0fHOKi2wS7IbFVdQHKQnxZ0KFhEJ0QWUURNcZr/2Lt8WOVFsT1s+uK\npz2I\r\n=CpA0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGp47yLQ17LWm1QP4B0y95UeQS/s7K53GDTB2jnTUX/PAiEA2UIxlOeAkrXF4rLF43VBbVoBODczdJReGyYi/x+D7/o="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.7_1624971651832_0.773683508056124"},"_hasShrinkwrap":false},"2.0.0-beta.8":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.8","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"8f3f83c9e0d0ab8047d03b447b5f47c66a25ceac","_id":"@seydx/bravia@2.0.0-beta.8","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-StbHgBrGvKKEl0UVoXdY09aozJRuKniRLm9JDUN4+QGUpFPcAGFVK94/5qMFeGJXWcUHQ6Z8KvSqE5A44Z3ivA==","shasum":"52cb5657af4c8142c081cfacf33be9f5b5ebf692","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.8.tgz","fileCount":10,"unpackedSize":30164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2xtsCRA9TVsSAnZWagAAwTYP/RrXptKM2YDBwZJojyNS\n8CVCNiGy1/gYDOlxNO8kuisRske1w/1yDxtFalz/vE7752yYTvYZ6TBdVgLT\nofVkU1O1nEW5QBwbtY+2fgbx0ZzB/LNYSjMNSd5kbzKWfdCtC5XRo6TnHrlw\nMqxWNMB1Pzy9dCscgoeblC2c0sxd4lXIf0e4pHePDM1Bl7nIYPpT4Z0wOX3y\nwFEGVAB4QIJsPFZxxoYboaDuk2XlyYgOPwxVkkKlcGIsLfsqnHwbaqTPFB6J\nPtlXH0RM7n5ClUmjhT/D5vPbKlcBIUtNXQ6t+RHjHXnGER5UdbMJGB2htze5\n/+hRitARZIBqMzbh9DVwjLHzzo9+Uhfxjy+WEuMhHr91iVjfPd1TX7Wfo9Lz\nyyXq5jm2IGZT6nuKK6TQMaFnpo4wrcvSo8BQb4V8jyX19aBo0A875yj6hEvr\n+677HMaPHvb7wCIy9aMu4GkhMLaSc3MrF6Fz4xAk+Kcm3H89Yj8Pshi0GsuE\nKKjjRMmTANKu8iJKae6NYT9tJ+s9YY3kNyo5++ir3HCmhExGyG/0cn9ZoM9B\nKMhig2kWQFIzrEETo9VVoZxrlpu/daPRnFew+J8EEKhzSgn8uP+Nl2t50KB0\n1vYx5s2PAAJFsfiEn14afzm8lWey1U4d1hlqTQ46orMk2Vv4JcZsANP4wxK7\nc1e9\r\n=Rqx6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxNRLYe/LESjOGw5u0xqbQrTufrpIZlOZSaVDJ9l/gTAiA8EUFzz3xoOqTND4AJOC66z0tZeHUgdsfXaU+K32VoJg=="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.8_1624972140421_0.45971487790979904"},"_hasShrinkwrap":false},"2.0.0-beta.9":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.9","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"0933c00a3fa07123118355d1af331fc25064ea27","_id":"@seydx/bravia@2.0.0-beta.9","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-3gxXvXbMsWlx/K/JCBT/o9s7TLX3grxUvfg1KSg4ZGr5uoMzC5Li/NXw760KFCspzKIogjnV08Ae2O5yV8a2Xw==","shasum":"0e3d8b6f758145a6690e35801b7d77584ed45ab3","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.9.tgz","fileCount":10,"unpackedSize":30239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3m20CRA9TVsSAnZWagAAAFoP/i8/GsGW/GC7s3Yktc1w\nCt0+bQa/46vGc5sPFahhdaOSi44FtJqfXm206a8yR7VCqGHMwqfjoIGF+3eW\nRlfOMRiRYRS54upHD4EwssZqg3hY8dVk5lvkHUiVVdDCrbPa1dm2RtA3jJ7S\nobk8Pf00YETLhdly6WUJynAub9YnBz7l/qiIs9Gh6LHRQuVN+KzaO4GEP9CY\nTZ4fnfqhGaaIHCXX/rZgstblU2A8zEnBwdl1bBPcCxWt1Xt4kXPaw1mpakr5\nw10r3n8KqzT9mR1Wz3/zPL7WvNvJMkYWXUiU/aWkS55LAokgeTK1cVwH16zq\nH6RWugVJPnOP06ZNkrIH5fscdlTXjGca3OkIoOU1R5+jV0hol1y8xHMSyi0/\nBvwuKE/zuNZPiL9eLncarnrvTZL8lzvdq6V8s3tsuN67FxDMJRUyE1YYZFkf\ne7YsED346f1wlRWFykt0kaPKxWkXcEUEBJiwDDk5CrzrBXcgxCGT3Giy0KnJ\njDnHbvc3Fgy/6Zgs64DoKxnqBKCHMRgdIRaw0CjPK/HF1l1LX2amLD3mp2n/\nK8uIohwa9dm9LPktIFvcPHnIzU1ijL+YDSCDXZRaKzud+uMY2gnZMqMjzaWF\nisv2R1vwWPCZI3JMqI9sjNZWrfrjxnr9P704JnToIcwZs8LUgMdWZv149YuI\ndJqJ\r\n=Uqd3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBsMXsrnL1f0d6WlL3d7Ujgl+bGeW4wdNbt4MGg3vu2AIgZPiJuVevhAX5IBbvQZVwHJsHTqnodG1h4YAg8mUyb5M="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.9_1625189811737_0.36660510871389596"},"_hasShrinkwrap":false},"2.0.0-beta.10":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.10","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.1","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.14.6","@babel/eslint-parser":"7.14.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","prettier":"^2.3.2"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"e055317fcf7a95f1fdc1beaea4320dfb521c7acc","_id":"@seydx/bravia@2.0.0-beta.10","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-2Xw1hxcfh38XG5FZbSqF3E69jLmM6JXBF6v2icPMVsAd1/rBECFBmq+51QwoXwQ2bVt30DjCIugB9Dc+d5u1OQ==","shasum":"8df0f05be09d1b9518efce7896d30e1ca1371125","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.10.tgz","fileCount":10,"unpackedSize":30229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3n55CRA9TVsSAnZWagAAuEkQAIuWuIMrOkzSfgAGE8mZ\ntF9F8Rd+SBt6XPj///l4xYtBNjCbi99Sg3t411MSRHsU82mVIMP0CRhmlWIt\nLn6A2704CL0bGx3UiWy1jSXqpUKOO0WO1L+FjFnvLHrpaW9AL6qb7OqzgwHX\nuEYvK+iHQ+/y6N3GHMXNmcHsijtZQE4atGcmgsxEPwwzRJqZk9ntmJEyKVq6\niLUjvLiJU71zvz6zBB34NwbQL5/YYrUd6ikYP4azj+ACfma0pYix+IoVELDL\n4V75R3Qm5pfU0sfj/GhomwnYkszxTc3Vw1j1Ih6essmMg8Bqj/qsHXlmjaYN\ngTNfX71DzMVJvHq0gYr3Wcs3Vb4r7jXmVAlEKoshULMJEBI9bTqmTe4xQPXb\n5SLhIQmLlgAUH/lFDHW2v9Pbrgl+cA1eKwNQVcz+SpQq4FE8ar0pZdtYRgyj\nZkO/F5dbKd5kglCg+oM8Lvp57tScvnVZCHoRDBuWBx4SB5t53HB7F0/utWpX\nn7q4kUf5pdSSs/2TgP3eyO+RwxVVXsWcie5ZZZLP5blVDIA/mSTuxPaNAs+h\njs/6RFZnSy3y0vSYpk97xg1/PcyKBTHDJEBBjVUa5CPlHeYBL70NsUtrjs92\nnFtJRU+jzky+B6Nmkhifuz8oSzCSJqD539cc3WFaOD+v0OBCsjCR7xe4YY4t\noGn8\r\n=K+jT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG91bRlUeBry1NHhkywvEGhF1gGVhPOxnMBNM7kfoVawIgLsnTb3jmlnikTP0s/n5BdOfen/LhhCqtpEAcT1TJ1+c="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.10_1625194104923_0.28957587678986907"},"_hasShrinkwrap":false},"2.0.0-beta.11":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.11","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.4","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"e055317fcf7a95f1fdc1beaea4320dfb521c7acc","_id":"@seydx/bravia@2.0.0-beta.11","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-sRmvHNqmq7zLMHtuKab/oCJRjzB6ve+wphcGz1+8hs851EXGjPhwGzOnQ/FlVxJe0NzUBu8FkE6bHbqilCP0lA==","shasum":"c90d750cba1f46b9f1854a147f8f9e8cd004d2ab","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.11.tgz","fileCount":10,"unpackedSize":30229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhRDxPCRA9TVsSAnZWagAA4Z0P/39Eht1f1dPidvOo1JNT\nhWq6UTPqSBWzh/xzfS2CAIPiwqv0uCIgGyR+EixTVtmZNci7vhuPBgE9PbRm\nQTV3LvloxUSIWn+r3tevdlHgo3fBqZC/2nMptbMSgWNizdZs0h1Z9JYJAUkk\niFMrzx2Wsc9FNX31r3/KT6HrPaMHhkKqQA5E3RuY6dCJK1awu0d92pVGZ7t9\n/BJO+/nJS8FUjq6Md1uhYGqasV8J6pSHWNEZijjeGNxByB7FuirnrA1Hccn6\n098gIJIHXIxML3EN7ll9QHQFEHYOX/gXsNNMrPZmDFuR8t0BPI5FYL7DYCEu\nP/u2Yac4d1x6fWbgZTIFnPsRKBsxFIfPHGS4WwWaeayqu1Uho71IEC7eHkFe\nNtA0ACX5HkCq1PFcgS29OJ1jd3SrFWplbCF4nMNUpAaGrwAwcPCp+cDVNTbk\n+lZhR9eDjDxsieOBFOgy3EbMX06x3MP/HFGgvpnvlGqmueNsFCdllQ1wuOqP\nrxn+V1jX8uqs8JiNvMq5yDog94TSloWuhYq9zykWfRrQCypxepWiXmD3LjRY\nqijmllZV7DZdV8hbPww29Vief1psld2e4hS6+lherVee8ZKciO9ak7Rb7RnT\n/BSGFJq7AoIjq0V01H6Bgxe/G/mkspfFwm2SQORmvsZtN+WXhD1Cn1BBhPKn\n5EHi\r\n=rOm0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkxdeANLetWvtdCiFybifF08EicBtkWp+qzERM5ixfNAiEAmMVSnGFAJVhbDWxeW4uGrW6RkRHjP3giXrlV6Ivx3Ig="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.11_1631861839728_0.034395006787130145"},"_hasShrinkwrap":false},"2.0.0-beta.12":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.12","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"a4e0cc93feab4c82a59463aa44d89a0ec6ecffb3","_id":"@seydx/bravia@2.0.0-beta.12","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-p26tEJWF4WU9nAdbdhtY8ya/WnvDaaqWIatEAl+RSaDV4zDJ4ebOxmVQMifC4Cd4sAyz+iZfN0sHdiNeGmbraw==","shasum":"466638278308c3b26cc5015b30a254a9690d5341","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.12.tgz","fileCount":10,"unpackedSize":30234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGAQVjssLFETRde6K9j5TbhDhyfT12FhrMI6/ouVveWAiEAjIWlgl00QUwvBQ3jreNDYOBI7uXwx7z9e1JQs+0TRbs="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.12_1632111249053_0.5876215812522179"},"_hasShrinkwrap":false},"2.0.0-beta.13":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.13","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"a4e0cc93feab4c82a59463aa44d89a0ec6ecffb3","_id":"@seydx/bravia@2.0.0-beta.13","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-wqDMz8abGGQ+NSWsqaOTeqq+ZuzrRu7P1ivzUbcBxCVyqlUw/TN3YsQccWnjxx0fCS2UtlJ5li6bIz2CJ4HEuA==","shasum":"3aba44d76c2c5e3e6ff60319439ed1d3ffdafa76","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.13.tgz","fileCount":10,"unpackedSize":30534,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBE3H3VK6dTEeRpiAOZ3CqZyciWOpjy8ooo7qT/mRzUIAiA/snQ0cShFJ1sdakZOPcuI9YNH22RpBRZiMWnnSOkLLw=="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.13_1632158218919_0.8968019663824605"},"_hasShrinkwrap":false},"2.0.0-beta.14":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.14","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"a4e0cc93feab4c82a59463aa44d89a0ec6ecffb3","_id":"@seydx/bravia@2.0.0-beta.14","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-JYdv8mShU4MFhyKNUkCHNCfMAn3IkZnEvNPXdgupIB/ep3qnmjaAqmpSOP0YeUGqhlAq/xPkX7wffy8QhWrbzg==","shasum":"3215ba6d763785f6d4488f382483230e506d8e19","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.14.tgz","fileCount":10,"unpackedSize":30534,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANfRwPc5BWJF58cw5xoM4ohNNpuff3ubnpGPzrgb45xAiAeS2MoDvXXl2MueWRpsQ+CIrZ56ucTfvJaS8ctXdukow=="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.14_1632158260845_0.6560711543916642"},"_hasShrinkwrap":false},"2.0.0-beta.15":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.15","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"f39be323e8a2235b3fb7a0435cae69f21094b74b","_id":"@seydx/bravia@2.0.0-beta.15","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-36kw7dLuBdYqf1sfQfkf2mfWCcZ+tpH/dZqV9emrr1RYiQGiPoF1NO4vBGhTgH8qk3rPljtkaRBeFcs8V5FXqQ==","shasum":"f7329fa9c2f8bb38814ca8642409fbc946789795","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.15.tgz","fileCount":11,"unpackedSize":32464,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbzO6hlRRCU+ScIQdWQY7EWdy0xeuDMCFgA4fLbaxPvgIhAKPZL/ho3bmPSfCF3Cnqq0m7YGbPgzc/bbOUkZCDfp91"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.15_1632401766334_0.03548953346180128"},"_hasShrinkwrap":false},"2.0.0-beta.16":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.16","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"96c0376b7037d5bdfbdaec68bebad8f2cf5432fa","_id":"@seydx/bravia@2.0.0-beta.16","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-QBr7QeUhgHuL+wZ8HkIm1wfUoTxJ38LsnbAiLxKAujYaKIA9U2a05jLTQqJLgio/Tzy+V0AQAML0NOYAyyZG2g==","shasum":"4faf9f3885b9b7a5123660add2bbc8dd377d1720","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.16.tgz","fileCount":11,"unpackedSize":32468,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzn+ia7NWQm3co4yMSjS3cDvo6uCkREZVkjdzqYeOXagIgN97cq12ceOnfM6r1y1Odcna8REMnWzHTssjsEuCLeLc="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.16_1632401963353_0.8620421316999274"},"_hasShrinkwrap":false},"2.0.0-beta.17":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.17","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"96c0376b7037d5bdfbdaec68bebad8f2cf5432fa","_id":"@seydx/bravia@2.0.0-beta.17","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-TLpJFIByomGPRrkX4MCZH8XG9Cp4yU/skM9QSCcC4TFIspoHnP3cGDRkwI4NFxeSl8MLYJ5kt4c/sS6u6k1Aaw==","shasum":"3c97b9efbd391a68a4c7f10af4f99f169b9881c1","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.17.tgz","fileCount":11,"unpackedSize":32595,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFP3urCqAXiSlcHwMjRFtjZlv1UL/w233X/swDl/Mx0/AiEAk9MDu7cJ5FRau/LHUeJ42VMRGrrvhnUCyHW4iWhSOUc="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.17_1632403552573_0.6033214472422093"},"_hasShrinkwrap":false},"2.0.0-beta.18":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.18","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"300a947ade00b6834c71796c420d133a95a5eb17","_id":"@seydx/bravia@2.0.0-beta.18","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-86Mp6q/9Vyo6GnRng0uYdE7HOKFaE3QzZ/EDtv1Sp9Vk/Zo1LAwdTFBj5gBGtChsJ2i2rEMSXYtulQRlhwyolg==","shasum":"e53016fb7085ca2ffbffd1461f599c93d95c6fec","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.18.tgz","fileCount":11,"unpackedSize":32587,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRcnf7ooTBFTiDN7s83weMCZAfcx8qCijHFp+DxZftvAIhAM/r1wAP9nlO8drWOi1VQRxxZWCGPJMlb+p7MDhSrgLG"}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.18_1632510676103_0.4728545962684878"},"_hasShrinkwrap":false},"2.0.0-beta.19":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.19","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"f43737a2df4b4e7539234656c224bbe69945a4f8","_id":"@seydx/bravia@2.0.0-beta.19","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-mW/Z3wYjyvpSOZzG+txTNV0nLF98flqDmZmSSvkfOSkynwtare1SHMWFks8AN+h1YcyI9p/CTUievEJZQV6PSw==","shasum":"401a0889856a5186fe41d2db066e96e5848d1c23","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.19.tgz","fileCount":11,"unpackedSize":32677,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6Ogq/qO2aBNfRKKUONLg32E8voToDidFY7nrlPD+6UQIgShiN2fRAdIi/NrXpefPA59yYt4xTKXHkGzVZaSavrJU="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.19_1632515465314_0.5681705477422818"},"_hasShrinkwrap":false},"2.0.0-beta.20":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.20","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"8914358c13ed7c2e6bf74f17770bf6cd0727f7f9","_id":"@seydx/bravia@2.0.0-beta.20","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-oH3/WtrGHZ1OQcUzdZ8oyffNmoUg3bzC/OJsFiqJMYps548HhD4bjb9OxZPY3VnaetBZHol8n30xyRFhFiQUYQ==","shasum":"6e6cc9f035107e892d41cf8d8b29b1d39c34b347","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.20.tgz","fileCount":11,"unpackedSize":32668,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkovqB9S7wG13150nnO5bUA5DoFUGNjvsRK/Q20p66IAIgMdMoDJKdZoSdb4nfSfcukDH2AWefUI/nlqpKGhkD5Gc="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.20_1632606937832_0.39853376084689196"},"_hasShrinkwrap":false},"2.0.0-beta.21":{"name":"@seydx/bravia","description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","version":"2.0.0-beta.21","keywords":["sony","bravia","tv","iot","android","androidtv"],"scripts":{"lint":"eslint --fix ."},"author":{"name":"SeydX"},"homepage":"https://github.com/seydx/bravia","repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","main":"./lib/bravia.js","bin":{"bravia":"bin/cli.js"},"engines":{"node":">=12.0.0"},"dependencies":{"caporal":"^1.4.0","debug":"^4.3.2","enquirer":"^2.3.6","got":"^11.8.2","node-ssdp":"^4.0.1","wake_on_lan":"^1.0.0","xml2js":"^0.4.23"},"devDependencies":{"@babel/core":"7.15.5","@babel/eslint-parser":"7.15.7","@babel/eslint-plugin":"7.14.5","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.24.2","eslint-plugin-prettier":"^4.0.0","prettier":"^2.4.1"},"readme":"# Sony BRAVIA\n\nNode.js module for discovering and controlling Sony BRAVIA Android TVs. This module allows you retrieve all the available service protocol API methods and invoke any of them. All methods return a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\n## Setup\n\n### TV Setup\n\n* Turn on your TV\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > On\n* On the TV go to Settings > Network > Home network setup > IP Control > Authentication > Normal and Pre-Shared Key\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Simple IP Control > On\n\n**Optional:**\n\n* On the TV go to Settings > Network > Home network setup > Remote device/Renderer > Enter Pre-Shared Key > 0000 (or whatever you want your PSK Key to be)\n\n### Install with NPM\n\n```sudo npm install @seydx/bravia@beta -g ```\n\n## Discovery\n\n```javascript\nconst Bravia = require('@seydx/bravia');\nconst bravia = new Bravia();\n\nasync function discover () {\n  try {\n    // Attempts to discover any Sony Bravia TVs.\n    const devices = await bravia.discover();\n    \n    for (const device in devices) {\n      console.log(devices[device]);\n    }\n  } catch (error) {\n    console.error(error);    \n  }\n}\n```\n\n## Authentication\n\n### Connect to TV via PSK\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with the PSK 0000.\nconst Bravia = require('@seydx/bravia');\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, psk: '0000'});\n\n```\n\n### Connect to TV via PIN\n\nTo use the API with the PIN procedure, your credentials must first be created. Afterwards this credentials can be used to send further requests.\n\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 and create your credentials.\nconst Bravia = require('@seydx/bravia');\n\nconst name = 'MyTV'; // Default: '@seydx/bravia'\nconst bravia = new Bravia({name: name, host: '192.168.1.2', port: 80, pin: true});\n\nasync function example(){\n  try {\n    const credentials = await bravia.pair();\n    console.log(credentials)\n  } catch(error) {\n    console.log(error);\n  }\n}\n\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\n{\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n```\n\nWith these credentials u can call the API without any authentication procedure\n\n```javascript\n// Connects to a Bravia TV at 192.168.1.2:80 with Application Name and UUID.\nconst Bravia = require('@seydx/bravia');\n\nconst credentials = {\n  name: 'MyTV',\n  uuid: 'e9812807-d394-407c-b657-c89a98804e65',\n  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',\n  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'\n}\n\nconst bravia = new Bravia({host: '192.168.1.2', port: 80, ...credentials});\n```\n\nAlternatively, the credentials can also be created using the built-in CLI. See [#CLI](https://github.com/SeydX/bravia#command-line-tool)\n\n\n## Usage\n\n### Service Protocol APIs\n\n```javascript\nasync function api(){\n  try {\n    // Retrieves all the system method types and versions.\n    const methods = await bravia.describe();\n    console.log(methods);\n    \n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.exec('system', 'getRemoteControllerInfo');\n    console.log(commands);\n    \n    // Queries the volume info.\n    const volume = await bravia.exec('audio', 'getVolumeInformation');\n    console.log(volume);\n    \n    // Sets the speaker volume level to 50%.\n    await bravia.exec('audio', 'setAudioVolume', '1.0', { target: 'speaker', volume: '50' });\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Send IRCC Code\n\n```javascript\nasync function ircc(){\n  try {\n    // Retrieves all the available IRCC commands from the TV.\n    const commands = await bravia.getIRCCCodes();\n    \n    // Sends an IRCC code signal by name.\n    await bravia.execCommand('Mute');\n    \n    // Sends an IRCC code signal by value.\n    await bravia.execCommand('AAAAAQAAAAEAAAAUAw==');\n    \n    // Sends multiple IRCC code signals by name and/or value. Change delay to alter time between each command sent.\n    const delay = 350 //in milliseconds (Default: 350)\n    \n    await bravia.execCommand(['Hdmi1', 'AAAAAgAAABoAAABaAw==', 'Hdmi2', 'AAAAAgAAABoAAABbAw=='], delay);\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n\n### Turn on TV\n\nThe TV can easily be switched on via \"Wake on LAN\" or directly through the API. For WOL you need to enable WOL under TV settings.\n\nNote: Only the screen from TVs in \"PRO\" mode can be switched ON with Wake-on-LAN. If your TV is in \"NORMAL\" mode and in standby, you need to enable the Rest API with WOL to perform API calls. \n\nMore info: https://pro-bravia.sony.net/develop/integrate/ip-control/index.html#wake-on-lan\n\n```javascript\nasync function turnOnTV(){\n  try {\n    // Optional (Default values)\n    const options = {\n      subnet: '255.255.255.255',\n      num_packets: 10,\n      interval: 100\n    }\n\n    // Turn on TV through Wake on LAN (WOL)\n    await bravia.wake('33:7F:62:9F:7B:70', options)\n    \n    // Turn on TV through API\n    await bravia.exec('system', 'setPowerStatus', '1.0', { status: true })\n  } catch(error) {\n    console.log(error);\n  }\n}\n```\n\n### Command line tool\n\nThe bravia cli support following commands:\n\n- **pair** \\<host> -p -n: Pair with a Bravia TV or refresh existing token (PIN Authentication)\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n- **methods** \\<host> -p: Retrieves all the system method types and versions\n  - \\<host> (required): Bravia TV ip address.\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n- **exec** \\<host> \\<protocol> \\<service> \\<version> \\<command> -p -n: Execute API call\n  - \\<host> (required): Bravia TV ip address.\n  - \\<protocol> (required): API Protocol (Endpoint)\n  - \\<service> (required): API Service\n  - \\<version> (optional): API Service Version (Default: '1.0')\n  - \\<command> (optional): API Command (Default: {})\n  - -p, \\--port (optional): Bravia TV port (Default: 80)\n  - -n, \\--name (optional): Custom name (Used for PIN Authentication, Default: '@seydx/bravia')\n  - \\--psk (optional): Pre-Shared Key (if not set, PIN authentication will be used)\n- **discover**: Discover alls your TVs in network\n\n\n#### Example usage for PIN Authentication\n\n```\nbravia pair 192.168.178.55 -p 80 -n MyTv\n```\n\nThe PIN displayed on the TV must then be entered in the terminal. This will generate a credentials ``<Object>`` like this:\n\n```javascript\nname:  MyTv\nuuid:  20879d92-1234-4ba3-a4ce-9a8444c71fa7\ntoken: FD53E55779F964702178CDEBF71E3BA51A6D3A5D\nexpires: Fr., 26 Apr. 2009 21:42:48 GMT+00:00\n","readmeFilename":"README.md","gitHead":"8914358c13ed7c2e6bf74f17770bf6cd0727f7f9","_id":"@seydx/bravia@2.0.0-beta.21","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-FdHKp/2c72GX591SVd+jusoUjOn0gQoD6C5qfeR3nmZUIBGl6RaDIo+GLpaZQFUlVkAmPd+wqctuP3fIIOEc4A==","shasum":"7d6eccd62956627d42d018f83fdc2ac126465e91","tarball":"https://registry.npmjs.org/@seydx/bravia/-/bravia-2.0.0-beta.21.tgz","fileCount":11,"unpackedSize":32718,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTPA3EaNRwBZmrmSKlHaHA8EJP1go0vozKbGrxowcv5AiEAjRsY2WbPLs3sIc8DAXMdu2SMk7wUdWYvDkxPXocTgJI="}]},"_npmUser":{"name":"seydx","email":"seyd55@outlook.de"},"directories":{},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bravia_2.0.0-beta.21_1633137587595_0.4368538632471053"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-01T23:14:39.987Z","1.0.0":"2020-11-01T23:14:40.233Z","modified":"2022-04-06T22:56:58.037Z","1.0.1":"2020-11-01T23:35:19.471Z","1.0.2":"2020-11-02T10:05:11.780Z","1.0.3":"2020-11-03T17:58:22.223Z","1.0.4":"2020-11-03T20:38:45.858Z","1.0.5":"2020-11-04T08:37:09.968Z","1.0.6":"2020-11-09T16:19:48.991Z","1.0.7":"2020-11-10T11:22:26.130Z","1.0.8":"2020-11-16T14:50:46.593Z","1.0.9":"2020-11-20T22:34:38.157Z","1.1.0-beta.1":"2020-11-23T02:46:14.214Z","1.1.0-beta.2":"2020-11-23T07:04:24.640Z","1.1.0-beta.3":"2020-11-23T07:23:32.332Z","1.1.0-beta.4":"2020-12-01T11:57:44.375Z","1.1.0-beta.5":"2020-12-05T07:18:48.143Z","1.1.0-beta.6":"2021-03-14T01:56:29.900Z","1.1.0-beta.7":"2021-03-14T02:19:08.384Z","1.1.0-beta.8":"2021-03-14T02:26:42.536Z","1.1.0-beta.9":"2021-05-20T05:51:35.707Z","2.0.0-beta.3":"2021-06-28T22:58:54.184Z","2.0.0-beta.4":"2021-06-29T12:37:00.037Z","2.0.0-beta.5":"2021-06-29T12:48:31.883Z","2.0.0-beta.6":"2021-06-29T12:55:31.029Z","2.0.0-beta.7":"2021-06-29T13:00:51.988Z","2.0.0-beta.8":"2021-06-29T13:09:00.577Z","2.0.0-beta.9":"2021-07-02T01:36:51.866Z","2.0.0-beta.10":"2021-07-02T02:48:25.108Z","2.0.0-beta.11":"2021-09-17T06:57:19.937Z","2.0.0-beta.12":"2021-09-20T04:14:09.201Z","2.0.0-beta.13":"2021-09-20T17:16:59.121Z","2.0.0-beta.14":"2021-09-20T17:17:41.020Z","2.0.0-beta.15":"2021-09-23T12:56:06.446Z","2.0.0-beta.16":"2021-09-23T12:59:23.494Z","2.0.0-beta.17":"2021-09-23T13:25:52.724Z","2.0.0-beta.18":"2021-09-24T19:11:16.268Z","2.0.0-beta.19":"2021-09-24T20:31:05.465Z","2.0.0-beta.20":"2021-09-25T21:55:37.968Z","2.0.0-beta.21":"2021-10-02T01:19:47.793Z"},"maintainers":[{"name":"seydx","email":"seyd55@outlook.de"}],"description":"Node.js module for discovering and controlling Sony BRAVIA Android TVs","homepage":"https://github.com/seydx/bravia","keywords":["sony","bravia","tv","iot","android","androidtv"],"repository":{"type":"git","url":"git+https://github.com/seydx/bravia.git"},"author":{"name":"SeydX"},"bugs":{"url":"https://github.com/seydx/bravia/issues"},"license":"MIT","readme":"","readmeFilename":""}