mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Enable dynamic hub child creation and deletion on update (#1454)
This commit is contained in:
@@ -38,6 +38,7 @@ Plug 3: False
|
||||
True
|
||||
"""
|
||||
|
||||
from ...device_type import DeviceType
|
||||
from ..smartmodule import SmartModule
|
||||
|
||||
|
||||
@@ -46,3 +47,10 @@ class ChildDevice(SmartModule):
|
||||
|
||||
REQUIRED_COMPONENT = "child_device"
|
||||
QUERY_GETTER_NAME = "get_child_device_list"
|
||||
|
||||
def query(self) -> dict:
|
||||
"""Query to execute during the update cycle."""
|
||||
q = super().query()
|
||||
if self._device.device_type is DeviceType.Hub:
|
||||
q["get_child_device_component_list"] = None
|
||||
return q
|
||||
|
Reference in New Issue
Block a user