mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 18:38:03 +00:00
Make parent attribute on device consistent across iot and smart (#1023)
Both device types now have an internal `_parent` and a public property getter
This commit is contained in:
@@ -328,6 +328,11 @@ class Device(ABC):
|
||||
"""Send a raw query to the device."""
|
||||
return await self.protocol.query(request=request)
|
||||
|
||||
@property
|
||||
def parent(self) -> Device | None:
|
||||
"""Return the parent on child devices."""
|
||||
return self._parent
|
||||
|
||||
@property
|
||||
def children(self) -> Sequence[Device]:
|
||||
"""Returns the child devices."""
|
||||
|
Reference in New Issue
Block a user