Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pairing devices #859

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add support for pairing devices #859

wants to merge 3 commits into from

Conversation

rytilahti
Copy link
Member

@rytilahti rytilahti commented Apr 23, 2024

This implements "child_quick_setup" that allows pairing and unpairing devices with a hub.
Three new cli commands are added to make the process smooth:

  • kasa child list lists current children and their device ids
  • kasa child pair searches for unpaired devices and performs pairing after something is discovered. The search ends immediately after finding the first device that can be paired.
  • kasa child unpair <device_id> allows unpairing an existing device.

TBD:

@rytilahti rytilahti added the enhancement New feature or request label Apr 23, 2024
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 42.02899% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 88.46%. Comparing base (c5d65b6) to head (b6d5eb1).

❗ Current head b6d5eb1 differs from pull request most recent head 7f302aa. Consider uploading reports for the commit 7f302aa to get more accurate results

Files Patch % Lines
kasa/smart/modules/childsetup.py 37.50% 24 Missing and 1 partial ⚠️
kasa/cli.py 46.42% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #859      +/-   ##
==========================================
- Coverage   90.48%   88.46%   -2.02%     
==========================================
  Files          70       68       -2     
  Lines        4937     4732     -205     
  Branches     1218     1165      -53     
==========================================
- Hits         4467     4186     -281     
- Misses        380      459      +79     
+ Partials       90       87       -3     

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

@rytilahti
Copy link
Member Author

Just to avoid forgetting about it, pairing/removing a device will require us to perform the initial update again in the main device to initialize the newly added devices. Currently the subsequent updates will receive a new device, but the children is not updated accordingly.

For homeassistant UX, we will also need a way to re-trigger platform initialization for the new device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant