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

@@ -245,6 +245,11 @@ class Device(ABC):
"""Return True if the device is dimmable."""
return False
@property
def is_fan(self) -> bool:
"""Return True if the device is a fan."""
return self.device_type == DeviceType.Fan
@property
def is_variable_color_temp(self) -> bool:
"""Return True if the device supports color temperature."""