2016-02-02, 11:06
2016-08-06, 01:13
(2016-04-27, 22:29)FresnoTV Wrote: man it takes months sometimes years for a reply on Kodi TV Forum... ridiculous
It took almost 6 months... anyway here is my custom code to Enable or Disable the PVR (Live TV) using a python script, just save this code on a python file and run it with RunScript(special://path/switch.py) to toggle the PVR (Live TV)
Code:
import json
import xbmc, xbmcgui, xbmcaddon
# get and set variables
jsonGetPVR = '{"jsonrpc":"2.0", "method":"Settings.GetSettingValue", "params":{"setting":"pvrmanager.enabled"}, "id":1}'
jsonSetPVR = '{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"pvrmanager.enabled", "value":%s},"id":1}'
jsonNotify = '{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"PVR", "message":"%s","image":""}, "id":1}'
# get current pvr status
PVR = json.loads(xbmc.executeJSONRPC(jsonGetPVR))['result']['value']
if (PVR == False):
# set pvr on
xbmc.executeJSONRPC(jsonSetPVR % "true")
xbmc.executeJSONRPC(jsonNotify % "Live TV Enabled")
else:
# set pvr off
xbmc.executeJSONRPC(jsonSetPVR % "false")
xbmc.executeJSONRPC(jsonNotify % "Live TV Disabled")