Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
perjar 10
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
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.