Jump to content

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


  • 0

good place for "global" LUA functions?


Question

Posted

I was wondering if there is a place where we can put LUA code/functions so that they can be accessed from all LUA scenes?

 

For example, i wrote a function that parses the list of available iOS devices from the HTTP API and sends a given notification message to all of them. Thats a nice little function that can come in handy in many scenes. Now, the question is, do i have to copy the code for this function into every scene that i want to use it in?

 

Or is there some "global" place where i could save this code so it is visible to all my scenes without replicating the code in every scene?

 

thanks in advamce!

regards

Max

7 answers to this question

Recommended Posts

  • 0
Posted

no, but we all dream about it.

 

Only solution is to use global variables and let then trigger other scenes. Unf. not w. import/export of variables/tables.

  • 0
Posted

+1 (our function library )

  • 0
Posted

I found this bugzilla request. Perhaps we all back it and Fibaro might listen.

 

Please login or register to see this link.

  • 0
  • Inquirer
  • Posted

    thanks for your feedback! And I "+1"-ed the bugzilla ticket.

    • 0
    Posted

    Well I guess in a way one could set up a VD with LABELs as input parameters and then use a KEY for triggering the "function" - it is a way of doing a "global function" so to speak - although it is not the best solution...

    • 0
  • Inquirer
  • Posted

    Well I guess in a way one could set up a VD with LABELs as input parameters and then use a KEY for triggering the "function" - it is a way of doing a "global function" so to speak - although it is not the best solution...

     

    interesting idea, but kinda complicated and pretty much the poster child for a "workaround"

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" /> ... and it's probably not really safe in a multithreaded environment like the HC2.

     

    by the way, does Fibaro communicate their development "roadmap" somewhere (developer blog or something similar) ?

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...