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

[astro] Fixed timeLeft calculation at the end of the year #11889

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

Hilbrand
Copy link
Member

@Hilbrand Hilbrand commented Dec 29, 2021

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year. So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days. Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Closes #11859

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
@Hilbrand Hilbrand requested a review from gerrieg as a code owner December 29, 2021 20:14
@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Dec 29, 2021
@lolodomo
Copy link
Contributor

lolodomo commented Dec 30, 2021

@clinique: as you were involved in astro calculations at a time, can you please tell us if these changes look ok to you ?
At least, they look ok to me.

Copy link
Contributor

@clinique clinique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lolodomo lolodomo merged commit 253f36a into openhab:main Dec 30, 2021
@lolodomo lolodomo added this to the 3.3 milestone Dec 30, 2021
@Hilbrand Hilbrand deleted the fix-astro-timeleft branch December 30, 2021 12:52
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
moesterheld pushed a commit to moesterheld/openhab-addons that referenced this pull request Jan 18, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
)

Season timeleft calculated the wrong time at the end of the year, because the seasons it measures the time with are the seasons within the same year.
So for times at the end of the year it computed against the season at the beginning of the year, resulting in negative number of days.
Also changed the time of timeLeft to actual days instead of quantity unit days.
Because with the milliseconds internal resolution it will generate events each and every time this channel is updated as milliseconds change often.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[astro]:sun:Sun:season#timeLeft returns -300 days for Summer on 26 Dec 2021 in Australia
3 participants