Page 1 of 1

isNightTime and isDayTime inverted?!

Posted: Saturday 23 December 2017 20:27
by Freemann
Struggling for a few hours with this very simple function;

Code: Select all

function IsDark()
            local dark
            if (domoticz.time.isNightTime ) then 
                dark = "True"
            else 
                dark = "False"
            end
            return dark
end
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;

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
with the following result;
Screenshot - 23_12_2017 , 20_25_48.png
Screenshot - 23_12_2017 , 20_25_48.png (4.63 KiB) Viewed 1054 times
I'm I doing something wrong? Or .... ?

Re: isNightTime and isDayTime inverted?!

Posted: Saturday 23 December 2017 20:35
by jvdz
Are you running the latest Beta which has a confirmed DayTime/NightTime bug?

Jos

Re: isNightTime and isDayTime inverted?!

Posted: Saturday 23 December 2017 20:45
by Freemann
I'm running 3.8794 so the second best Beta there is.

ok... seeying it;
https://github.com/domoticz/domoticz/co ... 8f8abb3de7

My update policy is to update on an version diff of atleast 20 points, so I didn't look for this small update....

My bad...

Update is running :roll:

Re: isNightTime and isDayTime inverted?!

Posted: Saturday 23 December 2017 22:30
by Freemann
OK, everything is working as expected. Thanks for you notice on the bug/update!