A `credentials_hash` is specific to the transport that produced it, but
nothing checked that the hash a transport was handed was its own.
This matters because a device can change its encryption type without the
credentials changing. For example, toggling **Third-Party Compatibility** in the Tapo
app moves a plug or strip between TPAP and KLAP, and firmware updates are known to introduce new transports.
This introduces a per-transport check that the hash has the shape that transport produces, and treats a foreign hash as absent rather than as a bad password. This makes the failure honest but still ends in a reauth.
This also changes how credentials are read back out when the hash is one of the plaintext forms and lets the transport derive its own, so the change of encryption type needs no reauth in all cases.
Updates to get_default_credentials and DEFAULT_CREDENTIALS for handling
a new default password for encryption_type 3 in TAPOCAMERA devices that
use encryption_type 3.
This adds support for devices like TC40.
Add LinkieTransportV2 transport used by kasa cameras and a basic
implementation for IOT.IPCAMERA (kasacam) devices.
---------
Co-authored-by: Zach Price <pricezt@ornl.gov>
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
* Add plumbing for passing credentials as far as discovery
* Pass credentials to Smart devices
* Rename authentication exception
* Fix tests failure due to test_json_output leaving echo as nop
* Fix test_credentials test
* Do not print credentials, fix echo function bug and improve get type parameter
* Add device class constructor test
* Add comment for echo handling and move assignment