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:
Steven B
2024-05-02 13:55:08 +01:00
committed by GitHub
parent b2194a1c62
commit 28d41092e5
4 changed files with 14 additions and 8 deletions

View File

@@ -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):