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(EU): correction to get total power consumed from driving info #419

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

WillemD61
Copy link
Contributor

total power consumed is obtained from drivingInfo, not drivingInfoDetail

total power consumed is obtained from drivingInfo, not drivingInfoDetail
@cdnninja cdnninja changed the title correction to get total power consumed from driving info fix(EU): correction to get total power consumed from driving info Oct 6, 2023
@cdnninja
Copy link
Collaborator

cdnninja commented Oct 6, 2023

@ZuinigeRijder could you review this? I think this may impact your integration.

@cdnninja cdnninja requested a review from ZuinigeRijder October 6, 2023 23:34
@ZuinigeRijder
Copy link
Collaborator

@ZuinigeRijder could you review this? I think this may impact your integration.

I will have a closer look later today or tomorrow.

Copy link
Collaborator

@ZuinigeRijder ZuinigeRijder left a comment

Choose a reason for hiding this comment

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

I would expect on line 1038 an extra check to avoid an error on possibly missing drivingInfoDetail:
if get_child_value(responseAlltime, "resMsg.drivingInfoDetail.0"):

@WillemD61
Copy link
Contributor Author

WillemD61 commented Oct 7, 2023

I assume you want to have that check so that the calculation of daily driving stats that follows is succesfull.

But therefore you will have to test for presence of drivingInfoDetail in the response30d, not in the responseAlltime.

So line 1038 should be
if get_child_value(response30d, "resMsg.drivingInfoDetail.0"):
And line 1039 to 1050 should be subject to this condition.

If agreed, I will make the additional change in this PR.
Note this addition is not related to the proposed change in this PR. The test was not present before either.

get total odometer value from responseAlltime.drivingInfo
and
added extra check before calculating daily stats from response30d.drivingInfoDetail
@WillemD61
Copy link
Contributor Author

adjusted now included extra if statement

Copy link
Member

@fuatakgun fuatakgun left a comment

Choose a reason for hiding this comment

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

LGTM

@cdnninja cdnninja merged commit de8bf08 into Hyundai-Kia-Connect:master Oct 9, 2023
13 checks passed
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.

4 participants