Skip to content

Conversation

@rytilahti
Copy link
Member

This improves the documentation to inform library users that the credentials hashed and are thus case-sensitive.
Added the note also to codeinfo.md for now, but perhaps it's too much considering the same note appears also in places where the credentials are discussed?

Related comments:

Thanks to @TheHairforce and @ZeliardM for helping spot the issue, I will create a separate PR to update the exception messages to help users encountering the challenge hash mismatch.

@rytilahti rytilahti added the documentation Improvements or additions to documentation label Jan 3, 2025
@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.52%. Comparing base (0a95a41) to head (eb0cc7c).
Report is 77 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1416   +/-   ##
=======================================
  Coverage   92.52%   92.52%           
=======================================
  Files         132      132           
  Lines        8251     8251           
  Branches      848      848           
=======================================
  Hits         7634     7634           
  Misses        453      453           
  Partials      164      164           

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines +4 to +12

The main entry point for the API is {meth}`~kasa.Discover.discover` and
{meth}`~kasa.Discover.discover_single` which return Device objects.
Most newer devices require your TP-Link cloud username and password, but this can be omitted for older devices.

:::{important}
All of your code needs to run inside the same event loop so only call `asyncio.run` once.
:::

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The main entry point for the API is {meth}`~kasa.Discover.discover` and
{meth}`~kasa.Discover.discover_single` which return Device objects.
Most newer devices require your TP-Link cloud username and password, but this can be omitted for older devices.
:::{important}
All of your code needs to run inside the same event loop so only call `asyncio.run` once.
:::
The main entry point for the API is {meth}`~kasa.Discover.discover` and
{meth}`~kasa.Discover.discover_single` which return Device objects.
Most newer devices require your TP-Link cloud username and password, but this can be omitted for older devices.
**All of your code needs to run inside the same event loop so only call `asyncio.run` once.**

I think this looked better as a self contained note which separated it from the rest of the details on each page. Making the asyncio.run seems to end the note and breaks up the whole thing.

Before:

image

After:

image

Perhaps the note should self-contain all the details about the async, and then a subsequent important section contains everything about the credentials.

Comment on lines +2 to +3
Most transports hash the credentials, so both *username* (e-mail) and *password* are case-sensitive.
If you are unable to authenticate with the device, verify they match to your account.
Copy link
Collaborator

@sdb9696 sdb9696 Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Most transports hash the credentials, so both *username* (e-mail) and *password* are case-sensitive.
If you are unable to authenticate with the device, verify they match to your account.
Credentials are required by newer Kasa devices and all Tapo devices.
They are the TPLink cloud *username* (e-mail) and *password* used to provision the device in the native app, and they are usually both case-sensitive.
Some firmware versions of Tapo Cameras will not authenticate unless you enable Tapo Lab > Third-Party Compatibility in the native Tapo app.

Users probably don't need to know about hashing or transports, just that credentials are usually case sensitive. Probably makes sense to have all the relevant credentials information in the one snippet.

Comment on lines +43 to +45
.. include:: ../creds_hashing.md
:parser: myst_parser.sphinx_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. include:: ../creds_hashing.md
:parser: myst_parser.sphinx_

This is repeated at the top of the page. We should either remove it from codeinfo.md or remove it here. Maybe it's better to remove it from codeinfo.md so we can place it where it's most relevant.

@github-actions
Copy link

github-actions bot commented Apr 5, 2025

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Apr 5, 2025
@rytilahti rytilahti added no-stale and removed stale labels Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation no-stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants