mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Document hashing of credentials
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
|
||||
:::{note}
|
||||
The library is fully async and methods that perform IO need to be run inside an async coroutine.
|
||||
|
||||
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.
|
||||
:::
|
||||
|
||||
Code examples assume you are following them inside `asyncio REPL`:
|
||||
```
|
||||
$ python -m asyncio
|
||||
@@ -11,16 +20,14 @@ import asyncio
|
||||
from kasa import Discover
|
||||
|
||||
async def main():
|
||||
dev = await Discover.discover_single("127.0.0.1",username="un@example.com",password="pw")
|
||||
dev = await Discover.discover_single("127.0.0.1", username="un@example.com", password="pw")
|
||||
await dev.turn_on()
|
||||
await dev.update()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
```
|
||||
**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.*
|
||||
::::{include} ../creds_hashing.md
|
||||
|
||||
:::
|
||||
|
4
docs/source/creds_hashing.md
Normal file
4
docs/source/creds_hashing.md
Normal file
@@ -0,0 +1,4 @@
|
||||
:::{important}
|
||||
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.
|
||||
:::
|
Reference in New Issue
Block a user