isNightTime and isDayTime inverted?!
Posted: Saturday 23 December 2017 20:27
Struggling for a few hours with this very simple function;
It constantly returns an inverted value.
Here(Netherlands) is night and the current script constantly returns; dark = False
Then I tested the same script but then with isDayTime and then it returns; dark = True
Added 2 notifies;
with the following result;
I'm I doing something wrong? Or .... ?
Code: Select all
function IsDark()
local dark
if (domoticz.time.isNightTime ) then
dark = "True"
else
dark = "False"
end
return dark
end
Here(Netherlands) is night and the current script constantly returns; dark = False
Then I tested the same script but then with isDayTime and then it returns; dark = True
Added 2 notifies;
Code: Select all
function IsDark()
local dark
domoticz.notify("isNightTime: "..tostring(domoticz.time.isNightTime))
domoticz.notify("isDayTime: "..tostring(domoticz.time.isDayTime))
if (domoticz.time.isNightTime ) then
dark = "True"
else
dark = "False"
end
return dark
end