├── .gitignore ├── LICENSE ├── README.md ├── config.example.json ├── dist └── index.js ├── images ├── programmable-switch.png └── theater-mode-switch.png ├── package-lock.json ├── package.json ├── src └── index.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Evan Coleman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # homebridge-theater-mode 2 | 3 | > A [homebridge](https://github.com/nfarina/homebridge) plugin to make your HomeKit devices react to the play/pause state of your Apple TV. Configured via the Home app. 4 | 5 | [![npm version](https://badge.fury.io/js/homebridge-theater-mode.svg)](https://badge.fury.io/js/homebridge-theater-mode) 6 | [![License][license-image]][license-url] 7 | 8 | ## Overview 9 | 10 | `homebridge-theater-mode` started as a pet project of mine. I loved using Plex's webhooks to control my Hue bulbs, but I wanted that to extend to other apps on my Apple TV. 11 | 12 | To enable this project, I created [node-appletv](https://github.com/edc1591/node-appletv) to communicate with the Apple TV. This uses a new protocol introduced by Apple with the 4th-generation Apple TV and there still isn't much out there about it. I did my best to reverse engineer the iOS Apple TV app to determine how it tracks the play/pause state, depsite the quirks I ran into with the new protocol. 13 | 14 | Because of this, at times the plugin can be slightly slow to receive state changes, but it always does seem to settle out after a few seconds. It works well enough for me, so I hope it does for you, too! 15 | 16 | ## Installation 17 | 18 | Follow the steps below to pair your Apple TV after installation is complete. 19 | 20 | ```bash 21 | # Install homebridge 22 | $ npm install -g homebridge 23 | 24 | # Install plugin 25 | $ npm install -g homebridge-theater-mode 26 | ``` 27 | 28 | or add `homebridge-theater-mode` to your `install.sh` file. 29 | 30 | ## Pairing 31 | 32 | The pairing process makes use of the command line utility that ships with `node-appletv`. You must be on the same network as your Apple TV to pair. 33 | 34 | ```bash 35 | # Install node-appletv 36 | $ npm install -g node-appletv 37 | 38 | # Scan for Apple TVs and follow the prompts 39 | $ appletv pair 40 | ``` 41 | 42 | At the end of the process, you'll received a credentials string. This string should be input into the `credentials` field in your `config.json` entry for the Apple TV. See the example below or [config.example.json](config.example.json) for a practical use. 43 | 44 | ```json 45 | { 46 | "accessory": "AppleTVTheaterMode", 47 | "name": "Living Room Apple TV", 48 | "credentials": "" 49 | } 50 | ``` 51 | 52 | ## Usage 53 | 54 | Two devices are added to your Home app by `homebridge-theater-mode` for each paired Apple TV. 55 | 56 | The **Theater Mode Switch** is used to toggle theater mode on and off. It is recommend that you turn this off when you are done watching. This will prevent your lights from going crazy when you start AirPlaying music later. Each Apple TV gets its own Theater Mode switch. 57 | 58 | The **Apple TV Programmable Light Switch** is used to define what should happen when theater mode is enabled and your Apple TV enters one of three states (playing, paused, and stopped). This programmable switch has three "buttons," one for each state. 3D touch on the programmable switch and tap details. You'll then be able to configure each of these three buttons. See below for which button is which. 59 | 60 |
61 | 62 | | | Apple TV State | 63 | | :-----------: | :-----------------------: | 64 | | Button 1 | Play | 65 | | Button 2 | Pause | 66 | | Button 3 | Stop (Tapping "Menu") | 67 | 68 | ## Meta 69 | 70 | You can find me on Twitter [@edc1591](https://twitter.com/edc1591) 71 | 72 | Distributed under the MIT license. See ``LICENSE`` for more information. 73 | 74 | [license-image]: https://img.shields.io/badge/License-MIT-blue.svg 75 | [license-url]: LICENSE 76 | -------------------------------------------------------------------------------- /config.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "bridge": { 3 | "name": "Homebridge", 4 | "username": "CC:22:3D:E3:CE:30", 5 | "port": 51826, 6 | "pin": "031-45-154" 7 | }, 8 | "accessories": [ 9 | { 10 | "accessory": "AppleTVTheaterMode", 11 | "name": "Living Room Apple TV", 12 | "credentials": "8958B5C7-A2A3-45DE-9D41-F179C3348C30:35373834343439612d323862662d346336312d623066662d616234333164353933613030:63316635613933652d383136342d343766392d396665612d303362346131623731306231:5c6db4656bfbc89cbeef186f46119455602147268bd076aedd05948174db2f75:f9f6f0e07898524a496bec4afb5886e3f8b1553d7fbfeb7413b2f4f592d747cd" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var Service, Characteristic; 3 | var node_appletv_1 = require("node-appletv"); 4 | var AppleTVProgrammableSwitch = /** @class */ (function () { 5 | function AppleTVProgrammableSwitch(log, config) { 6 | this.log = log; 7 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Stopped; 8 | this.isEnabled = false; 9 | var credentials = node_appletv_1.parseCredentials(config.credentials); 10 | var that = this; 11 | node_appletv_1.scan(credentials.uniqueIdentifier) 12 | .then(function (devices) { 13 | that.device = devices[0]; 14 | that.device.on('error', function (error) { 15 | that.log(error.message); 16 | that.log(error.stack); 17 | }); 18 | return that.device.openConnection(credentials); 19 | }) 20 | .then(function (device) { 21 | log("Opened connection to " + config.name); 22 | }) 23 | .catch(function (error) { 24 | that.log(error); 25 | }); 26 | } 27 | AppleTVProgrammableSwitch.prototype.isPlaying = function () { 28 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Playing; 29 | }; 30 | AppleTVProgrammableSwitch.prototype.isPaused = function () { 31 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Paused; 32 | }; 33 | AppleTVProgrammableSwitch.prototype.isStopped = function () { 34 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Stopped; 35 | }; 36 | AppleTVProgrammableSwitch.prototype.setEnabled = function (value) { 37 | this.log("Setting theater mode enabled to " + value); 38 | this.isEnabled = value; 39 | if (value) { 40 | var that_1 = this; 41 | this.device.on('supportedCommands', function (commands) { 42 | if (commands.length == 0 && (that_1.isPlaying() || that_1.isPaused())) { 43 | that_1.triggerStop(); 44 | } 45 | }) 46 | .on('nowPlaying', function (info) { 47 | if (info == null) { 48 | return; 49 | } 50 | var stateIsPlaying = info.playbackState == node_appletv_1.NowPlayingInfo.State.Playing; 51 | var stateIsPaused = info.playbackState == node_appletv_1.NowPlayingInfo.State.Paused; 52 | if (stateIsPlaying && !that_1.isPlaying()) { 53 | that_1.triggerPlay(); 54 | } 55 | else if (stateIsPaused && that_1.isPlaying()) { 56 | that_1.triggerPause(); 57 | } 58 | }); 59 | } 60 | else { 61 | this.device.removeAllListeners('nowPlaying'); 62 | this.device.removeAllListeners('supportedCommands'); 63 | } 64 | }; 65 | AppleTVProgrammableSwitch.prototype.identify = function (callback) { 66 | this.log('Identify requested!'); 67 | callback(); 68 | }; 69 | AppleTVProgrammableSwitch.prototype.getServices = function () { 70 | if (this.services != null) { 71 | return this.services; 72 | } 73 | var informationService = new Service.AccessoryInformation(); 74 | informationService 75 | .setCharacteristic(Characteristic.Manufacturer, 'Apple') 76 | .setCharacteristic(Characteristic.Model, 'Apple TV') 77 | .setCharacteristic(Characteristic.SerialNumber, '00000000'); 78 | this.switchService = new Service.Switch("Theater Mode", "Theater Mode"); 79 | var that = this; 80 | this.switchService 81 | .getCharacteristic(Characteristic.On) 82 | .on('get', function (callback) { 83 | callback(null, that.isEnabled); 84 | }) 85 | .on('set', function (value, callback) { 86 | that.setEnabled(value); 87 | callback(); 88 | }); 89 | this.playService = new Service.StatelessProgrammableSwitch("Play", "Play"); 90 | this.playService 91 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 92 | .setProps({ maxValue: 0 }); 93 | this.playService 94 | .getCharacteristic(Characteristic.ServiceLabelIndex) 95 | .setValue(1); 96 | this.pauseService = new Service.StatelessProgrammableSwitch("Pause", "Pause"); 97 | this.pauseService 98 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 99 | .setProps({ maxValue: 0 }); 100 | this.pauseService 101 | .getCharacteristic(Characteristic.ServiceLabelIndex) 102 | .setValue(2); 103 | this.stopService = new Service.StatelessProgrammableSwitch("Stop", "Stop"); 104 | this.stopService 105 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 106 | .setProps({ maxValue: 0 }); 107 | this.stopService 108 | .getCharacteristic(Characteristic.ServiceLabelIndex) 109 | .setValue(3); 110 | this.services = [ 111 | informationService, 112 | this.switchService, 113 | this.playService, 114 | this.pauseService, 115 | this.stopService 116 | ]; 117 | return this.services; 118 | }; 119 | AppleTVProgrammableSwitch.prototype.triggerPlay = function () { 120 | if (!this.isEnabled) { 121 | return; 122 | } 123 | this.log("Triggering Play Switch Event"); 124 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Playing; 125 | this.playService 126 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 127 | .setValue(0); 128 | }; 129 | AppleTVProgrammableSwitch.prototype.triggerPause = function () { 130 | if (!this.isEnabled) { 131 | return; 132 | } 133 | this.log("Triggering Pause Switch Event"); 134 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Paused; 135 | this.pauseService 136 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 137 | .setValue(0); 138 | }; 139 | AppleTVProgrammableSwitch.prototype.triggerStop = function () { 140 | if (!this.isEnabled) { 141 | return; 142 | } 143 | this.log("Triggering Stop Switch Event"); 144 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Stopped; 145 | this.stopService 146 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 147 | .setValue(0); 148 | }; 149 | return AppleTVProgrammableSwitch; 150 | }()); 151 | (function (AppleTVProgrammableSwitch) { 152 | var PlaybackState; 153 | (function (PlaybackState) { 154 | PlaybackState["Playing"] = "playing"; 155 | PlaybackState["Paused"] = "paused"; 156 | PlaybackState["Stopped"] = "stopped"; 157 | })(PlaybackState = AppleTVProgrammableSwitch.PlaybackState || (AppleTVProgrammableSwitch.PlaybackState = {})); 158 | })(AppleTVProgrammableSwitch || (AppleTVProgrammableSwitch = {})); 159 | module.exports = function (homebridge) { 160 | Service = homebridge.hap.Service; 161 | Characteristic = homebridge.hap.Characteristic; 162 | homebridge.registerAccessory('homebridge-theater-mode', 'AppleTVTheaterMode', AppleTVProgrammableSwitch); 163 | }; 164 | -------------------------------------------------------------------------------- /images/programmable-switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandcoleman/homebridge-theater-mode/f77ca1d1b94f8d7e49910f72b25f5bd133c1c2e7/images/programmable-switch.png -------------------------------------------------------------------------------- /images/theater-mode-switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evandcoleman/homebridge-theater-mode/f77ca1d1b94f8d7e49910f72b25f5bd133c1c2e7/images/theater-mode-switch.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "homebridge-theater-mode", 3 | "version": "1.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@protobufjs/aspromise": { 8 | "version": "1.1.2", 9 | "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", 10 | "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" 11 | }, 12 | "@protobufjs/base64": { 13 | "version": "1.1.2", 14 | "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", 15 | "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" 16 | }, 17 | "@protobufjs/codegen": { 18 | "version": "2.0.4", 19 | "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", 20 | "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" 21 | }, 22 | "@protobufjs/eventemitter": { 23 | "version": "1.1.0", 24 | "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", 25 | "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" 26 | }, 27 | "@protobufjs/fetch": { 28 | "version": "1.1.0", 29 | "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", 30 | "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", 31 | "requires": { 32 | "@protobufjs/aspromise": "1.1.2", 33 | "@protobufjs/inquire": "1.1.0" 34 | } 35 | }, 36 | "@protobufjs/float": { 37 | "version": "1.0.2", 38 | "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", 39 | "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" 40 | }, 41 | "@protobufjs/inquire": { 42 | "version": "1.1.0", 43 | "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", 44 | "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" 45 | }, 46 | "@protobufjs/path": { 47 | "version": "1.1.2", 48 | "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", 49 | "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" 50 | }, 51 | "@protobufjs/pool": { 52 | "version": "1.1.0", 53 | "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", 54 | "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" 55 | }, 56 | "@protobufjs/utf8": { 57 | "version": "1.1.0", 58 | "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", 59 | "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" 60 | }, 61 | "@types/long": { 62 | "version": "3.0.32", 63 | "resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", 64 | "integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==" 65 | }, 66 | "@types/mdns": { 67 | "version": "0.0.32", 68 | "resolved": "https://registry.npmjs.org/@types/mdns/-/mdns-0.0.32.tgz", 69 | "integrity": "sha512-AxGcBk0JvKHOveWBqi7gkMBdH/8KTFEJ53sZ+vHczVbgaay1V3zMbSz6vL85cFA8npJaS5PENfeoD23ep4r80A==", 70 | "dev": true, 71 | "requires": { 72 | "@types/node": "9.4.6" 73 | } 74 | }, 75 | "@types/node": { 76 | "version": "9.4.6", 77 | "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.6.tgz", 78 | "integrity": "sha1-2Bdthk7kh1PQU3g+TkY67Ia42C4=", 79 | "dev": true 80 | }, 81 | "ansi": { 82 | "version": "0.3.1", 83 | "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", 84 | "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=" 85 | }, 86 | "ansi-escapes": { 87 | "version": "1.4.0", 88 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", 89 | "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" 90 | }, 91 | "ansi-regex": { 92 | "version": "2.1.1", 93 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 94 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 95 | }, 96 | "ansi-styles": { 97 | "version": "2.2.1", 98 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 99 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" 100 | }, 101 | "are-we-there-yet": { 102 | "version": "1.1.4", 103 | "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", 104 | "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", 105 | "requires": { 106 | "delegates": "1.0.0", 107 | "readable-stream": "2.3.5" 108 | } 109 | }, 110 | "async": { 111 | "version": "1.0.0", 112 | "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", 113 | "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" 114 | }, 115 | "balanced-match": { 116 | "version": "1.0.0", 117 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 118 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 119 | "dev": true 120 | }, 121 | "bindings": { 122 | "version": "1.2.1", 123 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", 124 | "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=" 125 | }, 126 | "bluebird": { 127 | "version": "3.5.1", 128 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", 129 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" 130 | }, 131 | "brace-expansion": { 132 | "version": "1.1.11", 133 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 134 | "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", 135 | "dev": true, 136 | "requires": { 137 | "balanced-match": "1.0.0", 138 | "concat-map": "0.0.1" 139 | } 140 | }, 141 | "buffer-from": { 142 | "version": "1.0.0", 143 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", 144 | "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==" 145 | }, 146 | "camelcase": { 147 | "version": "4.1.0", 148 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", 149 | "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" 150 | }, 151 | "caporal": { 152 | "version": "0.10.0", 153 | "resolved": "https://registry.npmjs.org/caporal/-/caporal-0.10.0.tgz", 154 | "integrity": "sha512-Df9b3SxFqXkdvFdc/i4fNU2wFGYezSKTkENew9txshZhfazE8Ts70OKDmhOD7NRJjz81Xd9Jb+wF9XeqM20WsA==", 155 | "requires": { 156 | "bluebird": "3.5.1", 157 | "chalk": "1.1.3", 158 | "cli-table2": "0.2.0", 159 | "fast-levenshtein": "2.0.6", 160 | "lodash.camelcase": "4.3.0", 161 | "lodash.kebabcase": "4.1.1", 162 | "lodash.merge": "4.6.1", 163 | "micromist": "1.0.2", 164 | "prettyjson": "1.2.1", 165 | "tabtab": "2.2.2", 166 | "winston": "2.4.1" 167 | } 168 | }, 169 | "chalk": { 170 | "version": "1.1.3", 171 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 172 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 173 | "requires": { 174 | "ansi-styles": "2.2.1", 175 | "escape-string-regexp": "1.0.5", 176 | "has-ansi": "2.0.0", 177 | "strip-ansi": "3.0.1", 178 | "supports-color": "2.0.0" 179 | } 180 | }, 181 | "chardet": { 182 | "version": "0.4.2", 183 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", 184 | "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" 185 | }, 186 | "cli-cursor": { 187 | "version": "1.0.2", 188 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", 189 | "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", 190 | "requires": { 191 | "restore-cursor": "1.0.1" 192 | } 193 | }, 194 | "cli-spinners": { 195 | "version": "1.2.0", 196 | "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.2.0.tgz", 197 | "integrity": "sha512-E6Nhl5riV6jmsWzzG2s9TZsSmi81K1HBCLso0iFNpSm9kjxAA22T7F4ut+X0WSUzMBOCh8zUHN5LwhtYW0Edgw==" 198 | }, 199 | "cli-table2": { 200 | "version": "0.2.0", 201 | "resolved": "https://registry.npmjs.org/cli-table2/-/cli-table2-0.2.0.tgz", 202 | "integrity": "sha1-LR738hig54biFFQFYtS9F3/jLZc=", 203 | "requires": { 204 | "colors": "1.2.1", 205 | "lodash": "3.10.1", 206 | "string-width": "1.0.2" 207 | } 208 | }, 209 | "cli-width": { 210 | "version": "2.2.0", 211 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", 212 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" 213 | }, 214 | "clone": { 215 | "version": "1.0.4", 216 | "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", 217 | "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" 218 | }, 219 | "code-point-at": { 220 | "version": "1.1.0", 221 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 222 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 223 | }, 224 | "color-convert": { 225 | "version": "1.9.1", 226 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", 227 | "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", 228 | "requires": { 229 | "color-name": "1.1.3" 230 | } 231 | }, 232 | "color-name": { 233 | "version": "1.1.3", 234 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 235 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 236 | }, 237 | "colors": { 238 | "version": "1.2.1", 239 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.1.tgz", 240 | "integrity": "sha512-s8+wktIuDSLffCywiwSxQOMqtPxML11a/dtHE17tMn4B1MSWw/C22EKf7M2KGUBcDaVFEGT+S8N02geDXeuNKg==" 241 | }, 242 | "concat-map": { 243 | "version": "0.0.1", 244 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 245 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 246 | "dev": true 247 | }, 248 | "concat-stream": { 249 | "version": "1.6.2", 250 | "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", 251 | "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", 252 | "requires": { 253 | "buffer-from": "1.0.0", 254 | "inherits": "2.0.3", 255 | "readable-stream": "2.3.5", 256 | "typedarray": "0.0.6" 257 | } 258 | }, 259 | "core-util-is": { 260 | "version": "1.0.2", 261 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 262 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 263 | }, 264 | "curve25519-n2": { 265 | "version": "1.1.3", 266 | "resolved": "https://registry.npmjs.org/curve25519-n2/-/curve25519-n2-1.1.3.tgz", 267 | "integrity": "sha1-TLBYjs+327wL+zLQoARjKW7m7+I=", 268 | "requires": { 269 | "bindings": "1.2.1", 270 | "nan": "2.10.0" 271 | } 272 | }, 273 | "cycle": { 274 | "version": "1.0.3", 275 | "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", 276 | "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" 277 | }, 278 | "debug": { 279 | "version": "2.6.9", 280 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 281 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 282 | "requires": { 283 | "ms": "2.0.0" 284 | } 285 | }, 286 | "defaults": { 287 | "version": "1.0.3", 288 | "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", 289 | "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", 290 | "requires": { 291 | "clone": "1.0.4" 292 | } 293 | }, 294 | "delegates": { 295 | "version": "1.0.0", 296 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 297 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" 298 | }, 299 | "ed25519": { 300 | "version": "0.0.4", 301 | "resolved": "https://registry.npmjs.org/ed25519/-/ed25519-0.0.4.tgz", 302 | "integrity": "sha1-5WIYrOL8kD0llZOu8LKpY59HW+s=", 303 | "requires": { 304 | "bindings": "1.2.1", 305 | "nan": "2.10.0" 306 | } 307 | }, 308 | "escape-string-regexp": { 309 | "version": "1.0.5", 310 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 311 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 312 | }, 313 | "exit-hook": { 314 | "version": "1.1.1", 315 | "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", 316 | "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=" 317 | }, 318 | "extend": { 319 | "version": "3.0.1", 320 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", 321 | "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" 322 | }, 323 | "external-editor": { 324 | "version": "1.1.1", 325 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz", 326 | "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", 327 | "requires": { 328 | "extend": "3.0.1", 329 | "spawn-sync": "1.0.15", 330 | "tmp": "0.0.29" 331 | } 332 | }, 333 | "eyes": { 334 | "version": "0.1.8", 335 | "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", 336 | "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" 337 | }, 338 | "fast-levenshtein": { 339 | "version": "2.0.6", 340 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 341 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" 342 | }, 343 | "fast-srp-hap": { 344 | "version": "1.0.1", 345 | "resolved": "https://registry.npmjs.org/fast-srp-hap/-/fast-srp-hap-1.0.1.tgz", 346 | "integrity": "sha1-N3Ek0Za8alFXquWze/X6NbtK0tk=" 347 | }, 348 | "figures": { 349 | "version": "1.7.0", 350 | "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", 351 | "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", 352 | "requires": { 353 | "escape-string-regexp": "1.0.5", 354 | "object-assign": "4.1.1" 355 | } 356 | }, 357 | "fs.realpath": { 358 | "version": "1.0.0", 359 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 360 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 361 | "dev": true 362 | }, 363 | "gauge": { 364 | "version": "1.2.7", 365 | "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", 366 | "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", 367 | "requires": { 368 | "ansi": "0.3.1", 369 | "has-unicode": "2.0.1", 370 | "lodash.pad": "4.5.1", 371 | "lodash.padend": "4.6.1", 372 | "lodash.padstart": "4.6.1" 373 | } 374 | }, 375 | "glob": { 376 | "version": "7.1.2", 377 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 378 | "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", 379 | "dev": true, 380 | "requires": { 381 | "fs.realpath": "1.0.0", 382 | "inflight": "1.0.6", 383 | "inherits": "2.0.3", 384 | "minimatch": "3.0.4", 385 | "once": "1.4.0", 386 | "path-is-absolute": "1.0.1" 387 | } 388 | }, 389 | "has-ansi": { 390 | "version": "2.0.0", 391 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 392 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 393 | "requires": { 394 | "ansi-regex": "2.1.1" 395 | } 396 | }, 397 | "has-flag": { 398 | "version": "3.0.0", 399 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 400 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 401 | }, 402 | "has-unicode": { 403 | "version": "2.0.1", 404 | "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", 405 | "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" 406 | }, 407 | "iconv-lite": { 408 | "version": "0.4.19", 409 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 410 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 411 | }, 412 | "inflight": { 413 | "version": "1.0.6", 414 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 415 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 416 | "dev": true, 417 | "requires": { 418 | "once": "1.4.0", 419 | "wrappy": "1.0.2" 420 | } 421 | }, 422 | "inherits": { 423 | "version": "2.0.3", 424 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 425 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 426 | }, 427 | "inquirer": { 428 | "version": "5.2.0", 429 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", 430 | "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", 431 | "requires": { 432 | "ansi-escapes": "3.1.0", 433 | "chalk": "2.3.2", 434 | "cli-cursor": "2.1.0", 435 | "cli-width": "2.2.0", 436 | "external-editor": "2.1.0", 437 | "figures": "2.0.0", 438 | "lodash": "4.17.5", 439 | "mute-stream": "0.0.7", 440 | "run-async": "2.3.0", 441 | "rxjs": "5.5.8", 442 | "string-width": "2.1.1", 443 | "strip-ansi": "4.0.0", 444 | "through": "2.3.8" 445 | }, 446 | "dependencies": { 447 | "ansi-escapes": { 448 | "version": "3.1.0", 449 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", 450 | "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" 451 | }, 452 | "ansi-regex": { 453 | "version": "3.0.0", 454 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 455 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" 456 | }, 457 | "ansi-styles": { 458 | "version": "3.2.1", 459 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 460 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 461 | "requires": { 462 | "color-convert": "1.9.1" 463 | } 464 | }, 465 | "chalk": { 466 | "version": "2.3.2", 467 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", 468 | "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", 469 | "requires": { 470 | "ansi-styles": "3.2.1", 471 | "escape-string-regexp": "1.0.5", 472 | "supports-color": "5.3.0" 473 | } 474 | }, 475 | "cli-cursor": { 476 | "version": "2.1.0", 477 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 478 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 479 | "requires": { 480 | "restore-cursor": "2.0.0" 481 | } 482 | }, 483 | "external-editor": { 484 | "version": "2.1.0", 485 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", 486 | "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", 487 | "requires": { 488 | "chardet": "0.4.2", 489 | "iconv-lite": "0.4.19", 490 | "tmp": "0.0.33" 491 | } 492 | }, 493 | "figures": { 494 | "version": "2.0.0", 495 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 496 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", 497 | "requires": { 498 | "escape-string-regexp": "1.0.5" 499 | } 500 | }, 501 | "is-fullwidth-code-point": { 502 | "version": "2.0.0", 503 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 504 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 505 | }, 506 | "lodash": { 507 | "version": "4.17.5", 508 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", 509 | "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" 510 | }, 511 | "mute-stream": { 512 | "version": "0.0.7", 513 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 514 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" 515 | }, 516 | "onetime": { 517 | "version": "2.0.1", 518 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 519 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 520 | "requires": { 521 | "mimic-fn": "1.2.0" 522 | } 523 | }, 524 | "restore-cursor": { 525 | "version": "2.0.0", 526 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 527 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 528 | "requires": { 529 | "onetime": "2.0.1", 530 | "signal-exit": "3.0.2" 531 | } 532 | }, 533 | "string-width": { 534 | "version": "2.1.1", 535 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 536 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 537 | "requires": { 538 | "is-fullwidth-code-point": "2.0.0", 539 | "strip-ansi": "4.0.0" 540 | } 541 | }, 542 | "strip-ansi": { 543 | "version": "4.0.0", 544 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 545 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 546 | "requires": { 547 | "ansi-regex": "3.0.0" 548 | } 549 | }, 550 | "supports-color": { 551 | "version": "5.3.0", 552 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", 553 | "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", 554 | "requires": { 555 | "has-flag": "3.0.0" 556 | } 557 | }, 558 | "tmp": { 559 | "version": "0.0.33", 560 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 561 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 562 | "requires": { 563 | "os-tmpdir": "1.0.2" 564 | } 565 | } 566 | } 567 | }, 568 | "is-fullwidth-code-point": { 569 | "version": "1.0.0", 570 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 571 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 572 | "requires": { 573 | "number-is-nan": "1.0.1" 574 | } 575 | }, 576 | "is-promise": { 577 | "version": "2.1.0", 578 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 579 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" 580 | }, 581 | "isarray": { 582 | "version": "1.0.0", 583 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 584 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 585 | }, 586 | "isstream": { 587 | "version": "0.1.2", 588 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 589 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 590 | }, 591 | "lodash": { 592 | "version": "3.10.1", 593 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", 594 | "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" 595 | }, 596 | "lodash.camelcase": { 597 | "version": "4.3.0", 598 | "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", 599 | "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" 600 | }, 601 | "lodash.difference": { 602 | "version": "4.5.0", 603 | "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", 604 | "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" 605 | }, 606 | "lodash.kebabcase": { 607 | "version": "4.1.1", 608 | "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", 609 | "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=" 610 | }, 611 | "lodash.merge": { 612 | "version": "4.6.1", 613 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", 614 | "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" 615 | }, 616 | "lodash.pad": { 617 | "version": "4.5.1", 618 | "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", 619 | "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=" 620 | }, 621 | "lodash.padend": { 622 | "version": "4.6.1", 623 | "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", 624 | "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=" 625 | }, 626 | "lodash.padstart": { 627 | "version": "4.6.1", 628 | "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", 629 | "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=" 630 | }, 631 | "lodash.uniq": { 632 | "version": "4.5.0", 633 | "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", 634 | "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" 635 | }, 636 | "log-symbols": { 637 | "version": "2.2.0", 638 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", 639 | "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", 640 | "requires": { 641 | "chalk": "2.3.2" 642 | }, 643 | "dependencies": { 644 | "ansi-styles": { 645 | "version": "3.2.1", 646 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 647 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 648 | "requires": { 649 | "color-convert": "1.9.1" 650 | } 651 | }, 652 | "chalk": { 653 | "version": "2.3.2", 654 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", 655 | "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", 656 | "requires": { 657 | "ansi-styles": "3.2.1", 658 | "escape-string-regexp": "1.0.5", 659 | "supports-color": "5.3.0" 660 | } 661 | }, 662 | "supports-color": { 663 | "version": "5.3.0", 664 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", 665 | "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", 666 | "requires": { 667 | "has-flag": "3.0.0" 668 | } 669 | } 670 | } 671 | }, 672 | "long": { 673 | "version": "4.0.0", 674 | "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", 675 | "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" 676 | }, 677 | "lower-case": { 678 | "version": "1.1.4", 679 | "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", 680 | "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" 681 | }, 682 | "mdns": { 683 | "version": "2.3.4", 684 | "resolved": "https://registry.npmjs.org/mdns/-/mdns-2.3.4.tgz", 685 | "integrity": "sha512-Z4WTKeTukCtJG53SS3BGNnsGkHdIXNZa9nwGMYeoohU1AjEBPS3c/1vIx95SEfeQKYduuOMTo1E4RfXDUt2ZYg==", 686 | "requires": { 687 | "bindings": "1.2.1", 688 | "nan": "2.3.5" 689 | }, 690 | "dependencies": { 691 | "nan": { 692 | "version": "2.3.5", 693 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.3.5.tgz", 694 | "integrity": "sha1-gioNwmYpDOTNOhIoLKPn42Rmigg=" 695 | } 696 | } 697 | }, 698 | "micromist": { 699 | "version": "1.0.2", 700 | "resolved": "https://registry.npmjs.org/micromist/-/micromist-1.0.2.tgz", 701 | "integrity": "sha1-QfhJSaBMMM3GCjlNDLBqqgi4Y2Q=", 702 | "requires": { 703 | "lodash.camelcase": "4.3.0" 704 | } 705 | }, 706 | "mimic-fn": { 707 | "version": "1.2.0", 708 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 709 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" 710 | }, 711 | "minimatch": { 712 | "version": "3.0.4", 713 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 714 | "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", 715 | "dev": true, 716 | "requires": { 717 | "brace-expansion": "1.1.11" 718 | } 719 | }, 720 | "minimist": { 721 | "version": "1.2.0", 722 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 723 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 724 | }, 725 | "mkdirp": { 726 | "version": "0.5.1", 727 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 728 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 729 | "requires": { 730 | "minimist": "0.0.8" 731 | }, 732 | "dependencies": { 733 | "minimist": { 734 | "version": "0.0.8", 735 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 736 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 737 | } 738 | } 739 | }, 740 | "ms": { 741 | "version": "2.0.0", 742 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 743 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 744 | }, 745 | "mute-stream": { 746 | "version": "0.0.6", 747 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz", 748 | "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=" 749 | }, 750 | "nan": { 751 | "version": "2.10.0", 752 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", 753 | "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" 754 | }, 755 | "no-case": { 756 | "version": "2.3.2", 757 | "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", 758 | "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", 759 | "requires": { 760 | "lower-case": "1.1.4" 761 | } 762 | }, 763 | "node-appletv": { 764 | "version": "1.0.5", 765 | "resolved": "https://registry.npmjs.org/node-appletv/-/node-appletv-1.0.5.tgz", 766 | "integrity": "sha512-DFCW1Rr7vujDjvrdcjc25aWdXp3npZyvS5R798uvq6iZ7ZW+ozq8/5ZjpayWVoDLkTU6gYiz15yQQ5tP145XNA==", 767 | "requires": { 768 | "camelcase": "4.1.0", 769 | "caporal": "0.10.0", 770 | "curve25519-n2": "1.1.3", 771 | "ed25519": "0.0.4", 772 | "fast-srp-hap": "1.0.1", 773 | "inquirer": "5.2.0", 774 | "mdns": "2.3.4", 775 | "ora": "2.0.0", 776 | "protobufjs": "6.8.6", 777 | "snake-case": "2.1.0", 778 | "sodium": "2.0.3", 779 | "uuid": "3.2.1", 780 | "varint": "5.0.0" 781 | }, 782 | "dependencies": { 783 | "uuid": { 784 | "version": "3.2.1", 785 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", 786 | "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" 787 | } 788 | } 789 | }, 790 | "npmlog": { 791 | "version": "2.0.4", 792 | "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", 793 | "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", 794 | "requires": { 795 | "ansi": "0.3.1", 796 | "are-we-there-yet": "1.1.4", 797 | "gauge": "1.2.7" 798 | } 799 | }, 800 | "number-is-nan": { 801 | "version": "1.0.1", 802 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 803 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 804 | }, 805 | "object-assign": { 806 | "version": "4.1.1", 807 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 808 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 809 | }, 810 | "once": { 811 | "version": "1.4.0", 812 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 813 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 814 | "dev": true, 815 | "requires": { 816 | "wrappy": "1.0.2" 817 | } 818 | }, 819 | "onetime": { 820 | "version": "1.1.0", 821 | "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", 822 | "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" 823 | }, 824 | "ora": { 825 | "version": "2.0.0", 826 | "resolved": "https://registry.npmjs.org/ora/-/ora-2.0.0.tgz", 827 | "integrity": "sha512-g+IR0nMUXq1k4nE3gkENbN4wkF0XsVZFyxznTF6CdmwQ9qeTGONGpSR9LM5//1l0TVvJoJF3MkMtJp6slUsWFg==", 828 | "requires": { 829 | "chalk": "2.3.2", 830 | "cli-cursor": "2.1.0", 831 | "cli-spinners": "1.2.0", 832 | "log-symbols": "2.2.0", 833 | "strip-ansi": "4.0.0", 834 | "wcwidth": "1.0.1" 835 | }, 836 | "dependencies": { 837 | "ansi-regex": { 838 | "version": "3.0.0", 839 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 840 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" 841 | }, 842 | "ansi-styles": { 843 | "version": "3.2.1", 844 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 845 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 846 | "requires": { 847 | "color-convert": "1.9.1" 848 | } 849 | }, 850 | "chalk": { 851 | "version": "2.3.2", 852 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", 853 | "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", 854 | "requires": { 855 | "ansi-styles": "3.2.1", 856 | "escape-string-regexp": "1.0.5", 857 | "supports-color": "5.3.0" 858 | } 859 | }, 860 | "cli-cursor": { 861 | "version": "2.1.0", 862 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 863 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 864 | "requires": { 865 | "restore-cursor": "2.0.0" 866 | } 867 | }, 868 | "onetime": { 869 | "version": "2.0.1", 870 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 871 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 872 | "requires": { 873 | "mimic-fn": "1.2.0" 874 | } 875 | }, 876 | "restore-cursor": { 877 | "version": "2.0.0", 878 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 879 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 880 | "requires": { 881 | "onetime": "2.0.1", 882 | "signal-exit": "3.0.2" 883 | } 884 | }, 885 | "strip-ansi": { 886 | "version": "4.0.0", 887 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 888 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 889 | "requires": { 890 | "ansi-regex": "3.0.0" 891 | } 892 | }, 893 | "supports-color": { 894 | "version": "5.3.0", 895 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", 896 | "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", 897 | "requires": { 898 | "has-flag": "3.0.0" 899 | } 900 | } 901 | } 902 | }, 903 | "os-shim": { 904 | "version": "0.1.3", 905 | "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", 906 | "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=" 907 | }, 908 | "os-tmpdir": { 909 | "version": "1.0.2", 910 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 911 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 912 | }, 913 | "path-is-absolute": { 914 | "version": "1.0.1", 915 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 916 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 917 | "dev": true 918 | }, 919 | "pinkie": { 920 | "version": "2.0.4", 921 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 922 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" 923 | }, 924 | "pinkie-promise": { 925 | "version": "2.0.1", 926 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 927 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", 928 | "requires": { 929 | "pinkie": "2.0.4" 930 | } 931 | }, 932 | "prettyjson": { 933 | "version": "1.2.1", 934 | "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", 935 | "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", 936 | "requires": { 937 | "colors": "1.2.1", 938 | "minimist": "1.2.0" 939 | } 940 | }, 941 | "process-nextick-args": { 942 | "version": "2.0.0", 943 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", 944 | "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" 945 | }, 946 | "protobufjs": { 947 | "version": "6.8.6", 948 | "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.6.tgz", 949 | "integrity": "sha512-eH2OTP9s55vojr3b7NBaF9i4WhWPkv/nq55nznWNp/FomKrLViprUcqnBjHph2tFQ+7KciGPTPsVWGz0SOhL0Q==", 950 | "requires": { 951 | "@protobufjs/aspromise": "1.1.2", 952 | "@protobufjs/base64": "1.1.2", 953 | "@protobufjs/codegen": "2.0.4", 954 | "@protobufjs/eventemitter": "1.1.0", 955 | "@protobufjs/fetch": "1.1.0", 956 | "@protobufjs/float": "1.0.2", 957 | "@protobufjs/inquire": "1.1.0", 958 | "@protobufjs/path": "1.1.2", 959 | "@protobufjs/pool": "1.1.0", 960 | "@protobufjs/utf8": "1.1.0", 961 | "@types/long": "3.0.32", 962 | "@types/node": "8.10.1", 963 | "long": "4.0.0" 964 | }, 965 | "dependencies": { 966 | "@types/node": { 967 | "version": "8.10.1", 968 | "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.1.tgz", 969 | "integrity": "sha512-X/pIUOcgpX7xxKsmdPCMKeDBefsGH/4D/IuJ1gIHbqgWI0qEy/yMKeqaN/sT+rzV9UpAXAfd0kLOVExRmZrXIg==" 970 | } 971 | } 972 | }, 973 | "readable-stream": { 974 | "version": "2.3.5", 975 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", 976 | "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", 977 | "requires": { 978 | "core-util-is": "1.0.2", 979 | "inherits": "2.0.3", 980 | "isarray": "1.0.0", 981 | "process-nextick-args": "2.0.0", 982 | "safe-buffer": "5.1.1", 983 | "string_decoder": "1.0.3", 984 | "util-deprecate": "1.0.2" 985 | } 986 | }, 987 | "restore-cursor": { 988 | "version": "1.0.1", 989 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", 990 | "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", 991 | "requires": { 992 | "exit-hook": "1.1.1", 993 | "onetime": "1.1.0" 994 | } 995 | }, 996 | "rimraf": { 997 | "version": "2.6.2", 998 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", 999 | "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", 1000 | "dev": true, 1001 | "requires": { 1002 | "glob": "7.1.2" 1003 | } 1004 | }, 1005 | "run-async": { 1006 | "version": "2.3.0", 1007 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", 1008 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", 1009 | "requires": { 1010 | "is-promise": "2.1.0" 1011 | } 1012 | }, 1013 | "rx": { 1014 | "version": "4.1.0", 1015 | "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", 1016 | "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=" 1017 | }, 1018 | "rxjs": { 1019 | "version": "5.5.8", 1020 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.8.tgz", 1021 | "integrity": "sha512-Bz7qou7VAIoGiglJZbzbXa4vpX5BmTTN2Dj/se6+SwADtw4SihqBIiEa7VmTXJ8pynvq0iFr5Gx9VLyye1rIxQ==", 1022 | "requires": { 1023 | "symbol-observable": "1.0.1" 1024 | } 1025 | }, 1026 | "safe-buffer": { 1027 | "version": "5.1.1", 1028 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 1029 | "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" 1030 | }, 1031 | "signal-exit": { 1032 | "version": "3.0.2", 1033 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1034 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 1035 | }, 1036 | "snake-case": { 1037 | "version": "2.1.0", 1038 | "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", 1039 | "integrity": "sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8=", 1040 | "requires": { 1041 | "no-case": "2.3.2" 1042 | } 1043 | }, 1044 | "sodium": { 1045 | "version": "2.0.3", 1046 | "resolved": "https://registry.npmjs.org/sodium/-/sodium-2.0.3.tgz", 1047 | "integrity": "sha512-/z1tdOf+tn+MZr6uiKno709w2V5LwqukNWxOWi6NiSBia5E7Fp33f3CUHtCIR2184DEylytXdTZNryQUQwNKkQ==", 1048 | "requires": { 1049 | "nan": "2.10.0" 1050 | } 1051 | }, 1052 | "spawn-sync": { 1053 | "version": "1.0.15", 1054 | "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", 1055 | "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", 1056 | "requires": { 1057 | "concat-stream": "1.6.2", 1058 | "os-shim": "0.1.3" 1059 | } 1060 | }, 1061 | "stack-trace": { 1062 | "version": "0.0.10", 1063 | "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", 1064 | "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" 1065 | }, 1066 | "string-width": { 1067 | "version": "1.0.2", 1068 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1069 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1070 | "requires": { 1071 | "code-point-at": "1.1.0", 1072 | "is-fullwidth-code-point": "1.0.0", 1073 | "strip-ansi": "3.0.1" 1074 | } 1075 | }, 1076 | "string_decoder": { 1077 | "version": "1.0.3", 1078 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", 1079 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", 1080 | "requires": { 1081 | "safe-buffer": "5.1.1" 1082 | } 1083 | }, 1084 | "strip-ansi": { 1085 | "version": "3.0.1", 1086 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1087 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1088 | "requires": { 1089 | "ansi-regex": "2.1.1" 1090 | } 1091 | }, 1092 | "supports-color": { 1093 | "version": "2.0.0", 1094 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1095 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" 1096 | }, 1097 | "symbol-observable": { 1098 | "version": "1.0.1", 1099 | "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", 1100 | "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" 1101 | }, 1102 | "tabtab": { 1103 | "version": "2.2.2", 1104 | "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-2.2.2.tgz", 1105 | "integrity": "sha1-egR/FDsBC0y9MfhX6ClhUSy/ThQ=", 1106 | "requires": { 1107 | "debug": "2.6.9", 1108 | "inquirer": "1.2.3", 1109 | "lodash.difference": "4.5.0", 1110 | "lodash.uniq": "4.5.0", 1111 | "minimist": "1.2.0", 1112 | "mkdirp": "0.5.1", 1113 | "npmlog": "2.0.4", 1114 | "object-assign": "4.1.1" 1115 | }, 1116 | "dependencies": { 1117 | "inquirer": { 1118 | "version": "1.2.3", 1119 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz", 1120 | "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", 1121 | "requires": { 1122 | "ansi-escapes": "1.4.0", 1123 | "chalk": "1.1.3", 1124 | "cli-cursor": "1.0.2", 1125 | "cli-width": "2.2.0", 1126 | "external-editor": "1.1.1", 1127 | "figures": "1.7.0", 1128 | "lodash": "4.17.5", 1129 | "mute-stream": "0.0.6", 1130 | "pinkie-promise": "2.0.1", 1131 | "run-async": "2.3.0", 1132 | "rx": "4.1.0", 1133 | "string-width": "1.0.2", 1134 | "strip-ansi": "3.0.1", 1135 | "through": "2.3.8" 1136 | } 1137 | }, 1138 | "lodash": { 1139 | "version": "4.17.5", 1140 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", 1141 | "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" 1142 | } 1143 | } 1144 | }, 1145 | "through": { 1146 | "version": "2.3.8", 1147 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1148 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1149 | }, 1150 | "tmp": { 1151 | "version": "0.0.29", 1152 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", 1153 | "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", 1154 | "requires": { 1155 | "os-tmpdir": "1.0.2" 1156 | } 1157 | }, 1158 | "typedarray": { 1159 | "version": "0.0.6", 1160 | "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", 1161 | "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" 1162 | }, 1163 | "typescript": { 1164 | "version": "2.7.2", 1165 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", 1166 | "integrity": "sha1-LWFaHvSu5PV0Qlzf9wJu34GRmDY=", 1167 | "dev": true 1168 | }, 1169 | "util-deprecate": { 1170 | "version": "1.0.2", 1171 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1172 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1173 | }, 1174 | "varint": { 1175 | "version": "5.0.0", 1176 | "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.0.tgz", 1177 | "integrity": "sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8=" 1178 | }, 1179 | "wcwidth": { 1180 | "version": "1.0.1", 1181 | "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", 1182 | "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", 1183 | "requires": { 1184 | "defaults": "1.0.3" 1185 | } 1186 | }, 1187 | "winston": { 1188 | "version": "2.4.1", 1189 | "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.1.tgz", 1190 | "integrity": "sha512-k/+Dkzd39ZdyJHYkuaYmf4ff+7j+sCIy73UCOWHYA67/WXU+FF/Y6PF28j+Vy7qNRPHWO+dR+/+zkoQWPimPqg==", 1191 | "requires": { 1192 | "async": "1.0.0", 1193 | "colors": "1.0.3", 1194 | "cycle": "1.0.3", 1195 | "eyes": "0.1.8", 1196 | "isstream": "0.1.2", 1197 | "stack-trace": "0.0.10" 1198 | }, 1199 | "dependencies": { 1200 | "colors": { 1201 | "version": "1.0.3", 1202 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", 1203 | "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" 1204 | } 1205 | } 1206 | }, 1207 | "wrappy": { 1208 | "version": "1.0.2", 1209 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1210 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1211 | "dev": true 1212 | } 1213 | } 1214 | } 1215 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "homebridge-theater-mode", 3 | "version": "1.0.2", 4 | "description": "A homebridge plugin for reacting to Apple TV play/pause events.", 5 | "license": "MIT", 6 | "main": "dist/index.js", 7 | "scripts": { 8 | "prepublish": "npm run build", 9 | "build": "npm run clean && tsc", 10 | "clean": "rimraf dist" 11 | }, 12 | "keywords": [ 13 | "homebridge-plugin", 14 | "appletv" 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/edc1591/homebridge-theater-mode.git" 19 | }, 20 | "bugs": { 21 | "url": "http://github.com/edc1591/homebridge-theater-mode/issues" 22 | }, 23 | "engines": { 24 | "node": ">=0.12.0", 25 | "homebridge": ">=0.2.0" 26 | }, 27 | "devDependencies": { 28 | "@types/mdns": "0.0.32", 29 | "@types/node": "^9.4.6", 30 | "rimraf": "^2.6.2", 31 | "typescript": "^2.7.2" 32 | }, 33 | "dependencies": { 34 | "node-appletv": "^1.0.5" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | var Service, Characteristic; 2 | import { scan, parseCredentials, NowPlayingInfo, AppleTV, SupportedCommand } from 'node-appletv'; 3 | 4 | export = function(homebridge: any) { 5 | Service = homebridge.hap.Service; 6 | Characteristic = homebridge.hap.Characteristic; 7 | homebridge.registerAccessory('homebridge-theater-mode', 'AppleTVTheaterMode', AppleTVProgrammableSwitch); 8 | } 9 | 10 | class AppleTVProgrammableSwitch { 11 | private services: any[]; 12 | private switchService: any; 13 | private playService: any; 14 | private pauseService: any; 15 | private stopService: any; 16 | 17 | private device: AppleTV; 18 | private playbackState: AppleTVProgrammableSwitch.PlaybackState = AppleTVProgrammableSwitch.PlaybackState.Stopped; 19 | private isEnabled: boolean = false; 20 | 21 | constructor(private log: (string) => void, config: any) { 22 | let credentials = parseCredentials(config.credentials); 23 | let that = this; 24 | scan(credentials.uniqueIdentifier) 25 | .then(devices => { 26 | that.device = devices[0]; 27 | that.device.on('error', (error: Error) => { 28 | that.log(error.message); 29 | that.log(error.stack); 30 | }); 31 | return that.device.openConnection(credentials); 32 | }) 33 | .then(device => { 34 | log("Opened connection to " + config.name); 35 | }) 36 | .catch(error => { 37 | that.log(error); 38 | }); 39 | } 40 | 41 | private isPlaying(): boolean { 42 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Playing; 43 | } 44 | 45 | private isPaused(): boolean { 46 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Paused; 47 | } 48 | 49 | private isStopped(): boolean { 50 | return this.playbackState == AppleTVProgrammableSwitch.PlaybackState.Stopped; 51 | } 52 | 53 | private setEnabled(value: boolean) { 54 | this.log("Setting theater mode enabled to " + value); 55 | this.isEnabled = value; 56 | 57 | if (value) { 58 | let that = this; 59 | this.device.on('supportedCommands', (commands: SupportedCommand[]) => { 60 | if (commands.length == 0 && (that.isPlaying() || that.isPaused())) { 61 | that.triggerStop(); 62 | } 63 | }) 64 | .on('nowPlaying', (info: NowPlayingInfo) => { 65 | if (info == null) { 66 | return; 67 | } 68 | 69 | let stateIsPlaying = info.playbackState == NowPlayingInfo.State.Playing; 70 | let stateIsPaused = info.playbackState == NowPlayingInfo.State.Paused; 71 | if (stateIsPlaying && !that.isPlaying()) { 72 | that.triggerPlay(); 73 | } else if (stateIsPaused && that.isPlaying()) { 74 | that.triggerPause(); 75 | } 76 | }); 77 | } else { 78 | this.device.removeAllListeners('nowPlaying'); 79 | this.device.removeAllListeners('supportedCommands'); 80 | } 81 | } 82 | 83 | identify(callback: () => void) { 84 | this.log('Identify requested!'); 85 | callback(); 86 | } 87 | 88 | getServices(): any[] { 89 | if (this.services != null) { 90 | return this.services; 91 | } 92 | 93 | let informationService = new Service.AccessoryInformation(); 94 | informationService 95 | .setCharacteristic(Characteristic.Manufacturer, 'Apple') 96 | .setCharacteristic(Characteristic.Model, 'Apple TV') 97 | .setCharacteristic(Characteristic.SerialNumber, '00000000'); 98 | 99 | this.switchService = new Service.Switch("Theater Mode", "Theater Mode"); 100 | let that = this; 101 | this.switchService 102 | .getCharacteristic(Characteristic.On) 103 | .on('get', callback => { 104 | callback(null, that.isEnabled); 105 | }) 106 | .on('set', (value, callback) => { 107 | that.setEnabled(value); 108 | callback(); 109 | }); 110 | 111 | this.playService = new Service.StatelessProgrammableSwitch("Play", "Play"); 112 | this.playService 113 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 114 | .setProps({ maxValue: 0 }); 115 | this.playService 116 | .getCharacteristic(Characteristic.ServiceLabelIndex) 117 | .setValue(1); 118 | 119 | this.pauseService = new Service.StatelessProgrammableSwitch("Pause", "Pause"); 120 | this.pauseService 121 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 122 | .setProps({ maxValue: 0 }); 123 | this.pauseService 124 | .getCharacteristic(Characteristic.ServiceLabelIndex) 125 | .setValue(2); 126 | 127 | this.stopService = new Service.StatelessProgrammableSwitch("Stop", "Stop"); 128 | this.stopService 129 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 130 | .setProps({ maxValue: 0 }); 131 | this.stopService 132 | .getCharacteristic(Characteristic.ServiceLabelIndex) 133 | .setValue(3); 134 | 135 | this.services = [ 136 | informationService, 137 | this.switchService, 138 | this.playService, 139 | this.pauseService, 140 | this.stopService 141 | ]; 142 | 143 | return this.services; 144 | } 145 | 146 | private triggerPlay() { 147 | if (!this.isEnabled) { return; } 148 | this.log("Triggering Play Switch Event"); 149 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Playing; 150 | this.playService 151 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 152 | .setValue(0); 153 | } 154 | 155 | private triggerPause() { 156 | if (!this.isEnabled) { return; } 157 | this.log("Triggering Pause Switch Event"); 158 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Paused; 159 | this.pauseService 160 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 161 | .setValue(0); 162 | } 163 | 164 | private triggerStop() { 165 | if (!this.isEnabled) { return; } 166 | this.log("Triggering Stop Switch Event"); 167 | this.playbackState = AppleTVProgrammableSwitch.PlaybackState.Stopped; 168 | this.stopService 169 | .getCharacteristic(Characteristic.ProgrammableSwitchEvent) 170 | .setValue(0); 171 | } 172 | } 173 | 174 | module AppleTVProgrammableSwitch { 175 | export enum PlaybackState { 176 | Playing = "playing", 177 | Paused = "paused", 178 | Stopped = "stopped" 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "moduleResolution": "node", 5 | "target": "es5", 6 | "lib": [ 7 | "es2015", 8 | "es2015.promise" 9 | ], 10 | "outDir": "./dist" 11 | }, 12 | "include": [ 13 | "src/**/*" 14 | ], 15 | "exclude": [ 16 | "node_modules" 17 | ] 18 | } --------------------------------------------------------------------------------