Comportement Lua et if
Publié : 18 oct. 2018, 15:11
dans mon script LUA :
Quand il y a un changement d'état, la condition
Parcontre si je commente

Évidement les switches S1 et S2 sont Off
Code : Tout sélectionner
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName=='D1' or deviceName=='D2' or deviceName=='D3' or deviceName=='D4' or deviceName=='D5') then
print ("Device based event fired on '"..deviceName.."', value '"..tostring(deviceValue).."'")
if otherdevices['S1'] == 'Off' then
print ("Device S1 Off")
end
if otherdevices['S2'] == 'Off' then
print ("Device S2 Off")
end
end
endest exécutée mais pas la conditionif otherdevices['S2'] == 'Off' then
.if otherdevices['S1'] == 'Off' then
Parcontre si je commente
alors la conditionif otherdevices['S2'] == 'Off' then
est exécutée ....if otherdevices['S1'] == 'Off' then
Évidement les switches S1 et S2 sont Off