2024-10-24 16:22:45 +00:00
|
|
|
"""Module for child devices."""
|
|
|
|
|
|
|
|
from ...device_type import DeviceType
|
2024-11-23 08:07:47 +00:00
|
|
|
from ..smartcammodule import SmartCamModule
|
2024-10-24 16:22:45 +00:00
|
|
|
|
|
|
|
|
2024-11-23 08:07:47 +00:00
|
|
|
class ChildDevice(SmartCamModule):
|
2024-10-24 16:22:45 +00:00
|
|
|
"""Implementation for child devices."""
|
|
|
|
|
2024-11-13 10:21:12 +00:00
|
|
|
REQUIRED_COMPONENT = "childControl"
|
2024-10-24 16:22:45 +00:00
|
|
|
NAME = "childdevice"
|
|
|
|
QUERY_GETTER_NAME = "getChildDeviceList"
|
2024-10-29 07:11:31 +00:00
|
|
|
# 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"
|
2024-10-24 16:22:45 +00:00
|
|
|
|
|
|
|
def query(self) -> dict:
|
|
|
|
"""Query to execute during the update cycle.
|
|
|
|
|
|
|
|
Default implementation uses the raw query getter w/o parameters.
|
|
|
|
"""
|
2024-10-29 07:11:31 +00:00
|
|
|
return {self.QUERY_GETTER_NAME: {"childControl": {"start_index": 0}}}
|
2024-10-24 16:22:45 +00:00
|
|
|
|
|
|
|
async def _check_supported(self) -> bool:
|
|
|
|
"""Additional check to see if the module is supported by the device."""
|
|
|
|
return self._device.device_type is DeviceType.Hub
|