enigma2-plugin-systemplugins-jsonapi: Methode aufrufen

  • Es gibt ein Paket enigma2-plugin-systemplugins-jsonapi, welches nur 4 Dateien enthält:


    Code
    $ dpkg -L enigma2-plugin-systemplugins-jsonapi
    /usr/lib/enigma2/python/Plugins/SystemPlugins/JSONApi/plugin.py
    /usr/lib/enigma2/python/Plugins/SystemPlugins/JSONApi/__init__.py
    /usr/lib/enigma2/python/Plugins/SystemPlugins/JSONApi/plugin.pyo
    /usr/lib/enigma2/python/Plugins/SystemPlugins/JSONApi/__init__.pyo



    Per POST kann man sich die APIs und Funktionen geben lassen:


    Funktionsliste:


    Nur wie ruft man eine Methode auf? So geht es nicht:


    Code
    $ curl -s -XPOST http://dreambox/api/call -H 'Content-type: application/json' --data-binary '{"method":"api.enigma2.systeminfo.modelname"}' | jq .
    {
      "error": {
    	"data": null,
    	"code": -1,
    	"message": "'NoneType' object is not callable"
      }
    }
  • So funktioniert es:


    Code
    curl -s -XPOST http://192.168.2.223/api/call -H 'Content-type: application/json' --data-binary '{"method": "enigma2.systeminfo.modelname", "id": 100}'

    DM900 • DM8000

  • So funktioniert es:


    Code
    "method": "enigma2.systeminfo.modelname"

    D.h. die Liste der API-Methoden ist nicht so ganz korrekt, weil man immer das api. vor jeder Methode entfernen muss?


    Nicht sehr intuitiv :thinking_face:



    Wofür soll das enigma2-plugin-systemplugins-jsonapi gut sein?

    Fernsteuerung der Dreambox über eine (stabile?) HTTP-API, unabhängig vom Webinterface.



    wo findet man die Pakete?

    Sind im 2.2er opendreambox-feed meiner DM7080HD drin:


    $ apt-cache policy enigma2-plugin-systemplugins-jsonapi
    ...
      500 http://dreamboxupdate.com/opendreambox/2.2/stable/r0/dm7080/deb/mips32el/ ./ Packages