mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-07 11:14:02 +00:00
Better checking of child modules not supported by parent device (#966)
Replaces the logic to skip adding child modules to parent devices based on whether a device is a wall switch and instead relies on the `_check_supported` method. Is more future proof and will fix issue with the P300 with child `auto_off` modules https://github.com/python-kasa/python-kasa/pull/915 not supported on the parent.
This commit is contained in:
@@ -202,10 +202,6 @@ class SmartDevice(Device):
|
||||
child_modules_to_skip = {}
|
||||
if self._parent and self._parent.device_type != DeviceType.Hub:
|
||||
skip_parent_only_modules = True
|
||||
elif self._children and self.device_type == DeviceType.WallSwitch:
|
||||
# _initialize_modules is called on the parent after the children
|
||||
for child in self._children.values():
|
||||
child_modules_to_skip.update(**child.modules)
|
||||
|
||||
for mod in SmartModule.REGISTERED_MODULES.values():
|
||||
_LOGGER.debug("%s requires %s", mod, mod.REQUIRED_COMPONENT)
|
||||
|
Reference in New Issue
Block a user