mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-28 12:18:26 +00:00
Update interfaces so they all inherit from Device (#893)
Brings consistency to the api across Smart and Iot so the interfaces can be used for their specialist methods as well as the device methods (e.g. turn_on/off).
This commit is contained in:
@@ -7,6 +7,8 @@ from typing import NamedTuple, Optional
|
||||
|
||||
from pydantic.v1 import BaseModel
|
||||
|
||||
from .device import Device
|
||||
|
||||
|
||||
class ColorTempRange(NamedTuple):
|
||||
"""Color temperature range."""
|
||||
@@ -40,7 +42,7 @@ class BulbPreset(BaseModel):
|
||||
mode: Optional[int] # noqa: UP007
|
||||
|
||||
|
||||
class Bulb(ABC):
|
||||
class Bulb(Device, ABC):
|
||||
"""Base class for TP-Link Bulb."""
|
||||
|
||||
def _raise_for_invalid_brightness(self, value):
|
||||
|
||||
Reference in New Issue
Block a user