Skip to content

Fix handling of mixed-case bindOk responses - #172

Open
youssef-idrees wants to merge 1 commit into
cmroche:masterfrom
youssef-idrees:fix-mixed-case-bind-response
Open

Fix handling of mixed-case bindOk responses#172
youssef-idrees wants to merge 1 commit into
cmroche:masterfrom
youssef-idrees:fix-mixed-case-bind-response

Conversation

@youssef-idrees

Copy link
Copy Markdown

Summary

Some Gree devices return the bind response type as bindOk instead of the expected lowercase bindok.

The response is otherwise valid and includes r: 200 and the encryption key, but the case-sensitive packet-type lookup treats it as an unknown packet. This causes binding to time out even though the device replied successfully.

This change normalizes the bindOk response to the existing bindok value before dispatching it.

Example response

{
  "t": "pack",
  "i": 1,
  "uid": 0,
  "cid": "REDACTED",
  "tcid": "",
  "pack": {
    "t": "bindOk",
    "mac": "REDACTED",
    "r": 200,
    "key": "REDACTED"
  }
}

@youssef-idrees
youssef-idrees marked this pull request as ready for review July 15, 2026 20:15
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.72%. Comparing base (47b9850) to head (0315990).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   95.71%   95.72%   +0.01%     
==========================================
  Files           8        8              
  Lines         770      772       +2     
==========================================
+ Hits          737      739       +2     
  Misses         33       33              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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