mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Raise TimeoutException on discover_single timeout (#632)
This commit is contained in:
parent
5b8280a8d9
commit
fbce755544
@ -25,6 +25,7 @@ from kasa.emeterstatus import EmeterStatus
|
||||
from kasa.exceptions import (
|
||||
AuthenticationException,
|
||||
SmartDeviceException,
|
||||
TimeoutException,
|
||||
UnsupportedDeviceException,
|
||||
)
|
||||
from kasa.iotprotocol import IotProtocol
|
||||
@ -60,6 +61,7 @@ __all__ = [
|
||||
"SmartLightStrip",
|
||||
"AuthenticationException",
|
||||
"UnsupportedDeviceException",
|
||||
"TimeoutException",
|
||||
"Credentials",
|
||||
"DeviceConfig",
|
||||
"ConnectionType",
|
||||
|
@ -22,7 +22,7 @@ from kasa.device_factory import (
|
||||
get_protocol,
|
||||
)
|
||||
from kasa.deviceconfig import ConnectionType, DeviceConfig, EncryptType
|
||||
from kasa.exceptions import UnsupportedDeviceException
|
||||
from kasa.exceptions import TimeoutException, UnsupportedDeviceException
|
||||
from kasa.json import dumps as json_dumps
|
||||
from kasa.json import loads as json_loads
|
||||
from kasa.protocol import TPLinkSmartHomeProtocol
|
||||
@ -347,7 +347,7 @@ class Discover:
|
||||
async with asyncio_timeout(discovery_timeout):
|
||||
await event.wait()
|
||||
except asyncio.TimeoutError as ex:
|
||||
raise SmartDeviceException(
|
||||
raise TimeoutException(
|
||||
f"Timed out getting discovery response for {host}"
|
||||
) from ex
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user