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


[Feature Request] LUA function collection


winromulus

Recommended Posts

Hi,

 

It would be great to have a LUA function collection (maybe as a new Panel?) where we could store reusable functions, making them globally available.

I'm doing a lot of custom automation and ended up having a collection of functions that get copy/pasted in scenes but as any developer would find, this is very error prone and makes maintenance extremely problematic.

It would be great if we could create new functions as part of a collection namespace and have them available in all scenes. Any change to one of the functions would propagate to all usages.

As a MVP for this feature, even a simple editor somewhere where we could drop all functions would be fine, as long as those functions are available in scenes.

 

If there is a better way of currently achieving this,  please let me know and close this topic.

 

Much appreciated,

Romeo

  • Like 1
Link to comment
Share on other sites

I vote for enabling require

 

scene id 123 (mean 123.lua)

Please login or register to see this code.

 

your current script scene

 

local scriptHall = require("123")
scriptHall.testHallLights()
 

 

btw, 

Please login or register to see this link.

That's an... inside joke. :D

Link to comment
Share on other sites

  • 4 weeks later...

+1, today I use scenes with parameters or by variable but it's not comfortable. 

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
Reply to this topic...

×   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...