Skip to content

Instantly share code, notes, and snippets.

@klattimer
Created December 17, 2017 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klattimer/27852149437a1d9f3e9b0927e8aa1f93 to your computer and use it in GitHub Desktop.
Save klattimer/27852149437a1d9f3e9b0927e8aa1f93 to your computer and use it in GitHub Desktop.
Enable/Disable kodi powersaving via python
# 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