mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Fix smartcamera childdevice module (#1206)
Unlike most `smartcamera` queries, the child info query request and response have different section names, i.e. `controlChild` and `child_device_list` respectively.
This commit is contained in:
parent
440b2d153b
commit
e7f921299a
@ -9,14 +9,16 @@ class ChildDevice(SmartCameraModule):
|
|||||||
|
|
||||||
NAME = "childdevice"
|
NAME = "childdevice"
|
||||||
QUERY_GETTER_NAME = "getChildDeviceList"
|
QUERY_GETTER_NAME = "getChildDeviceList"
|
||||||
QUERY_MODULE_NAME = "childControl"
|
# This module is unusual in that QUERY_MODULE_NAME in the response is not
|
||||||
|
# the same one used in the request.
|
||||||
|
QUERY_MODULE_NAME = "child_device_list"
|
||||||
|
|
||||||
def query(self) -> dict:
|
def query(self) -> dict:
|
||||||
"""Query to execute during the update cycle.
|
"""Query to execute during the update cycle.
|
||||||
|
|
||||||
Default implementation uses the raw query getter w/o parameters.
|
Default implementation uses the raw query getter w/o parameters.
|
||||||
"""
|
"""
|
||||||
return {self.QUERY_GETTER_NAME: {self.QUERY_MODULE_NAME: {"start_index": 0}}}
|
return {self.QUERY_GETTER_NAME: {"childControl": {"start_index": 0}}}
|
||||||
|
|
||||||
async def _check_supported(self) -> bool:
|
async def _check_supported(self) -> bool:
|
||||||
"""Additional check to see if the module is supported by the device."""
|
"""Additional check to see if the module is supported by the device."""
|
||||||
|
Loading…
Reference in New Issue
Block a user