-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add support for switching TV on and off via CEC #240
base: master
Are you sure you want to change the base?
Conversation
Upstream merge
…ttps://github.com/joshjowen/script.json-cec plugin to be installed on Kodi)
In my opinion, this belongs somewhere else, like home automation software. I don't think this skill is the place to turn on and off other equipment. |
I'd hate to get involved with having to have a list of compatible plugins people need to install as well. |
Hi Joe, It's obviously up to you, but to be fair this is is a Kodi skill, and switching on and off the currently active CEC device IS a function Kodi supports out of the box using libCEC (since all the Raspberry Pi's have CEC Hardware). It even has functionality built-in to switch off the device when the screensaver kicks in. It's not like one is asking Kodi to switch on the kettle or some other device that has nothing to do with watching movies. Kodi and the TV it is connected to, are tightly coupled. I agree having to use the plugin sucks, but at the moment Kodi doesn't expose the CEC functionality via JSON-RPC, so the plugin is the only way. If people don't need the functionality, they needn't install it. If the plug-in changes or stops working (unlikely since it is tiny and simple), it still doesn't break the skill, it just means that function won't work. |
As this is a feature I would love to see I thought I'd give the pull request a go (using
Reverting back to Master and redeploying fixes the issue |
Getting this error message when merging:
How can I add this modification? |
@bigwillch @pittbull - I have been away on holiday, so haven't seen these messages. I will pull the latest master over the weekend, and see if I run into the same issues. |
@dieterrosch Removed the " : " and "self" from these two lines:
The code now executes upon calling Alexa. I am fairly new to Python and doing my best to learn so I am not sure if these changes are correct, but it runs - for now. :) I would appreciate some feedback when you've tested it. |
Great work on this project. The only thing I was surprised was missing in the project was actually turning on the TV. I can't use it with the TV off, and once I'm already holding the remote, it seems silly to use voice commands. Hope the kinks get worked out and it's merged 👍 |
Added two extra Alexa action to allow switching on and off the currently active CEC device by saying "Alexa, ask Kodi to switch (on/off) the (tv/television).
These two actions require the plugin from https://github.com/joshjowen/script.json-cec to be installed on Kodi, as there is currently no JSON API exposed for the CEC functionality.