Commit 0e07208c authored by Samuel Elliott's avatar Samuel Elliott

Make node-applets optional

parent d74fb9fe
......@@ -5,6 +5,10 @@ Homebridge plugin for controlling Vestel smart TVs. [Vestel manufactures TVs as
[(I wouldn't recommend these TVs as they have no security at all.)](https://www.av-comparatives.org/security-flaws-firmware-used-30-popular-tv-brands/)
```
npm install -g homebridge
npm install -g git+https://gitlab.fancy.org.uk/samuel/homebridge-vestel-network-remote
```
```json
{
"accessory": "vestel-network-remote.TV",
......@@ -31,7 +35,14 @@ To turn the TV on you need another device capable of turning the TV on with HDMI
### Apple TV 4th generation
1. Run `/usr/local/lib/node_modules/homebridge-vestel-network-remote/node_modules/.bin/appletv pair` (from `node-appletv`) to create a pairing identifier.
Using an Apple TV 4th generation requires `node-appletv`. This isn't listed as a dependency so you need to install it seperately.
```
# https://github.com/socalrds/node-appletv uses a working sodium
npm install -g socalrds/node-appletv
```
1. Run `appletv pair` to create a pairing identifier.
2. Add the credentials string to your `config.json`. You can split it at the colons if you want.
```json
......
This diff is collapsed.
......@@ -19,10 +19,14 @@
},
"dependencies": {
"@langovoi/upnp-device-client": "^1.0.6",
"node-appletv": "github:socalrds/node-appletv",
"node-persist": "0.0.11",
"vestel-network-remote": "git+https://gitlab.fancy.org.uk/samuel/vestel-network-remote"
},
"devDependencies": {
"hap-nodejs": "^0.4.48"
"hap-nodejs": "^0.4.48",
"node-appletv": "github:socalrds/node-appletv"
},
"peerDependencies": {
"node-appletv": "github:socalrds/node-appletv"
}
}
const persist = require('node-persist');
const AppleTV = require('node-appletv');
const {VestelNetworkRemote, VestelFollowTV} = require('vestel-network-remote');
const UPnPClient = require('@langovoi/upnp-device-client');
......@@ -81,6 +80,8 @@ class TVAccessory {
// Connect to an Apple TV
// This is used to turn the TV on
if (config.apple_tv) {
const AppleTV = require('node-appletv');
const credentials = typeof config.apple_tv === 'string'
? AppleTV.parseCredentials(config.apple_tv) : typeof config.apple_tv === 'array'
? AppleTV.parseCredentials(config.apple_tv.join(':')) : new AppleTV.Credentials(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment