Salut a tous, j'ai besoin de votre aide
je un problème avec une variable local
dans le simple code suivant qui allume une lampe a une heure précise, je cherche placé l’heure dans une variable local
local heure = "15:02" ---ligne N° 6
( string.format("%02d:%02d", currentDate.hour, currentDate.min) == "heure") ----ligne N°10
mai ça ne fonctionne pas
merci pour votre aide
local sourceTrigger = fibaro:getSourceTrigger();
function tempFunc()
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
local heure = "15:02" -----ligne N°6
fibaro:debug("Heur >>>>"..heure)
if (
( string.format("%02d:%02d", currentDate.hour, currentDate.min) == "..heure..") ----ligne N°10
)
then
fibaro:call(14, "turnOn");
end
setTimeout(tempFunc, 60*1000)
end
if (sourceTrigger["type"] == "autostart") then
tempFunc()
else
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
sourceTrigger["type"] == "other"
)
then
fibaro:call(14, "turnOn");
end
end