Done:TD-er wrote: ↑07 May 2018, 19:10Great, so we already agreeLisaM wrote: ↑07 May 2018, 14:49 [...] For uPyEasy there is no need to do any JSON REST API encoding/decoding since everything is done by (another) (micro)python library. The input/output of these libraries (python dictionaries) match the input/output of the database (also python dictionaries), so it works together seamless.So little coding effort on my side.
I'll go ahead and make a proposal for a JSON REST API standard, based on the information i have in the uPyEasy database.
The reason for all of this is very simple: i need it. I want to have a dashboard displaying current values from uPyEasy, primarily on mobile devices.
Something like this:
[...]
The supernodes, the most powerfull nodes in a nodes mesh, will have this. The more simple ones probably not.
I know creating an API like this is very easy in Python. (I do also use it at work)
And I know you already have a well thought of data-structure.
So it would be great to try to match both API-like interfaces to be able to use then together in the same ESPeasy grid/mesh, where possible.
It is not my intention to let the current datastructs of ESPeasy (C++) be the limiting factors for an API.
It would be great if ESPeasy C++ and Python could share some functionality like using recorded values of one node in rules on the other, or sync some actions and be integrated in the same web-interface to create a combined dashboard.
url: "/api/v1.0/controller/" + id,
type: 'DELETE',
And...working!
A few lines of code in the webserver framework was enough, searching how this supposed to work was the most time consuming.
I'll make an uPyEasy/ESPEasy RESTful interface proposal...
And start prototyping with a bootstrap (offline) dashboard retrieving current device values from uPyEasy.
Cheers,
Lisa