As a programmer I am used to writing class libraries with utilities that can be reused across the application. Is there any way I can do this for MiOS / Vera?
For instance, can I write a function called CompareTime(time1, time2) in luup and use it from several scenes / events?
Could anything similar be achieved another way?
How would I go about compiling it for Vera? Is there a cross-compiler that can make the .so file, or should I transfer the source file and compile it on Vera?
Oh, they are shared-object Lua libraries and not pure-source Lua libraries?
You will need a cross-compiler to build them for the Vera platform. I haven’t done this, but I know what’s involved. Download the OpenWrt source, compile a firmware image, and then use the included cross-compiler to build your Lua .so files. Then cross your fingers.
Now I see The simple solution was of course to put the mylib.lua file in /usr/lib/lua and use require(“mylib”).
What I read was to write a C module and put the compiled library there. It’s a different level of difficulty for sure! Most days I’m a Windows guy and I know that compiling a distro usually requires many late hours. I think I will go with the simple scripting solution for now and see how far that will take me
Thanks for the help!
Best Home Automation shopping experience. Shop at Ezlo!