Commit 03754ee2 authored by Samuel Elliott's avatar Samuel Elliott

Add accessory information and power state timeout options to the README

parent 75428c6f
......@@ -32,6 +32,22 @@ set a static IP address on the TV.
[Apparently Vestel TVs support a lot more commands.](https://forum.digitalfernsehen.de/threads/medion-md-30465-42-led-backlight-tv-life%C2%AE-x17006.276321/page-64#post-7474289)
I haven't tested all of these.
### Accessory information
You can set the manufacturer, model and serial number of your TV if you want to. By default the IP address is used as
the serial number.
```json
{
"accessory": "vestel-network-remote.TV",
"name": "Samuel's Bedroom TV",
"ip_address": "192.168.3.223",
"manufacturer": "Vestel",
"model": "Model Number",
"serial_number": "Serial Number"
}
```
### Multiple TVs
If you have multiple TVs they should be published separately as the iOS TV Remote only allows one Television service
......@@ -94,6 +110,21 @@ npm install -g socalrds/node-appletv
}
```
### Power state timeout
The current power state is checked by trying to connect to the TV. By default if the TV doesn't respond within
2000 milliseconds it is assumed the TV is off. If two seconds is too long/too short you can change it.
```json
{
"accessory": "vestel-network-remote.TV",
"name": "Samuel's Bedroom TV",
"ip_address": "192.168.3.223",
"apple_tv": "00000000-0000-0000-0000-000000000000:000000000000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000",
"tv_power_timeout": 1000
}
```
Controlling volume
---
......
......@@ -460,7 +460,8 @@ class TVAccessory {
await this.apple_tv.sendKeyCommand(AppleTV.AppleTV.Key.Menu);
this.last_input_switched = this.apple_tv_input;
if (this.expose_television_service) this.tv_service.getCharacteristic(this.constructor.hap.Characteristic.ActiveIdentifier).updateValue(this.apple_tv_input);
if (this.expose_television_service) this.tv_service
.getCharacteristic(this.constructor.hap.Characteristic.ActiveIdentifier).updateValue(this.apple_tv_input);
} catch (err) {
this.log.error(err);
throw err;
......@@ -528,15 +529,21 @@ class TVAccessory {
handleMediaRendererEvent(event) {
if (event.Volume) {
if (this.expose_television_speaker_service) this.tv_speaker_service.getCharacteristic(this.constructor.hap.Characteristic.Volume).updateValue(parseInt(event.Volume));
if (this.expose_speaker_service) this.speaker_service.getCharacteristic(this.constructor.hap.Characteristic.Volume).updateValue(parseInt(event.Volume));
if (this.expose_speaker_lightbulb_service) this.speaker_lightbulb_service.getCharacteristic(this.constructor.hap.Characteristic.Brightness).updateValue(parseInt(event.Volume));
if (this.expose_television_speaker_service) this.tv_speaker_service
.getCharacteristic(this.constructor.hap.Characteristic.Volume).updateValue(parseInt(event.Volume));
if (this.expose_speaker_service) this.speaker_service
.getCharacteristic(this.constructor.hap.Characteristic.Volume).updateValue(parseInt(event.Volume));
if (this.expose_speaker_lightbulb_service) this.speaker_lightbulb_service
.getCharacteristic(this.constructor.hap.Characteristic.Brightness).updateValue(parseInt(event.Volume));
}
if (event.Mute) {
if (this.expose_television_speaker_service) this.tv_speaker_service.getCharacteristic(this.constructor.hap.Characteristic.Mute).updateValue(!!parseInt(event.Mute));
if (this.expose_speaker_service) this.speaker_service.getCharacteristic(this.constructor.hap.Characteristic.Mute).updateValue(!!parseInt(event.Mute));
if (this.expose_speaker_lightbulb_service) this.speaker_lightbulb_service.getCharacteristic(this.constructor.hap.Characteristic.On).updateValue(!parseInt(event.Mute));
if (this.expose_television_speaker_service) this.tv_speaker_service
.getCharacteristic(this.constructor.hap.Characteristic.Mute).updateValue(!!parseInt(event.Mute));
if (this.expose_speaker_service) this.speaker_service
.getCharacteristic(this.constructor.hap.Characteristic.Mute).updateValue(!!parseInt(event.Mute));
if (this.expose_speaker_lightbulb_service) this.speaker_lightbulb_service
.getCharacteristic(this.constructor.hap.Characteristic.On).updateValue(!parseInt(event.Mute));
}
}
......
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