mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-14 11:28:02 +00:00
Rename and deprecate exception classes (#739)
# Public # SmartDeviceException -> KasaException UnsupportedDeviceException(SmartDeviceException) -> UnsupportedDeviceError(KasaException) TimeoutException(SmartDeviceException, asyncio.TimeoutError) -> TimeoutError(KasaException, asyncio.TimeoutError) Add new exception for error codes -> DeviceError(KasaException) AuthenticationException(SmartDeviceException) -> AuthenticationError(DeviceError) # Internal # RetryableException(SmartDeviceException) -> _RetryableError(DeviceError) ConnectionException(SmartDeviceException) -> _ConnectionError(KasaException)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import warnings
|
||||
from json import loads as json_loads
|
||||
|
||||
from kasa import Credentials, DeviceConfig, SmartDeviceException, SmartProtocol
|
||||
from kasa import Credentials, DeviceConfig, KasaException, SmartProtocol
|
||||
from kasa.protocol import BaseTransport
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class FakeSmartTransport(BaseTransport):
|
||||
)
|
||||
return {"result": missing_result[1], "error_code": 0}
|
||||
else:
|
||||
raise SmartDeviceException(f"Fixture doesn't support {method}")
|
||||
raise KasaException(f"Fixture doesn't support {method}")
|
||||
elif method == "set_qs_info":
|
||||
return {"error_code": 0}
|
||||
elif method[:4] == "set_":
|
||||
|
Reference in New Issue
Block a user