lprhodes / homebridge-apple-tv

Apple TV 4th & 5th gen plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
105 stars 15 forks source link

Default Switches "showDefaultSwitches": true #11

Open DJay-X opened 6 years ago

DJay-X commented 6 years ago

Default Switches "showDefaultSwitches": true didn't work here. The switches are showing up do not auto switch off when pressed and they don't send a command to Apple TV

{
            "platform": "AppleTV",
            "hideWelcomeMessage": true,
            "showDefaultSwitches": true,
            "name": "Apple TV 4k",
            "devices": [
                {
                    "id": "lounge",
                    "name": "Lounge Apple TV",
                    "credentials": "xxxxx-xxxxxxx"
                }
            ],
            "accessories": [
                {
                    "deviceID": "lounge",
                    "name": "Hoch",
                    "command": "up"
                }
            ]
        },
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Play (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Sleep (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Pause (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Down (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Select (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Left (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Right (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] TV/Home (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:32 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:32] [Apple TV 4k] Menu (Lounge Apple TV) getSwitchState: false
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:51] [Apple TV 4k] TV/Home (Lounge Apple TV) setSwitchState: true
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:54:51] [Apple TV 4k] TV/Home (Lounge Apple TV) sendCommand (tv)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]: (node:298) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sendKeyPressAndRelease' of undefined
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at module.exports (/usr/local/lib/node_modules/homebridge-apple-tv/helpers/sendCommand.js:37:21)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.performSend (/usr/local/lib/node_modules/homebridge-apple-tv/accessories/accessory.js:39:7)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.setSwitchState (/usr/local/lib/node_modules/homebridge-apple-tv/accessories/switch.js:78:29)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.setCharacteristicValue (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/homebridge-platform-helper/accessory.js:139:10)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at Characteristic.On.emit (events.js:180:13)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:319:10)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:867:22)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at Array.forEach (<anonymous>)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:807:8)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at HAPServer.emit (events.js:180:13)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at IncomingMessage.emit (events.js:180:13)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at endReadableNT (_stream_readable.js:1106:12)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]:     at process._tickCallback (internal/process/next_tick.js:114:19)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]: (node:298) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
Apr 04 13:54:51 raspberrypi-3BPlus homebridge[298]: (node:298) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:55:07] [Apple TV 4k] Up (Lounge Apple TV) setSwitchState: true
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]: [2018-4-4 13:55:07] [Apple TV 4k] Up (Lounge Apple TV) sendCommand (up)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]: (node:298) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sendKeyPressAndRelease' of undefined
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at module.exports (/usr/local/lib/node_modules/homebridge-apple-tv/helpers/sendCommand.js:10:21)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.performSend (/usr/local/lib/node_modules/homebridge-apple-tv/accessories/accessory.js:39:7)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.setSwitchState (/usr/local/lib/node_modules/homebridge-apple-tv/accessories/switch.js:78:29)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at SwitchAccessory.setCharacteristicValue (/usr/local/lib/node_modules/homebridge-apple-tv/node_modules/homebridge-platform-helper/accessory.js:139:10)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at Characteristic.On.emit (events.js:180:13)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:319:10)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:867:22)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at Array.forEach (<anonymous>)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:807:8)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at HAPServer.emit (events.js:180:13)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at IncomingMessage.emit (events.js:180:13)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at endReadableNT (_stream_readable.js:1106:12)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]:     at process._tickCallback (internal/process/next_tick.js:114:19)
Apr 04 13:55:07 raspberrypi-3BPlus homebridge[298]: (node:298) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)