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

LUA learning topic


Igy
 Share

Question

Hi, I’m new to LUA and actually newer did the programing, except the pascal on high school J. However I like to learn the new staff, best way for me is learning by doing. I developed many block scenes and converted them into LUA to understand the way it works, but still have some questions I believe if answered, other users will find useful as well.

This topic should be for explanation how LUA works.  

 

First question what is tempfunc() for and how to use it?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Could you share the code where tempfunc() appears?

 

Usually tempfunc is the name of temporary function created by user. 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • During my LUA learning evenings, I convert block scenes to LUA and I try to understand the logic. One of the simple scenes is attached. Goal is to turn on the socket at specified time during the selected days of the week. When I covert the ice to LUA, it looks like this:

    Please login or register to see this code.

    and only thing I don't know what is about is the tempFunc in it.

    Link to comment
    Share on other sites

    • 0

    Exactly as I thought, the tempFunc() is a local function and not part of  LUA language.

    Since the code is using setTimeout () (to create a loop for every minute) it is required to call a function, which is in this case tempFunc()

     

    Just to exercise you can change the name to any other and it will work.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Perfect, thanx for explanation!

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...