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

[ecobee] Fix issue with UTC and local dates #14170

Merged
merged 4 commits into from
Jan 8, 2023

Conversation

mhilbush
Copy link
Contributor

@mhilbush mhilbush commented Jan 6, 2023

The Ecobee API returns all date/time fields formatted as "yyyy-MM-dd HH:mm:ss". Most of those date/times are in UTC time, however a couple are in local time. This PR correctly handles both cases by:

  • introducing a Gson DateDeserializer that handles the dates when they're in UTC time
  • introduces a new method that handles the dates when they're in local time

Reference: https://community.openhab.org/t/ecobee-binding-v2/97733/225

Signed-off-by: Mark Hilbush [email protected]

@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Jan 6, 2023
@jlaur jlaur changed the title [ecobee] Fixes issue with UTC and local dates [ecobee] Fix issue with UTC and local dates Jan 6, 2023
Signed-off-by: Mark Hilbush <[email protected]>
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the fix and cleanup!

@jlaur jlaur merged commit 3ba37b4 into openhab:main Jan 8, 2023
@jlaur jlaur added this to the 4.0 milestone Jan 8, 2023
@mhilbush
Copy link
Contributor Author

mhilbush commented Jan 8, 2023

Thanks. I appreciate your help getting this over the finish line!

@mhilbush mhilbush deleted the ecobee-fix-utc-dates branch January 8, 2023 23:22
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
* Correctly handle UTC and local date/times
* Eliminate use of Date class

Signed-off-by: Mark Hilbush <[email protected]>
renescherer pushed a commit to renescherer/openhab-addons that referenced this pull request Mar 23, 2023
* Correctly handle UTC and local date/times
* Eliminate use of Date class

Signed-off-by: Mark Hilbush <[email protected]>
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.

2 participants