-
Notifications
You must be signed in to change notification settings - Fork 14
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
Any way to do a press & hold advanced command? #34
Comments
Currently no - this does seem like an important feature though especially because CEC is not sent when using the 'suspend' command as per #24 Turning the TV off and on is the only reason I even wanted this plugin and it does not work. |
Same here, I'd love to be able to hold TV for 2 seconds for sleep. |
I would love that feature too! |
Same here !! :) |
Also here !! It's a very important future |
also for me :) |
I'm not a node.js developer, and this is not the correct place to fix it, I think it should properly be fixed in the node-appletv package and not homebridge-apple-tv package. However, I tested an update to homebridge-apple-tv/helpers/sendCommand.js case "hold_menu": this uses the sendKeyPress from the node-appletv project directly, and allows you to set a timeout on the value. You can modify this for any button, but the above is for the menu button. The proper place to fix it would be to create a new function in node-appletv to create a copy of sendKeyPressAndRelease and make a new function such as sendKeyPressHoldAndRelease that adds a delay between the press and release of the command in node-appletv. But, just making the code change above seemed to work for my limited use. I'd like to get a proper fix into a pull request to add to node-appletv. But, i don't have time to do so as this is just a hobby project. But, I wanted to add here in case it was helpful. |
Actually the line should be |
what is the full path for this file on our homebridge installs ? i can't find where it is |
i found it on my Mac at |
perfect i found it but the problem is, i want to shut down my apple TV with this command and it is using the "menu" button and not the "top_menu" or "tv" button, i tried to find the correct path for this one but i can't find it |
Possibly try this, changing the code that the button sends from menu to top_menu; like this: case "hold_menu": Then you can string together hold_menu and select to achieve what you want? I haven't tested this but maybe it works? |
that's awesome, it's working perfectly. To resume the way to put Apple tv and the others gear off via CEC : open the file /usr/local/lib/node_modules/homebridge-apple-tv/helpers/sendCommand.js add :
go to your config.json and put this in your accessories :
restart your homebridge and everything should work perfectly the perfect thing now will be to have the opportunity to make one button in home kit using the simple menu key to power on your devices and this new command to put it off, and to have a way to give the information to this button if the appletv is on or off |
There is a command that I have been using for a long time that turns off the Apple TV without the prior step, it's part of the plugin:
|
Yes but the sleep command doesn’t give the hdmi CEC info. With this command my tv and my AV receiver shutdown too |
Yup, you are right, but there is also a workaround. In my case, I have to turn 0n the Apple TV, TV and surround system and set HDMI in the amplifier and TV and later turn them off. The following code + HomeKit automation, does all the work (on/off - settings), with a single button:
Now create a new automation in HomeKit, to link this code with the on/off AppleTv plugin buttons. This way you can manage complex settings. |
I'd like to add a few commands that involve pressing and holding buttons for a duration of time. Is there any way to do that in an advanced command? I only saw ways to string multiple commands together with pause periods in between.
For example, I'd like to..
The text was updated successfully, but these errors were encountered: