Add Tapo cloud device support alongside Kasa#112
Merged
Conversation
Support TP-Link Tapo devices by authenticating against both the Kasa and Tapo cloud APIs in parallel. Both use the same V2 HMAC-SHA1 signing protocol but with different host, signing keys, and app identifiers (discovered via Tapo APK reverse engineering). Key changes: - signing.py: Add Tapo signing keys, make functions accept configurable keys - client.py: Support dual cloud types with separate host/keys/appType - device_client.py: Handle Tapo V2 passthrough format (/api/v2/common/passthrough) - device_info.py: Track which cloud a device belongs to (cloud_type) - device_manager.py: Login to both clouds, merge device lists with deduplication - New include_tapo parameter (default True) on TPLinkDeviceManager Tapo cloud differences from Kasa: - Host: n-wap.i.tplinkcloud.com (vs n-wap.tplinkcloud.com) - Passthrough: POST /api/v2/common/passthrough with flat body - App type: TP-Link_Tapo_Android
Add documentation for the new dual-cloud architecture, Tapo device compatibility list, cloud_type attribute, and include_tapo parameter.
This was referenced Feb 8, 2026
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.
Summary
Expand the library to support TP-Link Tapo devices by authenticating against both the Kasa and Tapo cloud APIs. Both clouds use the same V2 HMAC-SHA1 signing protocol but with different hosts, signing keys, app identifiers, and passthrough URL formats.
get_devices()now returns both Kasa and Tapo devices withcloud_typeattribute for identificationTPLinkDeviceManagerlogs into both Kasa (n-wap.tplinkcloud.com) and Tapo (n-wap.i.tplinkcloud.com) clouds with the same credentials/api/v2/common/passthroughwith a flat{deviceId, requestData}body (vs Kasa's{"method":"passthrough","params":{...}}wrapper)include_tapoparameter defaults toTrue; existing code works unchangedTechnical details (from Tapo APK reverse engineering)
n-wap.tplinkcloud.comn-wap.i.tplinkcloud.comKasa_Android_MixTP-Link_Tapo_Android/with method wrapper/api/v2/common/passthroughflatFiles changed
signing.py— Configurable signing keys (Kasa + Tapo constants)client.py— Dual-cloud support with separate host/keys/appType per clouddevice_client.py— V2 passthrough format for Tapo devicesdevice_info.py—cloud_typetrackingdevice_manager.py— Dual login, merged device listing, deduplicationtest_tapo_devices.py— 12 new tests across 4 test classesTest plan
cloud_typeinclude_tapo=Falseexcludes Tapo devices