dzVents 2.3 vs 2.4 compatibility

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

dzVents 2.3 vs 2.4 compatibility

Post by emme »

Ciao,

is there a way to understand which version of dzvents is running?

I'm asking this because 2.4.1 has few break changes that users with 2.3 cannot use...
so, once upgraded the scripts they will be usless to old system.

I'm willing to develop both version of the same script... something like:

if domoticz.dzVer >= 2.4 then
if device.isTimer then
...

elseif domoticz.dzVer < 2.4 then
if trigger.trigger = domoticz.EVENT_TIMER then
....


ciao
m

P.S. a workaround would be a user variable :P :P
The most dangerous phrase in any language is:
"We always done this way"
SweetPants

Re: dzVents 2.3 vs 2.4 compatibility

Post by SweetPants »

emme wrote: Sunday 28 January 2018 18:13 is there a way to understand which version of dzvents is running?
Setup->About maybe?
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: dzVents 2.3 vs 2.4 compatibility

Post by emme »

something usable within the code itself ;)
The most dangerous phrase in any language is:
"We always done this way"
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents 2.3 vs 2.4 compatibility

Post by waaren »

emme wrote: Sunday 28 January 2018 18:24 something usable within the code itself ;)
Until Danny implement a native solution; how about ?

Code: Select all

return {
	-- active  = false,
        
    on = { timer = {'every minute'} },    
    
  execute = function(domoticz)
        if domoticz.devices('test').isHTTPResponse ~= nil then
            version="version 2.4.0 or later"
        else
            version="version 2.3 or earlier"
        end
        print("dzVents version : " .. version )
  end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.3 vs 2.4 compatibility

Post by dannybloe »

I'll add a version attribute on the domoticz object or something like that.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest