This repository has been archived on 2023-06-10. You can view files and clone it, but cannot push or open issues or pull requests.
homeassistant-config/deps/lib/python3.10/site-packages/pytapo/temp.py
darthsandmann d1289421b9 updates
2023-02-11 19:37:07 +01:00

59 lines
2.6 KiB
Python

def scan(self):
requests = self.performRequest(
{
"method": "multipleRequest",
"params": {
"requests": [
{
"method": "getDeviceInfo",
"params": {"device_info": {"name": ["basic_info"]}},
}, # correct request, OK
{
"method": "getDeviceInfo",
"params": {"device_infoBAD": {"name": ["basic_info"]}},
}, # incorrect param key: -40106
{
"method": "getDeviceInfo",
"params": {"device_info": {"name": ["basic_infoBAD"]}},
}, # incorrect value in array: -40106
{
"method": "getDeviceInfo",
"params": {"device_info": {"name": []}},
}, # empty array: OK
{
"method": "getDeviceInfo",
"params": {"device_info": {"name": "null"}},
}, # incorrect value type: -40106
{
"method": "getDeviceInfoBAD",
"params": {"device_info": {"name": []}},
}, # incorrect function name: -40210
{
"method": "getDeviceInfo",
"paramssssss": {"device_info": {"name": []}},
}, # incorrect params key name, OK
{"method": "getDeviceInfo"}, # only method, OK
{"method": "getDeviceInfoBAD"}, # method does not exist: -40210
{
"method": "getConnectStatus"
}, # -40210 this means the function does not exist
{
"method": "scanApList"
}, # -40210 this means the function does not exist
{
"method": "connectAp"
}, # -40210 this means the function does not exist
{
"method": "getConnectionType",
"params": {"network": {"get_connection_type": []}},
}, # todo: create wifi function
]
},
}
)
for request in requests["result"]["responses"]:
print(request)
return True