node-red-contrib-sun-position
node-red-contrib-sun-position copied to clipboard
if a begin is after the end the node triggers always "true"
Describe the bug if a begin is after the end the node triggers always "true". Maybe begin = sun-something + 10 = 7.35 and end is sun-something -15 = 7.33 the node triggers alway a true. This is not true because the beginning should never be after the end. If so it should be false.
Screenshots
Expected behavior In a case where the end is logical before the beginning the node should answer with false.
System information (please complete the following information):
- Node Version 14.15.1
- Node-Red Version 1.3.4
Additional context
A lot has changed here with version 3. There is the feature that you want to define a period of time beyond midnight. This is the case when the end is before the begin.
Example:
- begin: 21:00 - end: 6:00
Then in the time after 21:00 and before 6:00 the next day the rule is active. Or other:
- the rule is active before the end time
- the rule is active after the begin time
- the rule is not actibe between end and begin
In your example:
- begin = sun-something + 10 = 7.35
- end = sun-something -15 = 7.33
This leads to
- the rule is
true
before the end time 7:33 - the rule is
true
after the begin time 7:35 - the rule is
false
between 7:33 and 7:35
So this is more than a feature than a Bug. - That doesn't mean there can't be problems.
One could still consider having this behavior switched off for individual rules. This could be useful if one of the times (Begin/End) has a fixed point in time and the other is a solar time.