mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-06 21:03:50 +00:00
fix: use KLAP v2 transport for IOT devices with login version 2 (#1731)
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
Some IOT-family devices keep the legacy IOT command set after a firmware update but upgrade their KLAP authentication to login version 2 (sha256 hashing). This change selects `KlapTransportV2` for `IOT.KLAP` devices that advertise `login_version >= 2`, matching the transport already used for `SMART.KLAP`. Devices with login version 1 (or unset) are unchanged and continue to use the v1 `KlapTransport`. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -259,6 +259,18 @@ ET = DeviceEncryptionType
|
||||
KlapTransport,
|
||||
id="iot-klap",
|
||||
),
|
||||
pytest.param(
|
||||
CP(DF.IotSmartPlugSwitch, ET.Klap, login_version=1, https=False),
|
||||
IotProtocol,
|
||||
KlapTransport,
|
||||
id="iot-klap-v1",
|
||||
),
|
||||
pytest.param(
|
||||
CP(DF.IotSmartPlugSwitch, ET.Klap, login_version=2, https=False),
|
||||
IotProtocol,
|
||||
KlapTransportV2,
|
||||
id="iot-klap-v2",
|
||||
),
|
||||
pytest.param(
|
||||
CP(DF.IotSmartPlugSwitch, ET.Xor, https=False),
|
||||
IotProtocol,
|
||||
|
||||
Reference in New Issue
Block a user