Hello Forum,
Relatively new to the HC2 I am struggling a bit with getting my head around all the undocumented functions and features in the HC2.
Would anyone know more about the ones I am mentioning below, which are nowhere mentioned in Fibaro's documentation.
The "Net" library
Net.FHttp function
Has a method called GET which requires some parameters. Which ones?
How about POST, PUT and DELETE methods? Do they exist and if so which parameters do they take?
Net.FTcpSocket function
I came across a reference to this function in a post on this forum but I don't know how it works.
The "api" library
api.get, api.put, api.post functions
Takes a local path as parameter so I am guessing this is a special implementation of the Net.FHttp function so one does not have to use the full URL for get/post/put etc.
api.get("/icons") for instance gives all icons according to Fibaro's REST-interface definition
Is there an api.delete function as well?
Googling the above does not give any indication that these libraries are generic LUA libraries so my conclusion is that they must be Fibaro-specific. But I could be wrong of course.
Storing tables in global variables
I came across this VD (by Sankotronic) on the forum that helps you browse the icon library:
Looking through the code I found this very interesting concept of storing an entire data structure in a global variable. Check out the main loop in the VD. Very clever indeed!
The question then, which are the principles behind this very convenient way to handle variables? I mean, the standard functionality can only handle numbers and predefined values, not strings or collections of data.
Thanks!
Per