feat: Implement sub-device management and discovery features#148
Open
meirlo wants to merge 5 commits into
Open
feat: Implement sub-device management and discovery features#148meirlo wants to merge 5 commits into
meirlo wants to merge 5 commits into
Conversation
Author
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #148 +/- ##
==========================================
+ Coverage 95.65% 96.84% +1.18%
==========================================
Files 8 8
Lines 760 855 +95
==========================================
+ Hits 727 828 +101
+ Misses 33 27 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
added 3 commits
April 16, 2026 19:38
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.
Add gateway sub-device discovery and management
Summary
Adds support for Gree gateway devices that manage multiple sub-devices (e.g., multi-split systems). During discovery, gateways are automatically queried for their sub-devices, which are returned as regular
DeviceInfoobjects that can be individually controlled.Changes
Protocol layer (
network.py)subListcommand and response typescreate_sublist_messageto request sub-device lists from gatewayshandle_sublist_responsehandler for sub-device list responsestfield (used by subList responses)Cipher (
cipher.py)cipher_typeclass attribute toCipherBase,CipherV1("v1"), andCipherV2("v2")CipherBase.create(cipher_type)factory method for creating ciphers by type stringDevice (
device.py)get_sub_devices()method to query a gateway for its sub-devicesbind()now auto-usesgateway_keyandgateway_cipherfromDeviceInfowhen no explicit key is provided, enabling seamless sub-device bindingupdate_state()now properly awaits the state response using an event, preventing race conditionscurrent_temperatureand version detection against non-numeric property valuesDiscovery (
discovery.py)scan()now automatically queries discovered gateways for their sub-devicesinclude_gatewaysparameter to optionally include gateway devices in results (default:False)sub_count > 0from thesubCntfield in scan responsesDevice info (
deviceinfo.py)sub_count,gateway_key, andgateway_cipherfieldsBug fixes
test_mismatch_temrec_farenheit:send.side_effectwas set toNoneinstead of the fake handlertest_issue_69:wraps=fake_send()was calling the function immediately instead of passing it as a callbackTests
Added tests covering:
get_sub_devices()success and timeout pathssubCntparsing, gateway querying, andinclude_gatewaysflag