mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-13 02:48:07 +00:00
Add support for pairing devices with hubs (#859)
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -537,6 +537,21 @@ class SmartDevice(Device):
|
||||
)
|
||||
)
|
||||
|
||||
if self.parent is not None and (
|
||||
cs := self.parent.modules.get(Module.ChildSetup)
|
||||
):
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=self,
|
||||
id="unpair",
|
||||
name="Unpair device",
|
||||
container=cs,
|
||||
attribute_setter=lambda: cs.unpair(self.device_id),
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Action,
|
||||
)
|
||||
)
|
||||
|
||||
for module in self.modules.values():
|
||||
module._initialize_features()
|
||||
for feat in module._module_features.values():
|
||||
|
Reference in New Issue
Block a user