feat(CA): hvacInfo→remoteControl self-correcting retry in start_climate - #1178
Open
blka wants to merge 2 commits into
Open
feat(CA): hvacInfo→remoteControl self-correcting retry in start_climate#1178blka wants to merge 2 commits into
blka wants to merge 2 commits into
Conversation
- Extract _build_ev_climate_payload() helper with use_remote_control flag - Remove brand/model whitelist (EV9, IONIQ 9) for payload selection - Try hvacInfo first, retry with remoteControl on non-zero responseCode - Tests: 4 tests for retry logic, payload structure verification
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.
Problem
Newer CA EV vehicles (EV9, IONIQ 9) require the
remoteControlpayload key instead ofhvacInfofor climate start. The previous approach used a brand/model whitelist (hardcoded EV9 for Kia, IONIQ 9 for Hyundai) — fragile and requires updating for every new model.Solution
Replace the whitelist with a self-correcting retry:
hvacInfofirst (works for most vehicles)responseCode != 0, retry withremoteControl_check_response_for_errorsraises the appropriate exceptionThis matches the pattern used by egmp-bluelink-scriptable and eliminates the need for a vehicle model whitelist.
Refactoring
_build_ev_climate_payload(token, options, hex_set_temp, use_remote_control=False)helperTesting
4 unit tests: