joshjowen / script.json-cec

cec control for xbmc/kodi
GNU General Public License v2.0
71 stars 34 forks source link

Kodi 18.6 Leia #11

Open amaia81 opened 4 years ago

amaia81 commented 4 years ago

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

FredrikWendt commented 4 years ago

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:

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.

jantman commented 3 years ago

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

FredrikWendt commented 3 years ago

@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).

denics commented 3 years ago

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