Bug in dzvents for Selector ?
Posted: Thursday 11 December 2025 19:14
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:
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...
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
Can someone confirm? or I am using .active in a bad way...