Bug in dzvents for Selector ?

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

Moderator: leecollings

Post Reply
User avatar
TiXav
Posts: 63
Joined: Saturday 28 November 2015 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Bug in dzvents for Selector ?

Post by TiXav »

I am not sure but I think I found a little bug in dzvents
For a selector (Of level not hidden) dz.devices("MySelector").active is always false, so I found for the moment this solution at start of my scripts:

Code: Select all


	local xActive=device.active
		
		if device.deviceSubType=='Selector Switch' then
			if device.levelVal~=0 then xActive=true end
			dz.log('selector device.Name: '..device.name..' level'..device.levelVal..' xActive= '..tostring(xActive),dz.LOG_ERROR)
		end

then I can use xActive for Switches AND Selectors in several generic code instead of directly testing .active and testing selector each time

Can someone confirm? or I am using .active in a bad way...
User avatar
TiXav
Posts: 63
Joined: Saturday 28 November 2015 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Bug in dzvents for Selector ?

Post by TiXav »

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest