Skip to content

feat(CA): hvacInfo→remoteControl self-correcting retry in start_climate - #1178

Open
blka wants to merge 2 commits into
Hyundai-Kia-Connect:masterfrom
blka:feat/ca-climate-retry
Open

feat(CA): hvacInfo→remoteControl self-correcting retry in start_climate#1178
blka wants to merge 2 commits into
Hyundai-Kia-Connect:masterfrom
blka:feat/ca-climate-retry

Conversation

@blka

@blka blka commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem

Newer CA EV vehicles (EV9, IONIQ 9) require the remoteControl payload key instead of hvacInfo for 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:

  1. Try hvacInfo first (works for most vehicles)
  2. If responseCode != 0, retry with remoteControl
  3. If both fail, _check_response_for_errors raises the appropriate exception

This matches the pattern used by egmp-bluelink-scriptable and eliminates the need for a vehicle model whitelist.

Refactoring

  • Extracted _build_ev_climate_payload(token, options, hex_set_temp, use_remote_control=False) helper
  • Removed brand-specific EV9/IONIQ 9 branching in favor of try-retry pattern

Testing

4 unit tests:

  • Retry on hvacInfo failure → remoteControl success
  • No retry on hvacInfo success
  • Raise error when both fail
  • Payload structure verification (remoteControl vs hvacInfo key)

blka added 2 commits June 16, 2026 14:45
- 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
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.

1 participant