Page 1 of 1

dzVents 2.3 vs 2.4 compatibility

Posted: Sunday 28 January 2018 18:13
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

Re: dzVents 2.3 vs 2.4 compatibility

Posted: Sunday 28 January 2018 18:23
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?

Re: dzVents 2.3 vs 2.4 compatibility

Posted: Sunday 28 January 2018 18:24
by emme
something usable within the code itself ;)

Re: dzVents 2.3 vs 2.4 compatibility

Posted: Sunday 28 January 2018 19:33
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
}

Re: dzVents 2.3 vs 2.4 compatibility

Posted: Monday 29 January 2018 12:23
by dannybloe
I'll add a version attribute on the domoticz object or something like that.