Created
December 17, 2017 19:28
-
-
Save klattimer/27852149437a1d9f3e9b0927e8aa1f93 to your computer and use it in GitHub Desktop.
Enable/Disable kodi powersaving via python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires: https://github.com/jcsaaddupuy/python-xbmc | |
# | |
# enable/disable kodi power management shutdown timer | |
# | |
# weird bug when you enable after 5 minutes of it sitting idle, it will shutdown... almost as if the timer is always going | |
# | |
from xbmcjson import XBMC | |
import sys | |
if __name__ == "__main__": | |
if sys.argv[1] == "enable": | |
val = 5 | |
elif sys.argv[1] == "disable": | |
val = 0 | |
else: | |
sys.exit(1) | |
xbmc = XBMC("http://localhost:8080/jsonrpc") | |
xbmc.Settings.SetSettingValue({"setting": "powermanagement.shutdowntime", "value": val}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment