Migrate http client to use aiohttp instead of httpx (#643)

This commit is contained in:
Steven B
2024-01-18 17:32:26 +00:00
committed by GitHub
parent 3b1b0a3c21
commit 642e9a1f5b
10 changed files with 488 additions and 119 deletions

View File

@@ -3,7 +3,7 @@ import logging
import re
import socket
import httpx
import aiohttp
import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
from kasa import (
@@ -314,7 +314,7 @@ async def test_discover_single_http_client(discovery_mock, mocker):
host = "127.0.0.1"
discovery_mock.ip = host
http_client = httpx.AsyncClient()
http_client = aiohttp.ClientSession()
x: SmartDevice = await Discover.discover_single(host)
@@ -331,7 +331,7 @@ async def test_discover_http_client(discovery_mock, mocker):
host = "127.0.0.1"
discovery_mock.ip = host
http_client = httpx.AsyncClient()
http_client = aiohttp.ClientSession()
devices = await Discover.discover(discovery_timeout=0)
x: SmartDevice = devices[host]