script.json-cec icon indicating copy to clipboard operation
script.json-cec copied to clipboard

Kodi 18.6 Leia

Open amaia81 opened this issue 5 years ago • 4 comments

Hi. Are there any plans to make it compatible with version 18.6 Leia? Thanks and kind regards!

amaia81 avatar May 25 '20 23:05 amaia81

I'm curious about this as well. The example JSON payload (GET request) now returns

{
  "error": {
    "code": -32099,
    "message": "Bad client permission."
  },
  "id": 1,
  "jsonrpc": "2.0"
}

(minus the formatting) since GET requests are only allowed to execute ReadOnly types of RPC actions: https://forum.kodi.tv/showthread.php?tid=324598

I got a little bit further by taking these steps:

  • added a hashbang at the start of the script.py
  • added executable flag
  • called Addons.SetEnabledAddon
curl --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"script.json-cec","enabled":true},"id":1}' http://osmc1.local/jsonrpc | jq .
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "OK"
}

Not until I had explicitly called this SetEnabledAddon could I see the script.py being executed. Unfortunately, any logging or print to stdout is swallowed, so I set up logging to a /tmp/mylog file.

After finally searching in System settings and Peripherals, entering the libElect entry, I could select TV under "turn off ...". Then everything started working with 18.7. Fresh install of OSMC on a Raspberry Pi 3.

FredrikWendt avatar Jul 19 '20 03:07 FredrikWendt

@FredrikWendt do you happen to have your final, working modifications somewhere that you could share?

jantman avatar Dec 24 '20 15:12 jantman

@jantman Sure: https://github.com/FredrikWendt/script.json-cec contains my changes to the script.py file, but ... I believe the challenge I had was simply activating the addon (the curl run in my comment above enabled the addon).

FredrikWendt avatar Dec 26 '20 23:12 FredrikWendt

Thnks @FredrikWendt , @joshjowen is this project still active?

denics avatar Jan 12 '21 08:01 denics