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

fix 12hr early Sunset/Sunrise (xdrv_09_timers.ino ) #7174

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

ptrooms
Copy link
Contributor

@ptrooms ptrooms commented Dec 10, 2019

Description:

Fix a small web/configuration issue causing the Sunset/Sunrise timer activates 12 hours early when accidentally using an negative zero offset (-00:00 time). In case the user enters "-" (minus) 00:00. The web-script sees this as an delta, subtracts 720 minutes (12 hours) before adding the delta time. This causes that the subset/sunrise will go off , 12 hours early.

If and in case users really want 12 hours before, it is more logical they enter a real time-offset as intended.

The fix is small, but prevent a problem that the SunSet (or SunRise) timer (at timer mode 2 or 1), will otherwise trigger 12 hours early or later then intended.
Without the change: the configuration will read: ... "mode": 2, "power": 1, "repeat": 1, "time": 720, "window": 0},
After the proposed correction (and of course a configuration save), the configuration will result into: "mode": 2, "power": 1, "repeat": 1, "time": 0, "window": 0 ...

Note: this is my first active contribution in the steeple chase what is required. It is quite an experience to have things sorted out and I'm open to improvements. TIA for your considerations.
Related issue (if applicable): fixes #

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core 2.6.1
  • The code change pass travis tests. Your PR cannot be merged unless tests pass
  • I accept the CLA.

@ptrooms ptrooms changed the title 7.1.2.4 20191209 xdrv_09_timers.ino fix 12hr early Sunset/Sunrise fix 12hr early Sunset/Sunrise (xdrv_09_timers.ino ) Dec 10, 2019
@arendst
Copy link
Owner

arendst commented Dec 11, 2019

Thx

@arendst arendst merged commit bbed0c6 into arendst:development Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants