Plus simplementmiralant a écrit :Code : Tout sélectionner
commandArray = {} -- loop through all the devices for deviceName,deviceValue in pairs(otherdevices) do if (deviceName=='Lison_Globe') then if (devicechanged['Lison_Globe']) then print ("Lison_Globe") if deviceValue == "On" then -- print("Device is On") commandArray['Lison globe_ON'] = "On" elseif deviceValue == "Off" then -- print("Device is Off") commandArray['Lison globe_OFF'] = "Off" end end end end return commandArray
Code : Tout sélectionner
commandArray = {}
if (devicechanged['Lison_Globe']=="On" ) then
commandArray['Lison globe_ON'] = "On"
elseif (devicechanged['Lison_Globe']=="Off" ) then
commandArray['Lison globe_OFF'] = "Off"
end
return commandArray