Page 1 of 1

_G.moduleLabel return nil value

Posted: Wednesday 01 April 2020 21:44
by hestia
I have installed the last stable and I have errors due to _G.moduleLabel is nill
I've upgraded to the last beta with same issue
Version: 2020.1 (build 11836)
Build Hash: 7e0c5045a
Compile Date: 2020-03-25 17:53:32
dzVents Version: 3.0.1
Python Version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]

it was ok with:
Version: 4.11605
Build Hash: 7de1f368f
Compile Date: 2020-01-08 23:12:15
dzVents Version: 2.5.5
Python Version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]

Re: _G.moduleLabel return nil value

Posted: Wednesday 01 April 2020 21:51
by waaren
hestia wrote: Wednesday 01 April 2020 21:44 I have installed the last stable and I have errors due to _G.moduleLabel is nil
Thx for reporting. Don't know yet why this does no longer exist. Will try to find out and correct if possible. Until fixed you will have to set a marker
in

Code: Select all

logging = { level = domoticz.LOG_DEBUG, marker = ' scriptName' },

Re: _G.moduleLabel return nil value

Posted: Wednesday 01 April 2020 22:04
by hestia
Thanks for replying and having agreed so fast ;-)
Until fixed you will have to set a marker in

Code: Select all

logging = { level = domoticz.LOG_DEBUG, marker = ' scriptName' },
I could just do this

Code: Select all

 _G.logMarker =  ' scriptName'
because _G.logMarker is working, but _G.moduleLabel not!

Re: _G.moduleLabel return nil value  [Solved]

Posted: Thursday 02 April 2020 0:23
by waaren
hestia wrote: Wednesday 01 April 2020 22:04 Thanks for replying and having agreed so fast ;-)
(kind of) Fixed in next Beta.
moduleLabel is available but no longer in global _G table but in the domoticz object.

so if you have

Code: Select all

execute = ( domoticz, item)
 
You can get moduleLabel as domoticz.moduleLabel

and if you have

Code: Select all

execute = ( dz, item)
 
You can get moduleLabel as dz.moduleLabel

Re: _G.moduleLabel return nil value

Posted: Thursday 02 April 2020 22:27
by hestia
Thanks waaren
moduleLabel as dz.moduleLabel
I'm not familiar to compile domoticz, so I'm going to wait for a version to download.
Meanwhile I added the line in the lua EventHelpers.lua and it works.
I'll have to change my scripts but it is a small change ;-)