mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24: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:
@@ -2,7 +2,7 @@
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from ...exceptions import SmartDeviceException
|
||||
from ...exceptions import KasaException
|
||||
from ..iotmodule import IotModule
|
||||
|
||||
|
||||
@@ -54,9 +54,7 @@ class Motion(IotModule):
|
||||
elif range is not None:
|
||||
payload = {"index": range.value}
|
||||
else:
|
||||
raise SmartDeviceException(
|
||||
"Either range or custom_range need to be defined"
|
||||
)
|
||||
raise KasaException("Either range or custom_range need to be defined")
|
||||
|
||||
return await self.call("set_trigger_sens", payload)
|
||||
|
||||
|
Reference in New Issue
Block a user