There are some functions that I use in several dzVents scripts. At the moment this is a copy/paste thing.
Question: is it possible to call functions 'outside' the current script and create a central library?
'global' functions? / user library?
Moderator: leecollings
- jvdz
- Posts: 2445
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: 'global' functions? / user library?
I use this in regular LUA scripts to include a file with my standard functions:
Assume it works the same in DzVents as they are LUA.
Jos
Code: Select all
dofile("/home/pi/domoticz/scripts/lua/general_functions.lua")
Jos
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: 'global' functions? / user library?
Yes that will work in dzVents but on top of that, dzVents has a kind of builtin mechanism for this; called helper functionsjvdz wrote: Friday 04 January 2019 20:12 I use this in regular LUA scripts to include a file with my standard functions:Assume it works the same in DzVents as they are LUA.Code: Select all
dofile("/home/pi/domoticz/scripts/lua/general_functions.lua")
Jos
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: 'global' functions? / user library?
Perfect!Yes that will work in dzVents but on top of that, dzVents has a kind of builtin mechanism for this; called helper functions
Thank you
Who is online
Users browsing this forum: No registered users and 1 guest