-
Notifications
You must be signed in to change notification settings - Fork 81
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: handle EU server time issue #642
Conversation
Sometimes EU reports old time stamps
for more information, see https://pre-commit.ci
@ZuinigeRijder you are thinking move this logic to the vehicle setting? |
Yes, I can make a proposal (new) Pull request? |
Of course! This is as much yours as mine! I don't have one of these cars anymore so can't say I spend much time on it. I just increased your access to admin on this repo as well. |
@@ -49,7 +49,7 @@ def _get_authenticated_headers( | |||
def _update_vehicle_properties_ccs2(self, vehicle: Vehicle, state: dict) -> None: | |||
if get_child_value(state, "Date"): | |||
# `Date` field is in UTC time | |||
if vehicle.last_updated_at: | |||
if not vehicle.last_updated_at: | |||
vehicle.last_updated_at = parse_datetime( | |||
get_child_value(state, "Date"), dt.timezone.utc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was wrong, someone else already reported that this was wrong for ccs2, it should be self.data_timezone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you miss one use-case, I created a new Pull request with my proposal:
#643
Sometimes EU reports old time stamps