Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Civil Dawn in Inject Enhanced and Within Time nodes are showing slightly different times. #416

Closed
adsavia opened this issue Feb 26, 2022 · 5 comments
Assignees
Labels
✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published).

Comments

@adsavia
Copy link

adsavia commented Feb 26, 2022

Describe the bug
Inject Enhanced and Within Time Nodes do not agree on Civil Dawn (have not tried others).

Screenshots
nr682

Expected behavior
Civil Dawn Times should match?

System information (please complete the following information):

  • Node Version 2.1.1
  • Node-Red Version 2.2.0

Additional context

@Hypnos3
Copy link
Collaborator

Hypnos3 commented Feb 28, 2022

Hello,

This is an expected behavior.

The time-inject node always shows the next timestamp - the timestamp of the next inject, whereas the within-time node always shows the timestamps for the current day.

The reason for this is that the within-time node determines the start and end time for the current day and then checks whether the current time is within this period. These determined times are simply output as status. The inject node always determines the next time and outputs this as status.

The function to determine the time is also not in the nodes themselves, but in the configuration node. As long as both nodes use the same configuration-node, it is 100% sure that they use the same time. Since both nodes use the same function for the determination of the time and this function the determined times even internally cached by day - that means, the times are not recalculated each time, but all nodes with the same configuration node use the same time. To thus differences in times can arise only by times for different days or configuration nodes.

Is this here a feature request, because to change in such a way that the within-time node after expiration of the time period outputs the next time period?

regards
(duplicate to #417)

@Hypnos3 Hypnos3 self-assigned this Feb 28, 2022
@Hypnos3 Hypnos3 added the 🕙 awaiting feedback waiting for feedback from ticket owner label Feb 28, 2022
@adsavia
Copy link
Author

adsavia commented Feb 28, 2022

Okay I suspected as such. Thanks again for a great set of nodes. They work great!!!!

@no-response no-response bot removed the 🕙 awaiting feedback waiting for feedback from ticket owner label Feb 28, 2022
@adsavia
Copy link
Author

adsavia commented Feb 28, 2022

Also I think it's fine - no new feature necessary. The within-time node will update for the next day and work as expected? In other words it's okay to do a dusk to dawn range even though the end time is earlier.. I've always been a little confused about that but it works so...

@Hypnos3
Copy link
Collaborator

Hypnos3 commented Mar 2, 2022

The within-time node check when a message arrives if it is still valid for the current day and if not it recalculates the times.

The within-time node also accepts if the end time is before the start time (dawn to sunrise) and will evaluate this correctly. May in this case the state is misleading.

Hypnos3 added a commit that referenced this issue Mar 2, 2022
…shown times could be not correct #416

- within-time-switch
  - changed state output in case time span is over midnight, because the shown times could be not correct #416
  - added automatic test case
    - basic inject
Hypnos3 added a commit that referenced this issue Mar 13, 2022
…shown times could be not correct #416

- within-time-switch
  - changed state output in case time span is over midnight, because the shown times could be not correct #416
  - added automatic test case
    - basic inject
@Hypnos3 Hypnos3 added the ✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published). label Mar 13, 2022
@Hypnos3
Copy link
Collaborator

Hypnos3 commented Mar 13, 2022

the latest version (currently beta) has a changed state text and shows extra icon if time goes over midnight:
image

@Hypnos3 Hypnos3 closed this as completed Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published).
Development

No branches or pull requests

2 participants