Repository navigation
vNext: Accept a scan reply without cid - #547
Merged
Merged
Conversation
Some devices answer the scan with a dev pack that has no cid. A Gree LE60-13/GH zone controller does that. DeviceScanInfoResponse required the field, so validation failed and the device could not be discovered at all. Nothing reads cid, so it is now optional. A test covers a scan reply without it.
RobHofmann
approved these changes
Oct 9, 2026
RobHofmann
left a comment
Owner
There was a problem hiding this comment.
Thanks, this is a clean fix.
- Confirmed nothing reads
cidfrom the scan reply;_process_local_scan_responseonly usesmac,nameand the optional fields. - The new test fails on
5.0-devwith the exactValidationErrorand passes with the change. Full suite: 255 passed. - Ran it on my dev instance against my own unit (which does send
cid): binds and polls normally, no errors. I could not test the zone controller path myself.
The Ruff failure is unrelated: CI picked up Ruff 0.17.0 today, which flags the existing import in const.py. The last 5.0-dev run used 0.16.10 and passed. I will fix that separately.
RobHofmann
added a commit
that referenced
this pull request
Oct 9, 2026
Lint installed ruff>=0.16.3, so CI picked up Ruff 0.17.0 the day it came out. 0.17 sorts an import with a trailing pragma comment differently, and const.py failed I001 on every push and PR since #547. None of #547, #548 or #549 touched const.py. 0.16.10 and 0.17.0 want opposite forms of that import, so no code passes both. Pin Ruff to an exact version in lint.yml and requirements_dev.txt so a new release cannot break CI again, and apply the 0.17 fix.
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.
Context
This is a bug fix in preparation for Gree zone controller support. I found it while porting the changes I made for my own zone controller (Gree LE60-13/GH) to this project. The zone controller support itself will come in a later PR. Background and the full plan: https://github.com/Twintop/ha-gree-zone-controller/blob/main/upstream/README.md
Symptom
A Gree LE60-13/GH zone controller (WiFi module ME31-00/C13, firmware
362001062617+U-W05SAV1.27.bin) cannot be discovered at all. Discovery of its IP fails with:Cause
The unit answers the scan with a
devpack that has nocid:{"t":"dev","bc":"gree","catalog":"gree","mid":"50","lock":0,"model":"gree","name":"GR-ZCntrlr_5000_02_ffee_EC","series":"gree","vender":"2","ver":"V1.2.1","brand":"gree","mac":"9424b8c0ffee","subCnt":5}DeviceScanInfoResponserequirescid, so_process_local_scan_response()raises before anything else runs. Nothing in the integration readscid.Change
cidis optional inDeviceScanInfoResponse.test_a_scan_reply_without_cid_is_accepted, with a fake device whose scan reply has nocid. It fails with the error above without this change.docs/protocol.md.Testing
pytest: 255 passed (the 254 before, plus the new test).5.0-dev. I ran them without Home Assistant installed, so I compared the findings with the base branch.