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

[evcc] Fix charge plan time channel not using correct timezone #17640

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

Laith-Budairi
Copy link
Contributor

@Laith-Budairi Laith-Budairi commented Oct 27, 2024

Fixes #17620.

this change fixes the Charge Plan Time not showing correctly on EVCC.

jar file with fix: EVCC jar

Signed-off-by: Laith Budairi laith38@yahoo.com

…#17620)

Signed-off-by: Laith Budairi <laith.budairi@exalt.ps>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

Code LGTM, thanks!
I don‘t use the binding anymore, so would be good if someone in #17620 could verify the fix.

@florian-h05 florian-h05 changed the title [evcc] Charge Plan Time is not converted to correct Timezone (#17620) [evcc] Charge plan time is not converted to correct timezone Oct 27, 2024
@Laith-Budairi
Copy link
Contributor Author

Code LGTM, thanks! I don‘t use the binding anymore, so would be good if someone in #17620 could verify the fix.

Tested it out with the issue owner, the fix seems to be working fine

@florian-h05 florian-h05 requested a review from a team October 28, 2024 09:07
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@lsiepel lsiepel merged commit 091ae9c into openhab:main Oct 28, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Oct 28, 2024
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Oct 28, 2024
@lsiepel lsiepel changed the title [evcc] Charge plan time is not converted to correct timezone [evcc] Fix charge plan time channel not using correct timezone Oct 28, 2024
@Laith-Budairi Laith-Budairi deleted the evcc-17620 branch October 28, 2024 09:23
@jlaur jlaur added bug An unexpected problem or unintended behavior of an add-on and removed enhancement An enhancement or new feature for an existing add-on labels Oct 28, 2024
+ planTime.toLocalDateTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + "Z", "POST");
ZoneId zoneId = timeZoneProvider.getTimeZone();
ZonedDateTime adjustedTime = planTime.withZoneSameInstant(zoneId);
String formattedTime = adjustedTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Laith-Budairi - out of curiosity, does the API support UTC time, e.g. 2024-10-24T05:30:00.636Z? In this case, the fix could be as simple as:

String formattedTime = planTime.toInstant().toString();

And there would be no need to use TimeZoneProvider.

KaaNee pushed a commit to KaaNee/openhab-addons that referenced this pull request Nov 8, 2024
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Dec 16, 2024
cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Jan 2, 2025
…#17620) (openhab#17640)

Signed-off-by: Laith Budairi <laith.budairi@exalt.ps>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
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.

[evcc] Charge Plan Time is not converted to correct Timezone
5 participants