Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge crashes when turning on theater mode #4

Open
pccaredk opened this issue Apr 23, 2018 · 1 comment
Open

Homebridge crashes when turning on theater mode #4

pccaredk opened this issue Apr 23, 2018 · 1 comment

Comments

@pccaredk
Copy link

/usr/local/lib/node_modules/homebridge-theater-mode/dist/index.js:41
this.device.on('supportedCommands', function (commands) {
^
TypeError: Cannot read property 'on' of undefined
at AppleTVProgrammableSwitch.setEnabled (/usr/local/lib/node_modules/homebridge-theater-mode/dist/index.js:41:25)
at Characteristic.On. (/usr/local/lib/node_modules/homebridge-theater-mode/dist/index.js:86:18)
at emitMany (events.js:147:13)
at Characteristic.On.emit (events.js:224:7)
at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:319:10)
at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:867:22)
at Array.forEach ()
at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:807:8)
at emitMany (events.js:147:13)
at HAPServer.emit (events.js:224:7)
at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
at HAPServer. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
at emitNone (events.js:106:13)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)

@vdesabou
Copy link

I got the same problem. Posting here how I worked around it:

My network is pretty slow so I got this:

Sep 14 14:56:51 raspberrypi homebridge[1239]: [2018-9-14 14:56:51] [Apple TV Salon] Error: Failed to locate specified AppleTV on the network
Sep 14 14:56:51 raspberrypi homebridge[1239]:     at Timeout.setTimeout (/opt/node/lib/node_modules/homebridge-theater-mode/node_modules/node-appletv/dist/lib/browser.js:48:28)
Sep 14 14:56:51 raspberrypi homebridge[1239]:     at ontimeout (timers.js:466:11)
Sep 14 14:56:51 raspberrypi homebridge[1239]:     at tryOnTimeout (timers.js:304:5)
Sep 14 14:56:51 raspberrypi homebridge[1239]:     at Timer.listOnTimeout (timers.js:267:5)

So I edited the file /opt/node/lib/node_modules/homebridge-theater-mode/node_modules/node-appletv/dist/lib/browser.js to increase timeout from 5 seconds to 30 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants