fix: parse targetSOC from force refresh response for USA Kia API - #1
Draft
kingpanther13 wants to merge 3 commits into
Draft
fix: parse targetSOC from force refresh response for USA Kia API#1kingpanther13 wants to merge 3 commits into
kingpanther13 wants to merge 3 commits into
Conversation
Root cause: The cmm/gvi (cached state) endpoint does NOT include targetSOC data for some vehicles (confirmed with 2020 Kia Niro EV). The rems/rvs (force refresh) endpoint DOES include it. Previously, the force refresh response was discarded without parsing targetSOC, so ev_charge_limits_ac/dc were always None for affected vehicles. Changes: - force_refresh_vehicle_state now captures the rems/rvs response and parses targetSOC from it via _update_charge_limits_from_force_refresh - _update_vehicle_properties no longer overwrites existing charge limit values with None when the cached response lacks targetSOC - Added unit tests using real API response data from a 2020 Kia Niro EV https://claude.ai/code/session_01K2NA2hvdoY3HMq8NiZDveZ
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause: The cmm/gvi (cached state) endpoint does NOT include targetSOC data for some vehicles (confirmed with 2020 Kia Niro EV). The rems/rvs (force refresh) endpoint DOES include it. Previously, the force refresh response was discarded without parsing targetSOC, so ev_charge_limits_ac/dc were always None for affected vehicles.
Changes: