Crash when using the Apple TV remote app
JeroenVdb opened this issue ยท 6 comments
Describe The Bug:
I can't use the Apple TV Remote to control the set-top-box. Whenever I try to use it the plugin crashes and homebridge is restarted. Other features of this plugin work: box on/off, list of channels, select another channel, etc...
To Reproduce:
- TV Box is on
- Go the the Apple TV Remote
- Select the set-top-box
- Press any button (tried left, right, back)
Expected behavior:
The buttons from the remote should be emulated.
Logs:
[1/21/2022, 9:58:53 AM] TypeError: Cannot read properties of undefined (reading 'arrowLeftButton')
at stbDevice.setRemoteKey (/homebridge/node_modules/homebridge-eosstb/index.js:3722:45)
at RemoteKey.emit (node:events:390:28)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1668:16
at new Promise (<anonymous>)
at RemoteKey.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1666:14)
at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
[1/21/2022, 10:17:22 AM] [EOSSTB] Telenet TV: setRemoteKey remoteKey: 7
[1/21/2022, 10:17:22 AM] TypeError: Cannot read properties of undefined (reading 'arrowRightButton')
at stbDevice.setRemoteKey (/homebridge/node_modules/homebridge-eosstb/index.js:3729:45)
at RemoteKey.emit (node:events:390:28)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1668:16
at new Promise (<anonymous>)
at RemoteKey.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1666:14)
at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
[1/21/2022, 10:17:22 AM] Got SIGTERM, shutting down Homebridge...
[1/21/2022, 10:17:27 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[1/21/2022, 10:17:32 AM] [HB Supervisor] Restarting Homebridge...
Plugin Config:
{
"bridge": {
"name": "Homebridge E8D4",
"username": "XXX",
"port": 52034,
"pin": "XXX"
},
"accessories": [],
"platforms": [
{
"name": "Config",
"port": 8082,
"platform": "config"
},
{
"name": "EOSSTB",
"country": "be-nl",
"username": "XXX",
"password": "XXX",
"doublePressTime": 250,
"doublePressDelayTime": 300,
"debugLevel": 3,
"devices": [
{
"syncName": true,
"accessoryCategory": "settopbox",
"showChannelNumbers": false,
"maxChannels": 95,
"arrowUpButton": "ArrowUp",
"arrowUpButtonDoubleTap": "ChannelUp",
"arrowDownButton": "ArrowDown",
"arrowDownButtonDoubleTap": "ChannelDown",
"arrowLeftButton": "ArrowLeft",
"arrowLeftButtonDoubleTap": "MediaRewind",
"arrowRightButton": "ArrowRight",
"arrowRightButtonDoubleTap": "MediaFastForward",
"selectButton": "Enter",
"selectButtonDoubleTap": "Enter",
"playPauseButton": "MediaPlayPause",
"playPauseButtonDoubleTap": "MediaPlayPause",
"backButton": "Escape",
"backButtonDoubleTap": "Escape",
"infoButton": "MediaTopMenu",
"infoButtonDoubleTap": "Guide",
"viewTvSettingsCommand": "Help"
}
],
"channels": [
{
"channelId": "com.libertyglobal.app.youtube",
"channelName": "YouTube"
},
{
"channelId": "be.vrt.vrtnu",
"channelName": "VRT NU"
},
{
"channelId": "com.libertyglobal.app.netflix",
"channelName": "Netflix"
}
],
"platform": "eosstb"
}
]
}
Screenshots:
Environment:
- Plugin Version:
- Homebridge Version: v1.3.9
- Node.js Version: v16.13.2
- NPM Version: v8.1.2
- Operating System: Docker, Alpine Linux (3.12.9)
Interesting. What eosstb plugin version are you using?
I installed it yesterday, so the latest: homebridge-eosstb v1.2.1
When I console.log this.config.devices
I see on line 3669 I get this:
[
{
syncName: true,
accessoryCategory: 'settopbox',
showChannelNumbers: false,
maxChannels: 95,
arrowUpButton: 'ArrowUp',
arrowUpButtonDoubleTap: 'ChannelUp',
arrowDownButton: 'ArrowDown',
arrowDownButtonDoubleTap: 'ChannelDown',
arrowLeftButton: 'ArrowLeft',
arrowLeftButtonDoubleTap: 'MediaRewind',
arrowRightButton: 'ArrowRight',
arrowRightButtonDoubleTap: 'MediaFastForward',
selectButton: 'Enter',
selectButtonDoubleTap: 'Enter',
playPauseButton: 'MediaPlayPause',
playPauseButtonDoubleTap: 'MediaPlayPause',
backButton: 'Escape',
backButtonDoubleTap: 'Escape',
infoButton: 'MediaTopMenu',
infoButtonDoubleTap: 'Guide',
viewTvSettingsCommand: 'Help'
}
]
I guess the problem is that my device has no deviceId
. I'll have not set it via config, I'll try to set it via config and see if it then is selected correctly.
@jsiegenthaler adding deviceId
resolved the problem ๐. I might have missed it in the config but I thought this was not mandatory.
The device can not be selected when it has no deviceId
here: https://github.com/jsiegenthaler/homebridge-eosstb/blob/master/index.js#L3670
Should the deviceId
not be set in the script when not provided in the config?
Thanks for that info, I'll review my code and try and reproduce the error you saw.
I'll also review what my code is doing regarding the deviceId...
In the meantime enjoy the plugin :)
Root cause found and all fixed in v1.2.2