How to change Live TV Enable/Disable using Python?
#1
Image

pvrmanager.enabled

this is it. And How Can I change it using PythonHuh?

I want to change that pvrmanager.enabled value from true to false or false to true using py (Python file). I mean via a Addon
Reply
#2
man it takes months sometimes years for a reply on Kodi TV Forum... ridiculous
Reply
#3
(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")
Reply

Logout Mark Read Team Forum Stats Members Help
How to change Live TV Enable/Disable using Python?0