mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-02-27 21:29:57 +00:00
New Wi-Fi handling for SMARTCAM devices (#1639)
Some checks failed
CI / Perform Lint Checks (3.13) (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.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.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
CodeQL Checks / Analyze (python) (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.13) (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.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.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
CodeQL Checks / Analyze (python) (push) Has been cancelled
Updated scanning and joining Wi-Fi for SMARTCAM devices that may use a newer connection process.
This commit is contained in:
@@ -256,6 +256,52 @@ class FakeSmartCamTransport(BaseTransport):
|
||||
method = request_dict["method"]
|
||||
|
||||
info = self.info
|
||||
if method == "connectAp":
|
||||
if self.verbatim:
|
||||
return {"error_code": -1}
|
||||
return {"result": {}, "error_code": 0}
|
||||
if method == "scanApList":
|
||||
if method in info:
|
||||
result = self._get_method_from_info(method, request_dict.get("params"))
|
||||
if not self.verbatim:
|
||||
scan = (
|
||||
result.get("result", {}).get("onboarding", {}).get("scan", {})
|
||||
)
|
||||
ap_list = scan.get("ap_list")
|
||||
if isinstance(ap_list, list) and not any(
|
||||
ap.get("ssid") == "FOOBAR" for ap in ap_list
|
||||
):
|
||||
ap_list.append(
|
||||
{
|
||||
"ssid": "FOOBAR",
|
||||
"auth": 3,
|
||||
"encryption": 3,
|
||||
"rssi": -40,
|
||||
"bssid": "00:00:00:00:00:00",
|
||||
}
|
||||
)
|
||||
return result
|
||||
if self.verbatim:
|
||||
return {"error_code": -1}
|
||||
return {
|
||||
"result": {
|
||||
"onboarding": {
|
||||
"scan": {
|
||||
"publicKey": "",
|
||||
"ap_list": [
|
||||
{
|
||||
"ssid": "FOOBAR",
|
||||
"auth": 3,
|
||||
"encryption": 3,
|
||||
"rssi": -40,
|
||||
"bssid": "00:00:00:00:00:00",
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
"error_code": 0,
|
||||
}
|
||||
if method == "controlChild":
|
||||
return await self._handle_control_child(
|
||||
request_dict["params"]["childControl"]
|
||||
|
||||
Reference in New Issue
Block a user