8000 fix sntp timezone by glmnet · Pull Request #1266 · esphome/esphome · GitHub
[go: up one dir, main page]

Skip to content

fix sntp timezone #1266

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

Merged
merged 1 commit into from
Sep 1, 2020
Merged

fix sntp timezone #1266

merged 1 commit into from
Sep 1, 2020

Conversation

glmnet
Copy link
Member
@glmnet glmnet commented Aug 30, 2020

Description:

See also esphome/issues#1434

This is happening since Arduino 2.7.0 may be related: esp8266/Arduino#6993 Don't know exactly the cause but seems like the fix proposed by @f403 works reliable.

Actually a lot of code to review to find the reason, I find it easier to just test it and confirm the issue. If someone does a research job and finds root issue somewhere that's welcomed.

Related issue (if applicable): fixes esphome/issues#1434

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@glmnet glmnet added this to the 1.15.0b5 milestone Aug 30, 2020
@f403
Copy link
f403 commented Sep 1, 2020

I tried to do a quick research, and got lost in code :)

Git-blame shows this commit. If @OttoWinter can remember his ideas from 2018.

sntp_set_timezone(0) configures SNTP with the offset of 0 seconds / 0 hours (UTC). Mentioned localtime/gmtime doesn't seem to work, at least this example prints UTC time instead of local. So sntp_set_timezone(0) looks like a mistake, which is to be solved with this PR

@glmnet
Copy link
Member Author
glmnet commented Sep 1, 2020

Ok thanks. I'm gonna merge this one.

@glmnet
Copy link
Member Author
glmnet commented Sep 1, 2020

Not that the code Otto did was wrong. It worked okay until a recent change of Arduino code base.

@glmnet glmnet merged commit 0918f45 into dev Sep 1, 2020
@glmnet glmnet deleted the fix-sntp-timezone branch September 1, 2020 22:15
@glmnet glmnet modified the milestones: 1.15.0b5, 1.15.1 Sep 14, 2020
glmnet added a commit that referenced this pull request Sep 14, 2020
glmnet added a commit that referenced this pull request Sep 15, 2020
This was referenced Sep 15, 2020
sashao pushed a commit to sashao/esphome that referenced this pull request Oct 23, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNTP ignores time zones
2 participants
0