mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Generalize smartdevice child support
* Initialize children's modules (and features) using the child component negotiation results * Set device_type based on the device response * Print out child features in cli 'state' * Add --child option to cli 'command' to allow targeting child devices * Guard "generic" features like rssi, ssid, etc. only to devices which have this information
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""Implementation for child devices."""
|
||||
from typing import Dict
|
||||
|
||||
from ..smartmodule import SmartModule
|
||||
|
||||
|
||||
@@ -6,4 +8,12 @@ class ChildDeviceModule(SmartModule):
|
||||
"""Implementation for child devices."""
|
||||
|
||||
REQUIRED_COMPONENT = "child_device"
|
||||
QUERY_GETTER_NAME = "get_child_device_list"
|
||||
|
||||
def query(self) -> Dict:
|
||||
"""Query to execute during the update cycle."""
|
||||
# TODO: There is no need to fetch the component list every time,
|
||||
# so this should be optimized only for the init.
|
||||
return {
|
||||
"get_child_device_list": None,
|
||||
"get_child_device_component_list": None,
|
||||
}
|
||||
|
Reference in New Issue
Block a user