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:
@@ -14,6 +14,9 @@ Discovery returns a list of discovered devices:
|
||||
>>> print(device.alias) # Alias is None because update() has not been called
|
||||
None
|
||||
|
||||
.. include:: ../creds_hashing.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
>>> config_dict = device.config.to_dict()
|
||||
>>> # DeviceConfig.to_dict() can be used to store for later
|
||||
>>> print(config_dict)
|
||||
|
@@ -24,7 +24,7 @@ Discovery returns a dict of {ip: discovered devices}:
|
||||
>>> [dev.model for dev in found_devices.values()]
|
||||
['KP303', 'HS110', 'L530E', 'KL430', 'HS220']
|
||||
|
||||
You can pass username and password for devices requiring authentication
|
||||
You can pass username and password for devices requiring authentication:
|
||||
|
||||
>>> devices = await Discover.discover(
|
||||
>>> username="user@example.com",
|
||||
@@ -33,13 +33,16 @@ You can pass username and password for devices requiring authentication
|
||||
>>> print(len(devices))
|
||||
5
|
||||
|
||||
You can also pass a :class:`kasa.Credentials`
|
||||
You can also pass a :class:`kasa.Credentials`:
|
||||
|
||||
>>> creds = Credentials("user@example.com", "great_password")
|
||||
>>> devices = await Discover.discover(credentials=creds)
|
||||
>>> print(len(devices))
|
||||
5
|
||||
|
||||
.. include:: ../creds_hashing.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
Discovery can also be targeted to a specific broadcast address instead of
|
||||
the default 255.255.255.255:
|
||||
|
||||
|
Reference in New Issue
Block a user