Using Kodi 19 Matrix you should pay attention at least at two settings:
screensaver.mode and
powermanagement.displaysoff. This is an example on how to read the current value for powermanagement.displaysoff:
python:
command = {
'jsonrpc': '2.0', 'id': 0, 'method': 'Settings.getSettingValue',
'params': { 'setting': 'powermanagement.displaysoff' }
}
json_rpc = json.loads(xbmc.executeJSONRPC(json.dumps(command)))
self.saved_displaysoff = json_rpc['result']['value']
then you can change its value:
python:
# Set powermanagement.displaysoff to zero, to disable display power off.
command = {
'jsonrpc': '2.0', 'id': 0, 'method': 'Settings.setSettingValue',
'params': { 'setting': 'powermanagement.displaysoff', 'value': 0}
}
json_rpc = json.loads(xbmc.executeJSONRPC(json.dumps(command)))
But I think that calling the built-in function
InhibitScreensaver(), new in Matrix 19, is more convenient:
python:
# Prevent any screensaver to start.
xbmc.executebuiltin('InhibitScreensaver(true)')
I wrote my notes and some example code on my
wiki page.